# Ansible NTP Install/Config

**URL:** <https://forum.ansible.com/t/ansible-ntp-install-config/30736>\
**Category:** Ansible Project\
**Tags:** rhel, fedora, ubuntu\
**Created:** [July 9, 2019, 6:38pm UTC](https://forum.ansible.com/t/ansible-ntp-install-config/30736 "2019-07-09T18:38:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Keith\_Mills](https://avatars.discourse-cdn.com/v4/letter/k/b77776/32.png) [@Keith\_Mills](https://forum.ansible.com/u/Keith_Mills)\
**Post date:** [July 9, 2019, 6:38pm UTC](https://forum.ansible.com/t/ansible-ntp-install-config/30736/1 "2019-07-09T18:38:31Z")

</div>

I am new to Ansible!

I’m working on an NTP Install/Configure Project. I have a main.yaml file, a ntp.yaml playbook and 4 tasks (debian-ntp.yaml, redhat-ntp.yaml, sles-ntp.yaml, ubuntu-ntp.yaml). I can’t seem to get this to work.

```auto
ansible --version
ansible 2.8.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/kjames/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Apr 9 2019, 14:30:50) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]

cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"

```

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [July 9, 2019, 6:40pm UTC](https://forum.ansible.com/t/ansible-ntp-install-config/30736/2 "2019-07-09T18:40:55Z")

</div>

Your files are lower cased, ansible\_distribution is not.

To match your other logic, you probably want to do this:

include\_tasks: “{{ ansible\_distribution|lower }}-ntp.yaml”

---

<div class="post-metadata">

**Author:** ![Keith\_Mills](https://avatars.discourse-cdn.com/v4/letter/k/b77776/32.png) [@Keith\_Mills](https://forum.ansible.com/u/Keith_Mills)\
**Post date:** [July 9, 2019, 6:44pm UTC](https://forum.ansible.com/t/ansible-ntp-install-config/30736/3 "2019-07-09T18:44:23Z")

</div>

This is what I know:

`RedHat`, `Debian`, `SLES`… returned by `ansible_distribution` all have capitals somewhere in the naming, as you can see in the error message. My files are all lowercase. I have checked and there are no capitals in my naming.

In my playbook `include_tasks: "{{ ansible_distribution }}-ntp.yaml"` is the reason for the error. Either I can fix my file names to match mixed case returned by the variable or turn everything to lower case with the `lower` filter as it is done elsewhere in my tasks files. I don’t know how to do either of these! I’ve tried with the lower filter but I still get the same error. I don’t know how to use the match mixed case. Can someone please help?

---

<div class="post-metadata">

**Author:** ![Keith\_Mills](https://avatars.discourse-cdn.com/v4/letter/k/b77776/32.png) [@Keith\_Mills](https://forum.ansible.com/u/Keith_Mills)\
**Post date:** [July 9, 2019, 6:47pm UTC](https://forum.ansible.com/t/ansible-ntp-install-config/30736/4 "2019-07-09T18:47:33Z")

</div>

I have used include\_tasks: “{{ ansible\_distribution|lower }}-ntp.yaml” but I get the same error

---

<div class="post-metadata">

**Author:** ![Keith\_Mills](https://avatars.discourse-cdn.com/v4/letter/k/b77776/32.png) [@Keith\_Mills](https://forum.ansible.com/u/Keith_Mills)\
**Post date:** [July 9, 2019, 6:59pm UTC](https://forum.ansible.com/t/ansible-ntp-install-config/30736/5 "2019-07-09T18:59:55Z")

</div>

That worked!

---

<div class="post-metadata">

**Author:** ![Keith\_Mills](https://avatars.discourse-cdn.com/v4/letter/k/b77776/32.png) [@Keith\_Mills](https://forum.ansible.com/u/Keith_Mills)\
**Post date:** [July 9, 2019, 7:50pm UTC](https://forum.ansible.com/t/ansible-ntp-install-config/30736/6 "2019-07-09T19:50:08Z")

</div>

Now I’m getting:

fatal: [xxxxxxxxx]: FAILED! =\> {“msg”: "The task includes an option with an undefined variable. The error was: ‘ntp\_package’ is undefined
