Clean up chrony cleanup

In the Yoga cycle we no longer need kolla chrony container removal
procedures.

Change-Id: I4dc246cf0fd68838470bf9e9bf749fa9be4d6670
This commit is contained in:
Radosław Piliszek 2022-01-18 15:37:51 +00:00
parent 7b3527819f
commit e63bbed18d
5 changed files with 2 additions and 106 deletions

View File

@ -1,33 +0,0 @@
---
- name: Remove chrony container
gather_facts: false
hosts:
- "{{ 'chrony-server' if 'chrony-server' in groups else 'all' }}"
- "{{ 'chrony' if 'chrony' in groups else 'all' }}"
serial: '{{ kolla_serial|default("0") }}'
tags:
- chrony
tasks:
# NOTE(mgoddard): Running against the all group means that some hosts may
# not have docker installed, which would break the kolla_docker module.
# Avoid using service_facts which adds a large fact.
- name: Check if Docker is running # noqa command-instead-of-module
command:
cmd: "systemctl is-active docker.service"
register: systemctl_is_active
changed_when: false
failed_when: false
- block:
- name: Stop and remove chrony container
become: true
kolla_docker:
action: "stop_and_remove_container"
name: chrony
- name: Remove config for chrony
become: true
file:
path: "{{ node_config_directory }}/chrony"
state: "absent"
when: systemctl_is_active.rc == 0

View File

@ -1,25 +1,4 @@
---
# TODO(mgoddard): Remove this check in the Y cycle after chrony has been
# dropped for a cycle.
- name: Get container facts
become: true
kolla_container_facts:
name:
- chrony
register: container_facts
- name: Fail if chrony container is running
fail:
msg: >-
A chrony container is running, but the chrony container is no longer
supported from the Xena release.
The chrony container may be cleaned up via 'kolla-ansible
chrony-cleanup'. You should then install and configure a suitable host
NTP daemon before running these prechecks again.
when:
- "'chrony' in container_facts"
- block:
- name: Check for a running host NTP daemon # noqa command-instead-of-module
vars:
@ -39,8 +18,8 @@
- name: Fail if a host NTP daemon is not running
fail:
msg: >-
No host NTP daemon is running, and the Kolla Ansible chrony container
is disabled. Please install and configure a host NTP daemon.
No host NTP daemon is running.
Please install and configure a host NTP daemon.
Alternatively, set 'prechecks_enable_host_ntp_checks' to 'false' to
disable this check if not using one of the following NTP daemons:
chrony, ntpd, systemd-timesyncd.

View File

@ -90,31 +90,3 @@
until: "'synchronized: yes' in timedatectl_status.stdout"
retries: 90
delay: 10
# TODO(mgoddard): Remove this task in the Y cycle after chrony has been
# dropped for a cycle.
# NOTE(mgoddard): For upgrades, test the case where we are running
# a chrony container, but keep the default of disabled after the
# upgrade.
- block:
- name: Remove host NTP packages
become: true
package:
name:
- chrony
- ntp
state: absent
# NOTE(mgoddard): removing the systemd-timesyncd package fails, so stop
# and disable it instead.
- name: Stop systemd-timesyncd service
become: true
service:
name: systemd-timesyncd
enabled: no
state: stopped
when: ansible_os_family == 'Debian'
when:
- is_upgrade
# cephadm gets grumpy without a host-level chrony.
- scenario != 'cephadm'

View File

@ -8,24 +8,7 @@ export PYTHONUNBUFFERED=1
function upgrade {
local ansible_extra_vars
RAW_INVENTORY=/etc/kolla/inventory
# TODO(mgoddard): Remove this block in the Y cycle after chrony has been
# dropped for a cycle.
# NOTE(mgoddard): Remove the chrony container and install a host chrony
# daemon.
kolla-ansible -i ${RAW_INVENTORY} -vvv chrony-cleanup &> /tmp/logs/ansible/chrony-cleanup
if [[ $(source /etc/os-release && echo $ID) = "centos" ]]; then
chrony_service="chronyd"
ansible_extra_vars=""
else
chrony_service="chrony"
# Force the use of python3 on Debian and Ubuntu remote hosts. These distros
# typically have an unversioned Python interpreter which links to python2.7.
ansible_extra_vars="-e ansible_python_interpreter=/usr/bin/python3"
fi
ansible all -i $RAW_INVENTORY $ansible_extra_vars -m package -a 'name=chrony state=present' -b &> /tmp/logs/ansible/chrony-install
ansible all -i $RAW_INVENTORY $ansible_extra_vars -m service -a 'name='$chrony_service' state=started enabled=yes' -b &>> /tmp/logs/ansible/chrony-install
kolla-ansible -i ${RAW_INVENTORY} -vvv prechecks &> /tmp/logs/ansible/upgrade-prechecks
kolla-ansible -i ${RAW_INVENTORY} -vvv pull &> /tmp/logs/ansible/pull-upgrade

View File

@ -188,7 +188,6 @@ Commands:
upgrade-bifrost Upgrades an existing bifrost container
genconfig Generate configuration files for enabled OpenStack services
prune-images Prune orphaned Kolla images
chrony-cleanup Clean up disabled chrony containers
EOF
}
@ -533,10 +532,6 @@ EOF
exit 1
fi
;;
(chrony-cleanup)
ACTION="Cleanup disabled chrony containers"
PLAYBOOK="${BASEDIR}/ansible/chrony-cleanup.yml"
;;
(bash-completion)
bash_completion
exit 0