From 085484478a5055e522265e6987f906823227b830 Mon Sep 17 00:00:00 2001
From: Mark Goddard <mark@stackhpc.com>
Date: Tue, 26 Nov 2019 13:44:09 +0000
Subject: [PATCH] Remove stop-chrony.yml

Remove transitional support for stopping the chrony container. This was
originally added for https://storyboard.openstack.org/#!/story/2005272.

Change-Id: Ief43e723b8f4b97fdcd5960aabfb7208beb0b7cd
Story: 2006949
Task: 37630
---
 ansible/stop-chrony.yml                       | 28 -------------------
 kayobe/cli/commands.py                        | 15 ----------
 kayobe/tests/unit/cli/test_commands.py        | 21 --------------
 .../remove-stop-chrony-1944c6cba72730c4.yaml  |  6 ++++
 4 files changed, 6 insertions(+), 64 deletions(-)
 delete mode 100644 ansible/stop-chrony.yml
 create mode 100644 releasenotes/notes/remove-stop-chrony-1944c6cba72730c4.yaml

diff --git a/ansible/stop-chrony.yml b/ansible/stop-chrony.yml
deleted file mode 100644
index 7e8d4570f..000000000
--- a/ansible/stop-chrony.yml
+++ /dev/null
@@ -1,28 +0,0 @@
----
-# NOTE(mgoddard): In the Rocky release, Kolla Ansible enabled the chrony
-# container by default. Running this alongside the NTP daemon on the host is
-# likely to cause issues, so we should explicitly disable it. Kolla Ansible
-# won't automatically stop the container, so we do it here if it is disabled.
-# See https://storyboard.openstack.org/#!/story/2005272.
-
-- name: Stop the chrony container
-  hosts: overcloud
-  vars:
-    # kolla_overcloud_inventory_top_level_group_map looks like:
-    # kolla_overcloud_inventory_top_level_group_map:
-    #  control:
-    #    groups:
-    #      - controllers
-    overcloud_nodes_in_kolla_inventory: >-
-      {{ kolla_overcloud_inventory_top_level_group_map.values() |
-      map(attribute='groups') | flatten | unique | join(':') }}
-  tags:
-    - stop-chrony
-  tasks:
-    - name: Stop the chrony container
-      docker_container:
-        name: chrony
-        state: absent
-      when:
-        - not kolla_enable_chrony | bool
-        - inventory_hostname in query('inventory_hostnames', overcloud_nodes_in_kolla_inventory)
diff --git a/kayobe/cli/commands.py b/kayobe/cli/commands.py
index 26a7418a5..7ecaa45ef 100644
--- a/kayobe/cli/commands.py
+++ b/kayobe/cli/commands.py
@@ -1208,11 +1208,6 @@ class OvercloudServiceDeploy(KollaAnsibleMixin, KayobeAnsibleMixin, VaultMixin,
         if not parsed_args.skip_prechecks:
             self.run_kolla_ansible_overcloud(parsed_args, "prechecks")
 
-        # Workaround: Stop the chrony container.
-        # TODO(mgoddard): Remove in the Train cycle.
-        playbooks = _build_playbook_list("stop-chrony")
-        self.run_kayobe_playbooks(parsed_args, playbooks, limit="overcloud")
-
         # Perform the kolla-ansible deployment.
         self.run_kolla_ansible_overcloud(parsed_args, "deploy")
 
@@ -1266,11 +1261,6 @@ class OvercloudServiceReconfigure(KollaAnsibleMixin, KayobeAnsibleMixin,
         if not parsed_args.skip_prechecks:
             self.run_kolla_ansible_overcloud(parsed_args, "prechecks")
 
-        # Workaround: Stop the chrony container.
-        # TODO(mgoddard): Remove in the Train cycle.
-        playbooks = _build_playbook_list("stop-chrony")
-        self.run_kayobe_playbooks(parsed_args, playbooks, limit="overcloud")
-
         # Perform the kolla-ansible reconfiguration.
         self.run_kolla_ansible_overcloud(parsed_args, "reconfigure")
 
@@ -1323,11 +1313,6 @@ class OvercloudServiceUpgrade(KollaAnsibleMixin, KayobeAnsibleMixin,
         if not parsed_args.skip_prechecks:
             self.run_kolla_ansible_overcloud(parsed_args, "prechecks")
 
-        # Workaround: Stop the chrony container.
-        # TODO(mgoddard): Remove in the Train cycle.
-        playbooks = _build_playbook_list("stop-chrony")
-        self.run_kayobe_playbooks(parsed_args, playbooks, limit="overcloud")
-
         # Perform the kolla-ansible upgrade.
         self.run_kolla_ansible_overcloud(parsed_args, "upgrade")
 
diff --git a/kayobe/tests/unit/cli/test_commands.py b/kayobe/tests/unit/cli/test_commands.py
index 9d38ea6a0..e59036b10 100644
--- a/kayobe/tests/unit/cli/test_commands.py
+++ b/kayobe/tests/unit/cli/test_commands.py
@@ -1524,13 +1524,6 @@ class TestCase(unittest.TestCase):
                 ],
                 ignore_limit=True,
             ),
-            mock.call(
-                mock.ANY,
-                [
-                    utils.get_data_files_path("ansible", "stop-chrony.yml"),
-                ],
-                limit="overcloud",
-            ),
             mock.call(
                 mock.ANY,
                 [
@@ -1598,13 +1591,6 @@ class TestCase(unittest.TestCase):
                 ],
                 ignore_limit=True,
             ),
-            mock.call(
-                mock.ANY,
-                [
-                    utils.get_data_files_path("ansible", "stop-chrony.yml"),
-                ],
-                limit="overcloud",
-            ),
             mock.call(
                 mock.ANY,
                 [
@@ -1672,13 +1658,6 @@ class TestCase(unittest.TestCase):
                 ],
                 ignore_limit=True,
             ),
-            mock.call(
-                mock.ANY,
-                [
-                    utils.get_data_files_path("ansible", "stop-chrony.yml"),
-                ],
-                limit="overcloud"
-            ),
             mock.call(
                 mock.ANY,
                 [
diff --git a/releasenotes/notes/remove-stop-chrony-1944c6cba72730c4.yaml b/releasenotes/notes/remove-stop-chrony-1944c6cba72730c4.yaml
new file mode 100644
index 000000000..4285f38fe
--- /dev/null
+++ b/releasenotes/notes/remove-stop-chrony-1944c6cba72730c4.yaml
@@ -0,0 +1,6 @@
+---
+upgrade:
+  - |
+    Removes transitional support for stopping the chrony container when
+    ``kolla_enable_chrony`` is ``false``. See `story 2006949
+    <https://storyboard.openstack.org/#!/story/2006949>`__ for details.