Advertisement
Guest User

Untitled

a guest
Oct 17th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. ---
  2. - hosts: ios-test
  3. gather_facts: no
  4. connection: local
  5.  
  6. tasks:
  7.  
  8. - name: obtain login credentials
  9. include_vars: secrets.yml
  10.  
  11. - name: define provider
  12. set_fact:
  13. provider:
  14. host: "{{ inventory_hostname }}"
  15. username: "{{ creds['username'] }}"
  16. password: "{{ creds['password'] }}"
  17. auth_pass: "{{ creds['auth_pass'] }}"
  18.  
  19. - name: ping ntp server 10.0.15.69
  20. ios_command:
  21. provider: "{{ provider }}"
  22. commands:
  23. - ping 10.0.15.69
  24. register: pingntp2
  25. - debug: var=pingntp2
  26.  
  27. - name: set ntp server 10.0.15.69
  28. ios_config:
  29. lines:
  30. - ntp server 10.0.15.69 key 2341 source Loopback0
  31. match: line
  32. provider: "{{ provider }}"
  33. #when: pingntp2.stdout_lines.count("!") > 0
  34. register: ntp2config
  35. ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement