From b6cbb524479677d523e81d3e891561374b78a40f Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Fri, 19 Feb 2021 15:42:40 -0800 Subject: [PATCH] Add pull tasks for nodepool/zuul So we can stop/pull/start, move the pull tasks to their own files and add a playbook that invokes them. Change-Id: I4f351c1d28e5e4606e0a778e545a3a805525ac71 --- playbooks/nodepool_pull.yaml | 16 +++++++++++++ .../roles/nodepool-builder/tasks/main.yaml | 6 ++--- .../roles/nodepool-builder/tasks/pull.yaml | 4 ++++ .../roles/nodepool-launcher/tasks/main.yaml | 6 ++--- .../roles/nodepool-launcher/tasks/pull.yaml | 4 ++++ playbooks/roles/zuul-executor/tasks/main.yaml | 6 ++--- playbooks/roles/zuul-executor/tasks/pull.yaml | 4 ++++ playbooks/roles/zuul-merger/tasks/main.yaml | 6 ++--- playbooks/roles/zuul-merger/tasks/pull.yaml | 4 ++++ .../roles/zuul-scheduler/tasks/main.yaml | 6 ++--- .../roles/zuul-scheduler/tasks/pull.yaml | 4 ++++ playbooks/roles/zuul-web/tasks/main.yaml | 6 ++--- playbooks/roles/zuul-web/tasks/pull.yaml | 4 ++++ playbooks/zuul_pull.yaml | 23 +++++++++++++++++++ 14 files changed, 75 insertions(+), 24 deletions(-) create mode 100644 playbooks/nodepool_pull.yaml create mode 100644 playbooks/roles/nodepool-builder/tasks/pull.yaml create mode 100644 playbooks/roles/nodepool-launcher/tasks/pull.yaml create mode 100644 playbooks/roles/zuul-executor/tasks/pull.yaml create mode 100644 playbooks/roles/zuul-merger/tasks/pull.yaml create mode 100644 playbooks/roles/zuul-scheduler/tasks/pull.yaml create mode 100644 playbooks/roles/zuul-web/tasks/pull.yaml create mode 100644 playbooks/zuul_pull.yaml diff --git a/playbooks/nodepool_pull.yaml b/playbooks/nodepool_pull.yaml new file mode 100644 index 0000000000..7145fd7d1d --- /dev/null +++ b/playbooks/nodepool_pull.yaml @@ -0,0 +1,16 @@ +# Run this with "-f 20" + + +- hosts: 'nodepool-builder:!disabled' + any_errors_fatal: true + tasks: + - include_role: + name: nodepool-builder + tasks_from: pull + +- hosts: 'nodepool-launcher:!disabled' + any_errors_fatal: true + tasks: + - include_role: + name: nodepool-launcher + tasks_from: pull diff --git a/playbooks/roles/nodepool-builder/tasks/main.yaml b/playbooks/roles/nodepool-builder/tasks/main.yaml index 93a7285b1e..9be56b323d 100644 --- a/playbooks/roles/nodepool-builder/tasks/main.yaml +++ b/playbooks/roles/nodepool-builder/tasks/main.yaml @@ -31,10 +31,8 @@ dest: /etc/nodepool-builder-compose/docker-compose.yaml mode: 0644 -- name: Run docker-compose pull - shell: - cmd: docker-compose pull - chdir: /etc/nodepool-builder-compose/ +- name: Update container images + include_tasks: pull.yaml - name: Start nodepool builder include_tasks: start.yaml diff --git a/playbooks/roles/nodepool-builder/tasks/pull.yaml b/playbooks/roles/nodepool-builder/tasks/pull.yaml new file mode 100644 index 0000000000..c2e4b4ba7d --- /dev/null +++ b/playbooks/roles/nodepool-builder/tasks/pull.yaml @@ -0,0 +1,4 @@ +- name: Run docker-compose pull + shell: + cmd: docker-compose pull + chdir: /etc/nodepool-builder-compose/ diff --git a/playbooks/roles/nodepool-launcher/tasks/main.yaml b/playbooks/roles/nodepool-launcher/tasks/main.yaml index 84a6024c14..7f3bad1099 100644 --- a/playbooks/roles/nodepool-launcher/tasks/main.yaml +++ b/playbooks/roles/nodepool-launcher/tasks/main.yaml @@ -45,10 +45,8 @@ src: docker-compose.yaml.j2 dest: /etc/nodepool-docker/docker-compose.yaml -- name: Run docker-compose pull - shell: - cmd: docker-compose pull - chdir: /etc/nodepool-docker/ +- name: Update container images + include_tasks: pull.yaml - name: Start nodepool launcher include_tasks: start.yaml diff --git a/playbooks/roles/nodepool-launcher/tasks/pull.yaml b/playbooks/roles/nodepool-launcher/tasks/pull.yaml new file mode 100644 index 0000000000..716edc8119 --- /dev/null +++ b/playbooks/roles/nodepool-launcher/tasks/pull.yaml @@ -0,0 +1,4 @@ +- name: Run docker-compose pull + shell: + cmd: docker-compose pull + chdir: /etc/nodepool-docker/ diff --git a/playbooks/roles/zuul-executor/tasks/main.yaml b/playbooks/roles/zuul-executor/tasks/main.yaml index 8c3224c0d0..e335d71440 100644 --- a/playbooks/roles/zuul-executor/tasks/main.yaml +++ b/playbooks/roles/zuul-executor/tasks/main.yaml @@ -78,10 +78,8 @@ src: docker-compose.yaml dest: /etc/zuul-executor/docker-compose.yaml -- name: Run docker-compose pull - shell: - cmd: docker-compose pull - chdir: /etc/zuul-executor +- name: Update container images + include_tasks: pull.yaml - name: Start containers include_tasks: start.yaml diff --git a/playbooks/roles/zuul-executor/tasks/pull.yaml b/playbooks/roles/zuul-executor/tasks/pull.yaml new file mode 100644 index 0000000000..1d17bbef7d --- /dev/null +++ b/playbooks/roles/zuul-executor/tasks/pull.yaml @@ -0,0 +1,4 @@ +- name: Run docker-compose pull + shell: + cmd: docker-compose pull + chdir: /etc/zuul-executor diff --git a/playbooks/roles/zuul-merger/tasks/main.yaml b/playbooks/roles/zuul-merger/tasks/main.yaml index eb4cb5274d..3f45fa86e3 100644 --- a/playbooks/roles/zuul-merger/tasks/main.yaml +++ b/playbooks/roles/zuul-merger/tasks/main.yaml @@ -42,10 +42,8 @@ src: docker-compose.yaml dest: /etc/zuul-merger/docker-compose.yaml -- name: Run docker-compose pull - shell: - cmd: docker-compose pull - chdir: /etc/zuul-merger +- name: Update container images + include_tasks: pull.yaml - name: Start containers include_tasks: start.yaml diff --git a/playbooks/roles/zuul-merger/tasks/pull.yaml b/playbooks/roles/zuul-merger/tasks/pull.yaml new file mode 100644 index 0000000000..6f1777833c --- /dev/null +++ b/playbooks/roles/zuul-merger/tasks/pull.yaml @@ -0,0 +1,4 @@ +- name: Run docker-compose pull + shell: + cmd: docker-compose pull + chdir: /etc/zuul-merger diff --git a/playbooks/roles/zuul-scheduler/tasks/main.yaml b/playbooks/roles/zuul-scheduler/tasks/main.yaml index df1253f1f3..becbcff55f 100644 --- a/playbooks/roles/zuul-scheduler/tasks/main.yaml +++ b/playbooks/roles/zuul-scheduler/tasks/main.yaml @@ -63,10 +63,8 @@ src: docker-compose.yaml dest: /etc/zuul-scheduler/docker-compose.yaml -- name: Run docker-compose pull - shell: - cmd: docker-compose pull - chdir: /etc/zuul-scheduler +- name: Update container images + include_tasks: pull.yaml - name: Start containers include_tasks: start.yaml diff --git a/playbooks/roles/zuul-scheduler/tasks/pull.yaml b/playbooks/roles/zuul-scheduler/tasks/pull.yaml new file mode 100644 index 0000000000..3053d6b2c3 --- /dev/null +++ b/playbooks/roles/zuul-scheduler/tasks/pull.yaml @@ -0,0 +1,4 @@ +- name: Run docker-compose pull + shell: + cmd: docker-compose pull + chdir: /etc/zuul-scheduler diff --git a/playbooks/roles/zuul-web/tasks/main.yaml b/playbooks/roles/zuul-web/tasks/main.yaml index ac376d1fec..7572a8eced 100644 --- a/playbooks/roles/zuul-web/tasks/main.yaml +++ b/playbooks/roles/zuul-web/tasks/main.yaml @@ -100,10 +100,8 @@ src: docker-compose.yaml dest: /etc/zuul-web/docker-compose.yaml -- name: Run docker-compose pull - shell: - cmd: docker-compose pull - chdir: /etc/zuul-web +- name: Update container images + include_tasks: pull.yaml - name: Start containers include_tasks: start.yaml diff --git a/playbooks/roles/zuul-web/tasks/pull.yaml b/playbooks/roles/zuul-web/tasks/pull.yaml new file mode 100644 index 0000000000..3b6e579d10 --- /dev/null +++ b/playbooks/roles/zuul-web/tasks/pull.yaml @@ -0,0 +1,4 @@ +- name: Run docker-compose pull + shell: + cmd: docker-compose pull + chdir: /etc/zuul-web diff --git a/playbooks/zuul_pull.yaml b/playbooks/zuul_pull.yaml new file mode 100644 index 0000000000..a6dc7fc126 --- /dev/null +++ b/playbooks/zuul_pull.yaml @@ -0,0 +1,23 @@ +# Run this with "-f 20" + +- hosts: 'zuul-scheduler:!disabled' + any_errors_fatal: true + tasks: + - include_role: + name: zuul-scheduler + tasks_from: pull + - include_role: + name: zuul-web + tasks_from: pull + +- hosts: 'zuul-merger:!disabled' + tasks: + - include_role: + name: zuul-merger + tasks_from: pull + +- hosts: 'zuul-executor:!disabled' + tasks: + - include_role: + name: zuul-executor + tasks_from: pull