-
Notifications
You must be signed in to change notification settings - Fork 73
/
intent_ntp.yml
42 lines (31 loc) · 893 Bytes
/
intent_ntp.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
- hosts: ios
gather_facts: no
vars:
ntp_servers:
- ntp server 216.239.35.0
- ntp server 216.239.35.4
tasks:
- name: get the current ntp server configs
ios_command:
commands:
- "show running-config full | include ntp server"
register: get_config
- debug: var=get_config.stdout_lines
- name: set ntp server commands
with_items: "{{ ntp_servers }}"
ios_config:
lines:
- "{{ item }}"
register: set_ntp
- name: remove ntp server commands
when: "(get_config.stdout_lines[0] != '') and (item not in ntp_servers)"
with_items: "{{ get_config.stdout_lines[0] }}"
register: remove_ntp
ios_config:
lines:
- "no {{ item }}"
- name: servicenow_network_tickets
when: set_ntp.changed or remove_ntp.changed
import_role:
name: servicenow_network_tickets