cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
478
Views
1
Helpful
1
Replies

Reload Cisco 1100 Series Router with Ansible

kyle-martin
Level 1
Level 1

Does anyone know how to reload a Cisco 1100 Series Router with Ansible?

1 Reply 1

Marcel Zehnder
Spotlight
Spotlight

Hi @kyle-martin 

You can do it via ansible.netcommon.cli_command

Install the module

ansible-galaxy collection install ansible.netcommon

inventory.yml

 

all:
  hosts:
    rtr01:
      ansible_host: <ip or hostname of your router>
  vars:
    ansible_connection: ansible.netcommon.network_cli
    ansible_network_os: cisco.ios.ios  
    ansible_user: <username>
    ansible_password: <password>

 

playbook.yml

 

- name: Reload via CLI module
  gather_facts: false
  hosts: rtr01
  tasks:
    - name: reload
      ansible.netcommon.cli_command:
        command: reload
        prompt: "Proceed with reload?"
        answer: ""

 

Execute

 

ansible-playbook -i inventory.yml -vvv playbook.yml  

 

HTH