kolla-ansible/ansible/chrony-cleanup.yml
wu.chunyang 1f71df1a8b Remove chrony role from kolla
chrony is not supported in Xena cycle, remove it from kolla

Moved tasks from chrony role to chrony-cleanup.yml playbook to avoid a
vestigial chrony role.

Co-Authored-By: Mark Goddard <mark@stackhpc.com>

Change-Id: I5a730d55afb49d517c85aeb9208188c81e2c84cf
2021-09-30 18:56:14 +02:00

34 lines
1.1 KiB
YAML

---
- 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