Skip to content

Commit

Permalink
Fix rolling restart playbook (#55)
Browse files Browse the repository at this point in the history
This PR fixes a recent regression that appears to have been caused by a
change in behaviour of the Ansible Docker module. This broke the
`rolling_restart_zdm_proxy.yml` playbook (all other playbooks were not
affected).

Changes in this PR are:
- The rolling restart operation is now done by running the `docker
restart` shell command, rather than using the Docker module.
- The Ansible Docker module version has been pinned to `2.7.0`, which is
the latest version available through `pip` and compatible with the
version of Ansible used by the automation.

No documentation changes are needed for this PR, as these are purely
internal fixes that do not change the user interaction.
  • Loading branch information
alicel authored Feb 2, 2023
1 parent ac7db2c commit 5892457
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
10 changes: 2 additions & 8 deletions ansible/rolling_restart_zdm_proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@

tasks:
- name: Restart one ZDM proxy instance at a time
docker_container:
name: "{{ zdm_proxy_container_name }}"
restart: yes
state: started
shell: docker restart "{{ zdm_proxy_container_name }}"
- name: Wait for this ZDM proxy to come up
uri:
url: "http://{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:{{ metrics_port }}/health/readiness"
Expand All @@ -25,7 +22,4 @@
delay: 5
- pause:
prompt: "Pause for {{ pause_between_restarts_in_seconds }} seconds after restarting this ZDM proxy instance"
seconds: "{{ pause_between_restarts_in_seconds }}"



seconds: "{{ pause_between_restarts_in_seconds }}"
1 change: 1 addition & 0 deletions ansible/tasks/install_docker_ansible_module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
- name: Install Docker Module for Python
pip:
name: docker
version: 2.7.0

0 comments on commit 5892457

Please sign in to comment.