kayobe/ansible/time.yml
Mark Goddard 9d3045dbf0 ntp: check for ntp group in inventory
The Wallaby release adds support for configuring a chrony daemon on
hosts in the ntp group. The kolla chrony container is disabled by
default, meaning that users could be left without an NTP client if they
forget to add hosts to the ntp group.

This change adds a check for the existence of an ntp group in the
inventory. The group may be empty.

Change-Id: Ic0ff71bb11692eb6c5699a1673df2d16b8f894ec
Story: 2007872
Task: 42533
2021-05-27 15:19:33 +01:00

34 lines
682 B
YAML

---
- name: Ensure timezone is configured
hosts: seed-hypervisor:seed:overcloud
tags:
- timezone
tasks:
- import_role:
name: yatesr.timezone
become: True
- name: Ensure ntp group exists
hosts: all
gather_facts: no
tags:
- ntp
tasks:
- name: Ensure ntp group exists
fail:
msg: >-
The 'ntp' group does not exist in the Ansible inventory.
run_once: true
when:
- "'ntp' not in groups"
- not kolla_enable_chrony | bool
- name: Ensure Chrony is installed and configured
hosts: ntp
tags:
- ntp
tasks:
- import_role:
name: ntp
when: not kolla_enable_chrony | bool