Skip to content
Snippets Groups Projects
Commit e0484019 authored by Zuul's avatar Zuul Committed by Gerrit Code Review
Browse files

Merge "Clean up chrony cleanup"

parents 646868eb e63bbed1
No related branches found
No related tags found
No related merge requests found
---
- 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
--- ---
# 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: - block:
- name: Check for a running host NTP daemon # noqa command-instead-of-module - name: Check for a running host NTP daemon # noqa command-instead-of-module
vars: vars:
...@@ -39,8 +18,8 @@ ...@@ -39,8 +18,8 @@
- name: Fail if a host NTP daemon is not running - name: Fail if a host NTP daemon is not running
fail: fail:
msg: >- msg: >-
No host NTP daemon is running, and the Kolla Ansible chrony container No host NTP daemon is running.
is disabled. Please install and configure a host NTP daemon. Please install and configure a host NTP daemon.
Alternatively, set 'prechecks_enable_host_ntp_checks' to 'false' to Alternatively, set 'prechecks_enable_host_ntp_checks' to 'false' to
disable this check if not using one of the following NTP daemons: disable this check if not using one of the following NTP daemons:
chrony, ntpd, systemd-timesyncd. chrony, ntpd, systemd-timesyncd.
......
...@@ -90,31 +90,3 @@ ...@@ -90,31 +90,3 @@
until: "'synchronized: yes' in timedatectl_status.stdout" until: "'synchronized: yes' in timedatectl_status.stdout"
retries: 90 retries: 90
delay: 10 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'
...@@ -8,24 +8,7 @@ export PYTHONUNBUFFERED=1 ...@@ -8,24 +8,7 @@ export PYTHONUNBUFFERED=1
function upgrade { function upgrade {
local ansible_extra_vars
RAW_INVENTORY=/etc/kolla/inventory 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 prechecks &> /tmp/logs/ansible/upgrade-prechecks
kolla-ansible -i ${RAW_INVENTORY} -vvv pull &> /tmp/logs/ansible/pull-upgrade kolla-ansible -i ${RAW_INVENTORY} -vvv pull &> /tmp/logs/ansible/pull-upgrade
......
...@@ -188,7 +188,6 @@ Commands: ...@@ -188,7 +188,6 @@ Commands:
upgrade-bifrost Upgrades an existing bifrost container upgrade-bifrost Upgrades an existing bifrost container
genconfig Generate configuration files for enabled OpenStack services genconfig Generate configuration files for enabled OpenStack services
prune-images Prune orphaned Kolla images prune-images Prune orphaned Kolla images
chrony-cleanup Clean up disabled chrony containers
EOF EOF
} }
...@@ -533,10 +532,6 @@ EOF ...@@ -533,10 +532,6 @@ EOF
exit 1 exit 1
fi fi
;; ;;
(chrony-cleanup)
ACTION="Cleanup disabled chrony containers"
PLAYBOOK="${BASEDIR}/ansible/chrony-cleanup.yml"
;;
(bash-completion) (bash-completion)
bash_completion bash_completion
exit 0 exit 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment