Ansible: CLI Kommandos auf Cisco Devices ausführen und Ausgaben speichern

Beispiel Playbook exec_command.yaml: — – hosts: switch1 connection: local gather_facts: False vars: cli: host: „{{ inventory_hostname }}“ username: „{{ ansible_user }}“ password: „{{ ansible_ssh_pass }}“ tasks: – name: Call show inventory ios_command: commands: show inventory provider: „{{ cli }}“ register: output – name: Store output to file copy: content=“{{ output.stdout[0] }}“ dest=“out/inventory_{{ inventory_hostname }}.txt“ Mit … Weiterlesen