From 9b28b8864aa252c2c0ab270687814ef69079070a Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Tue, 16 Jun 2020 12:02:11 -0500 Subject: [PATCH] Run restart playbooks to test they work This runs our zuul and nodepool restart playbooks after the initial service installs in the system-config-run jobs. This will help ensure that they work consistently over time. Fix nodepool restart playbook Change-Id: I953e7222218c5555bb44fccd913eaa5e9374c669 --- playbooks/nodepool_restart.yaml | 59 +++++++++++++++++++-------------- zuul.d/system-config-run.yaml | 6 ++++ 2 files changed, 41 insertions(+), 24 deletions(-) diff --git a/playbooks/nodepool_restart.yaml b/playbooks/nodepool_restart.yaml index 378f72338a..1cf35d90a3 100644 --- a/playbooks/nodepool_restart.yaml +++ b/playbooks/nodepool_restart.yaml @@ -1,6 +1,6 @@ # Run this with "-f 20" -- hosts: 'nodepool-builder:!disabled' +- hosts: 'nb03.openstack.orgr:!disabled' any_errors_fatal: true tasks: - name: Stop Nodepool Builder @@ -10,17 +10,27 @@ become: true become_user: root +- hosts: 'nodepool-builder_opendev:!disabled' + any_errors_fatal: true + tasks: + - name: Stop Nodepool builder + shell: + cmd: docker-compose down + chdir: /etc/nodepool-builder-compose + become: true + become_user: root + - hosts: 'nodepool-launcher:!disabled' any_errors_fatal: true tasks: - name: Stop Nodepool Launcher - service: - name: nodepool-launcher - state: stopped + shell: + cmd: docker-compose down + chdir: /etc/nodepool-docker/ become: true become_user: root -- hosts: 'nodepool-builder:!disabled' +- hosts: 'nb03.openstack.org:!disabled' any_errors_fatal: true tasks: - name: Wait for (3h10m) to stop Nodepool Builder @@ -29,25 +39,7 @@ state: absent timeout: 11400 -- hosts: 'nodepool-launcher:!disabled' - any_errors_fatal: true - tasks: - - name: Wait for (3h10m) to stop Nodepool Launcher - wait_for: - path: /var/run/nodepool-launcher/nodepool-launcher.pid - state: absent - timeout: 11400 - -- hosts: 'nodepool-launcher:!disabled' - tasks: - - name: Start Nodepool Launcher - service: - name: nodepool-launcher - state: started - become: true - become_user: root - -- hosts: 'nodepool-builder:!disabled' +- hosts: 'nb03.openstack.org:!disabled' tasks: - name: Start Nodepool Builder service: @@ -55,3 +47,22 @@ state: started become: true become_user: root + +- hosts: 'nodepool-builder_opendev:!disabled' + tasks: + - name: Start Nodepool Builder + shell: + cmd: docker-compose up -d + chdir: /etc/nodepool-builder-compose + become: true + become_user: root + +- hosts: 'nodepool-launcher:!disabled' + any_errors_fatal: true + tasks: + - name: Start Nodepool Launcher + shell: + cmd: docker-compose up -d + chdir: /etc/nodepool-docker/ + become: true + become_user: root diff --git a/zuul.d/system-config-run.yaml b/zuul.d/system-config-run.yaml index 8d68565107..040e21a99b 100644 --- a/zuul.d/system-config-run.yaml +++ b/zuul.d/system-config-run.yaml @@ -266,6 +266,8 @@ - playbooks/service-zookeeper.yaml - playbooks/service-nodepool.yaml - playbooks/remote_puppet_else.yaml + # Test our ad hoc restart playbook works + - playbooks/nodepool_restart.yaml files: - playbooks/install-ansible.yaml - inventory/service/group_vars/nodepool.yaml @@ -277,6 +279,7 @@ - playbooks/roles/configure-openstacksdk/ - playbooks/roles/nodepool - playbooks/templates/clouds/ + - playbooks/nodepool_restart.yaml - testinfra/test_nodepool.py - job: @@ -645,6 +648,8 @@ - playbooks/letsencrypt.yaml - playbooks/service-zookeeper.yaml - playbooks/service-zuul.yaml + # Test our ad hoc restart playbook works + - playbooks/zuul_restart.yaml host-vars: zm01.openstack.org: host_copy_output: @@ -684,6 +689,7 @@ - playbooks/zuul/templates/group_vars/zookeeper.yaml - playbooks/zuul/templates/host_vars/zk\d+ - playbooks/zuul/templates/host_vars/zuul01.openstack.org + - playbooks/zuul_restart.yaml - testinfra/test_zuul_executor.py - testinfra/test_zuul_scheduler.py - testinfra/test_zuul_merger.py