Guest User

Untitled

a guest
May 22nd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. ansible.cfg:
  2. [defaults]
  3. host_key_checking=false
  4. inventory=inventory
  5.  
  6. [persistent_connection]
  7. command_timeout=600
  8. connect_timeout=600
  9.  
  10.  
  11. provider:
  12. cli:
  13. host: nxos3k
  14. port: 22
  15. transport: cli
  16. timeout: 700
  17.  
  18.  
  19.  
  20. PLAYBOOK:
  21.  
  22. tasks:
  23. - name: nxos_install_os
  24. nxos_install_os:
  25. system_image_file: n3000-uk9.6.0.2.U4.3.bin
  26. kickstart_image_file: n3000-uk9-kickstart.6.0.2.U4.3.bin
  27. provider: "{{ cli }}"
  28. register: result
  29.  
  30. - debug: msg=" {{ result['install_state'] }}"
  31.  
  32. - name: Wait for device to come back up with new image
  33. wait_for:
  34. port: 22
  35. state: started
  36. timeout: 600
  37. delay: 60
  38. host: "{{ inventory_hostname }}"
  39. when: result.changed
  40.  
  41. - debug: msg='Wait 5 mins to allow system to stabilize'
  42. when: result.changed
  43. - pause:
  44. seconds: 300
  45. when: result.changed
  46.  
  47. - name: reset connection
  48. meta: reset_connection
  49.  
  50. - name: check installation
  51. nxos_command:
  52. commands: ['show version']
  53. provider: "{{ cli }}"
Add Comment
Please, Sign In to add comment