# ios\_ntp

**URL:** <https://forum.ansible.com/t/ios-ntp/31854>\
**Category:** Ansible Project\
**Created:** [December 19, 2019, 9:59pm UTC](https://forum.ansible.com/t/ios-ntp/31854 "2019-12-19T21:59:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Spiro\_Mitsialis](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@Spiro\_Mitsialis](https://forum.ansible.com/u/Spiro_Mitsialis)\
**Post date:** [December 19, 2019, 9:59pm UTC](https://forum.ansible.com/t/ios-ntp/31854/1 "2019-12-19T21:59:01Z")

</div>

Has anyone used ios\_ntp for Cisco IOS devices? Its new as of Ansible v2.8. It works fine for 1 NTP server but how do you add a 2nd server.  
I’ve tried the following and neither works. The 2nd method works for DNS with ios\_system but I guess this module is different. Anybody have it working with multiple servers?

```auto
- ios_ntp:
    server: 10.0.255.10
    server: 10.0.255.20

```

---

<div class="post-metadata">

**Author:** ![nchakrab](https://avatars.discourse-cdn.com/v4/letter/n/919ad9/32.png) [@nchakrab](https://forum.ansible.com/u/nchakrab)\
**Post date:** [December 20, 2019, 5:52am UTC](https://forum.ansible.com/t/ios-ntp/31854/2 "2019-12-20T05:52:26Z")

</div>

Hello,

The `server` key in `ios_ntp` is of type string, whereas the `domain_name`, `domain_search` and `name_servers` keys in `ios_system` are of type `list`. Hence, with ios\_ntp, you need to have a separate task to add a second server.

Hope that helps.

---

<div class="post-metadata">

**Author:** ![nchakrab](https://avatars.discourse-cdn.com/v4/letter/n/919ad9/32.png) [@nchakrab](https://forum.ansible.com/u/nchakrab)\
**Post date:** [December 20, 2019, 7:44am UTC](https://forum.ansible.com/t/ios-ntp/31854/3 "2019-12-20T07:44:43Z")

</div>

You can also loop over a list of IP addresses in the same task. For example,

- ios\_ntp:  
server: “{{ item }}”  
loop: “{{ [‘192.0.2.100’, ‘192.0.2.101’] }}”

---

<div class="post-metadata">

**Author:** ![Spiro\_Mitsialis](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@Spiro\_Mitsialis](https://forum.ansible.com/u/Spiro_Mitsialis)\
**Post date:** [December 20, 2019, 1:55pm UTC](https://forum.ansible.com/t/ios-ntp/31854/4 "2019-12-20T13:55:33Z")

</div>

Thanks this works.

It would be very useful if the module would work like ios\_system. If there is another DNS server in the switch config, ios\_system removes it and makes sure only the server listed in the playbook remain.  
Where’s the best place to put feature request?

---

<div class="post-metadata">

**Author:** ![nchakrab](https://avatars.discourse-cdn.com/v4/letter/n/919ad9/32.png) [@nchakrab](https://forum.ansible.com/u/nchakrab)\
**Post date:** [December 20, 2019, 2:33pm UTC](https://forum.ansible.com/t/ios-ntp/31854/5 "2019-12-20T14:33:26Z")

</div>

Sure. You can raise a feature request here - [https://github.com/ansible/ansible/issues/new/choose](https://github.com/ansible/ansible/issues/new/choose).
