From 71d36cbe5e00be6e94ec28fdc1fc28126756e557 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Tue, 25 Feb 2020 15:54:04 +0000 Subject: [PATCH] CentOS 8: Disable ntpd, enable chrony container CentOS 8 does not provide an ntp package. Instead fall back to using the chrony container provided by Kolla Ansible by default. Depends-On: https://review.opendev.org/711511 Change-Id: If5230854d7565c8b3c91a46da4795c63edf095e4 Story: 2006574 Task: 38866 --- ansible/group_vars/all/kolla | 8 +++++--- ansible/group_vars/all/ntp | 11 ++++++++--- doc/source/configuration/hosts.rst | 14 +++++++++++--- etc/kayobe/kolla.yml | 6 ++++-- etc/kayobe/ntp.yml | 6 ++++-- .../notes/centos-8-chrony-bec9d7bc8b346363.yaml | 8 ++++++++ 6 files changed, 40 insertions(+), 13 deletions(-) create mode 100644 releasenotes/notes/centos-8-chrony-bec9d7bc8b346363.yaml diff --git a/ansible/group_vars/all/kolla b/ansible/group_vars/all/kolla index 620e9f3a7..542f58664 100644 --- a/ansible/group_vars/all/kolla +++ b/ansible/group_vars/all/kolla @@ -348,9 +348,11 @@ kolla_enable_blazar: "no" kolla_enable_central_logging: "no" kolla_enable_ceph: "no" kolla_enable_ceilometer: "no" -# The chrony container is disabled by default because we enable an NTP daemon -# on the host. Setting this to true will disable NTP on the host. -kolla_enable_chrony: "no" +# The chrony container is disabled by default on CentOS 7 because we enable an +# NTP daemon on the host. On CentOS 8 the chrony container is enabled by +# default because the NTP daemon is not supported. Setting this to true will +# disable NTP on the host. +kolla_enable_chrony: "{{ ansible_os_family != 'RedHat' or ansible_distribution_major_version | int >= 8 }}" kolla_enable_cinder: "no" kolla_enable_cloudkitty: "no" kolla_enable_collectd: "no" diff --git a/ansible/group_vars/all/ntp b/ansible/group_vars/all/ntp index 074106709..c7d5a34dd 100644 --- a/ansible/group_vars/all/ntp +++ b/ansible/group_vars/all/ntp @@ -10,9 +10,14 @@ timezone: "{{ ansible_date_time.tz }}" ############################################################################### # Network Time Protocol (NTP). -# Whether to enable the NTP daemon on the host. Default is true unless -# 'kolla_enable_chrony' has been set to true on overcloud hosts. -ntp_service_enabled: "{{ 'overcloud' not in group_names or not kolla_enable_chrony | bool }}" +# Whether to enable the NTP daemon on the host. On CentOS 7 the default is true +# unless 'kolla_enable_chrony' has been set to true on overcloud hosts. On +# CentOS 8 the host NTP daemon is not supported, and kolla_enable_chrony is set +# to true by default. +ntp_service_enabled: >- + {{ ansible_os_family == 'RedHat' and + ansible_distribution_major_version | int == 7 and + ('overcloud' not in group_names or not kolla_enable_chrony | bool) }} ntp_package_state: "{{ 'present' if ntp_service_enabled | bool else 'absent' }}" ntp_service_state: "{{ 'started' if ntp_service_enabled | bool else 'stopped' }}" diff --git a/doc/source/configuration/hosts.rst b/doc/source/configuration/hosts.rst index d2b45dffd..12f23eb33 100644 --- a/doc/source/configuration/hosts.rst +++ b/doc/source/configuration/hosts.rst @@ -363,6 +363,11 @@ NTP *tags:* | ``ntp`` +.. note:: + + CentOS 8 does not support configuring an NTP daemon. Use :ref:`chrony + ` instead. + Network Time Protocol (NTP) may be configured via variables in ``${KAYOBE_CONFIG_PATH}/ntp.yml``. The list of NTP servers is configured via ``ntp_config_server``, and by default the ``pool.ntp.org`` @@ -391,14 +396,17 @@ The NTP service may be disabled as follows: ntp_service_enabled: false +.. _configuration-hosts-chrony: + Chrony ------ Kolla Ansible can deploy a chrony container. This is disabled by default in -Kayobe to avoid conflicting with the NTP daemon on the host. +Kayobe on CentOS 7 to avoid conflicting with the NTP daemon on the host. On +CentOS 8 Chrony is enabled by default. -To use the containerised chrony daemon and disable the host NTP daemon, set the -following in ``${KAYOBE_CONFIG_PATH}/kolla.yml``: +To use the containerised chrony daemon and disable the host NTP daemon on +CentOS 7, set the following in ``${KAYOBE_CONFIG_PATH}/kolla.yml``: .. code-block:: yaml diff --git a/etc/kayobe/kolla.yml b/etc/kayobe/kolla.yml index 7541deac5..3c4575247 100644 --- a/etc/kayobe/kolla.yml +++ b/etc/kayobe/kolla.yml @@ -185,8 +185,10 @@ #kolla_enable_ceph_mds: #kolla_enable_ceph_nfs: #kolla_enable_ceph_rgw: -# The chrony container is disabled by default because we enable an NTP daemon -# on the host. Setting this to true will disable NTP on the host. +# The chrony container is disabled by default on CentOS 7 because we enable an +# NTP daemon on the host. On CentOS 8 the chrony container is enabled by +# default because the NTP daemon is not supported. Setting this to true will +# disable NTP on the host. #kolla_enable_chrony: #kolla_enable_cinder: #kolla_enable_cinder_backend_hnas_iscsi: diff --git a/etc/kayobe/ntp.yml b/etc/kayobe/ntp.yml index 783c3daf5..ace7605b6 100644 --- a/etc/kayobe/ntp.yml +++ b/etc/kayobe/ntp.yml @@ -10,8 +10,10 @@ ############################################################################### # Network Time Protocol (NTP). -# Whether to enable the NTP daemon on the host. Default is true unless -# 'kolla_enable_chrony' has been set to true on overcloud hosts. +# Whether to enable the NTP daemon on the host. On CentOS 7 the default is true +# unless 'kolla_enable_chrony' has been set to true on overcloud hosts. On +# CentOS 8 the host NTP daemon is not supported, and kolla_enable_chrony is set +# to true by default. #ntp_service_enabled: # List of names of NTP servers. diff --git a/releasenotes/notes/centos-8-chrony-bec9d7bc8b346363.yaml b/releasenotes/notes/centos-8-chrony-bec9d7bc8b346363.yaml new file mode 100644 index 000000000..0f4411201 --- /dev/null +++ b/releasenotes/notes/centos-8-chrony-bec9d7bc8b346363.yaml @@ -0,0 +1,8 @@ +--- +upgrade: + - | + Support for configuring an NTP daemon on the seed and overcloud hosts is no + longer present for CentOS 8, as appropriate packages are not available. + Instead, Kolla Ansible is configured to deploy the ``chrony`` container on + overcloud hosts by default. This may be disabled by setting + ``kolla_enable_chrony`` to ``false``.