Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- - hosts: ios-test
- gather_facts: no
- connection: local
- tasks:
- - name: obtain login credentials
- include_vars: secrets.yml
- - name: define provider
- set_fact:
- provider:
- host: "{{ inventory_hostname }}"
- username: "{{ creds['username'] }}"
- password: "{{ creds['password'] }}"
- auth_pass: "{{ creds['auth_pass'] }}"
- - name: ping ntp server 10.0.15.69
- ios_command:
- provider: "{{ provider }}"
- commands:
- - ping 10.0.15.69
- register: pingntp2
- - debug: var=pingntp2
- - name: set ntp server 10.0.15.69
- ios_config:
- lines:
- - ntp server 10.0.15.69 key 2341 source Loopback0
- match: line
- provider: "{{ provider }}"
- #when: pingntp2.stdout_lines.count("!") > 0
- register: ntp2config
- ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement