Ansible Playbook IOSDevices 2

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

---

- name: Network Getting Started First Playbook FOR CISCO IOS DEVICES
connection: network_cli
gather_facts: false
hosts: all # no HOSTS/INVENTORY
File
tasks:

- name: Get config for IOS devices


ios_facts:
gather_subset: all

- name: Display the config


debug:
# msg: "The hostname is {{ ansible_net_hostname }} and the OS is
{{ ansible_net_version }}"
msg: "{{ hostvars[inventory_hostname] }}"

# RUN THE PLAYBOOK WITH THIS COMMAND


##
### SINGLE Command outlining this:
### ansible all -i LON-RTR-1-11, -c network_cli -u admin -k -m ios_facts -e
ansible_network_os=ios

#### ansible-playbook -i LON-RTR-1-11, -u admin -k -e ansible_network_os=ios


Ansible-Playbook-IOSDevices-2.yml

You might also like