Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ansible.cfg:
- [defaults]
- host_key_checking=false
- inventory=inventory
- [persistent_connection]
- command_timeout=600
- connect_timeout=600
- provider:
- cli:
- host: nxos3k
- port: 22
- transport: cli
- timeout: 700
- PLAYBOOK:
- tasks:
- - name: nxos_install_os
- nxos_install_os:
- system_image_file: n3000-uk9.6.0.2.U4.3.bin
- kickstart_image_file: n3000-uk9-kickstart.6.0.2.U4.3.bin
- provider: "{{ cli }}"
- register: result
- - debug: msg=" {{ result['install_state'] }}"
- - name: Wait for device to come back up with new image
- wait_for:
- port: 22
- state: started
- timeout: 600
- delay: 60
- host: "{{ inventory_hostname }}"
- when: result.changed
- - debug: msg='Wait 5 mins to allow system to stabilize'
- when: result.changed
- - pause:
- seconds: 300
- when: result.changed
- - name: reset connection
- meta: reset_connection
- - name: check installation
- nxos_command:
- commands: ['show version']
- provider: "{{ cli }}"
Add Comment
Please, Sign In to add comment