Jump to content
Калькуляторы

Ansible + Allied Telesis AT-8000S

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

 

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

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

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

Share this post


Link to post
Share on other sites

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_

Share this post


Link to post
Share on other sites

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.