* adding OS9 ansible collections * adding OS9 collections Co-authored-by: Patil <Komal_uttamrao_Patil@Dell.com>
41 lines
No EOL
1.1 KiB
Django/Jinja
41 lines
No EOL
1.1 KiB
Django/Jinja
#jinja2: trim_blocks: True,lstrip_blocks: True
|
|
{#############################################
|
|
Purpose:
|
|
Configure NTP commands for os9 Devices
|
|
os9_ntp:
|
|
server:
|
|
- ip: 2.2.2.2
|
|
vrf:
|
|
- test
|
|
- management
|
|
state: present
|
|
###################################################}
|
|
{% if os9_ntp is defined and os9_ntp %}
|
|
|
|
{% for key,value in os9_ntp.items() %}
|
|
{% if key == "server" and value %}
|
|
{% for item in value %}
|
|
{% if item.ip is defined and item.ip %}
|
|
{% if item.state is defined and item.state == "absent" %}
|
|
{% if item.vrf is defined and item.vrf %}
|
|
{% for vrf_name in item.vrf %}
|
|
no ntp server vrf {{ vrf_name }} {{ item.ip }}
|
|
{% endfor %}
|
|
{% else %}
|
|
no ntp server {{ item.ip }}
|
|
{% endif %}
|
|
{% else %}
|
|
{% if item.vrf is defined and item.vrf %}
|
|
{% for vrf_name in item.vrf %}
|
|
ntp server vrf {{ vrf_name }} {{ item.ip }}
|
|
{% endfor %}
|
|
{% else %}
|
|
ntp server {{ item.ip }}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
{% endif %} |