Jump to content

Recommended Posts

Posted

Приветствую, Уважаемые!

 

Подскажите, кому-нибудь удалось победить такую связку?

Хотя бы show running-config через ansible.netcommon.telnet.

Прошивки железок 3.0.0.45 (.35), ansible 2.10.17.

  • 1 month later...
Posted (edited)

Расковырял через боль и expect в итоге. Как минимум, работает в ручном запуске playbook-а.

 

---

- hosts: allied_sw
  gather_facts: false
  connection: local
  serial: 1
  vars:
      full_path: /opt/configs/temp

  tasks:
  - name: show run
    ignore_errors: true
    expect:
      command: ssh "{{ inventory_hostname }}"
      echo: yes
      responses:
        User Name: "{{ ansible_user }}"
        Password: "{{ ansible_password }}"
        (.*)#(.*):
          - "terminal datadump\n"
          - "show running-config\n"
          - "exit\n"
      timeout: 120
    register: conf

  - name: write conf in file
    copy: content={{ conf.stdout }} dest={{ full_path }}/{{ inventory_hostname }}.cfg


 

Edited by aser_

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...
На сайте используются файлы cookie и сервисы аналитики для корректной работы форума и улучшения качества обслуживания. Продолжая использовать сайт, вы соглашаетесь с использованием файлов cookie и с Политикой конфиденциальности.