Ansible Cheat Sheet
Ansible Cheat Sheet Facts ansible host -m setup -i inventory.yaml --- - hosts: spine,leaf gather_facts: yes connection: local tasks: # - name: Gather facts (eos) # arista.eos.eos_facts: # when: ansible_network_os == 'arista.eos.eos' - name: Display some facts debug: msg: "The hostname is {{ ansible_net_hostname }} and the OS is {{ ansible_net_version }}" - name: get interface status arista.eos.eos_command: commands: - command: show int status when: ansible_net_version == "4.29.1F" register: int_status - name: Create backup dir file: path: "backup/{{ inventory_hostname }}" state: directory recurse: yes - name: save interface status local_action: module: copy content: "{{ int_status }}" dest: backup/{{ inventory_hostname }}/{{ inventory_hostname }}.