Browse Source

Merge "Add stop and start playbooks for nodepool"

changes/89/736389/1
Zuul 1 year ago
committed by Gerrit Code Review
parent
commit
bec4b57d81
  1. 68
      playbooks/nodepool_restart.yaml
  2. 21
      playbooks/nodepool_start.yaml
  3. 30
      playbooks/nodepool_stop.yaml
  4. 6
      playbooks/roles/nodepool-builder/tasks/main.yaml
  5. 4
      playbooks/roles/nodepool-builder/tasks/start.yaml
  6. 6
      playbooks/roles/nodepool-builder/tasks/stop.yaml
  7. 6
      playbooks/roles/nodepool-launcher/tasks/stop.yaml

68
playbooks/nodepool_restart.yaml

@ -1,68 +1,4 @@
# Run this with "-f 20"
- hosts: 'nb03.openstack.orgr:!disabled'
any_errors_fatal: true
tasks:
- name: Stop Nodepool Builder
service:
name: nodepool-builder
state: stopped
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
shell:
cmd: docker-compose down
chdir: /etc/nodepool-docker/
become: true
become_user: root
- hosts: 'nb03.openstack.org:!disabled'
any_errors_fatal: true
tasks:
- name: Wait for (3h10m) to stop Nodepool Builder
wait_for:
path: /var/run/nodepool/nodepool-builder.pid
state: absent
timeout: 11400
- hosts: 'nb03.openstack.org:!disabled'
tasks:
- name: Start Nodepool Builder
service:
name: nodepool-builder
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
- import_playbook: nodepool_stop.yaml
- import_playbook: nodepool_start.yaml

21
playbooks/nodepool_start.yaml

@ -0,0 +1,21 @@
# Run this with "-f 20"
- hosts: 'nodepool-builder_opendev:!disabled'
tasks:
- include_role:
name: nodepool-builder
tasks_from: start
- hosts: 'nodepool-launcher:!disabled'
any_errors_fatal: true
tasks:
- include_role:
name: nodepool-launcher
tasks_from: start
- hosts: 'nb03.openstack.org:!disabled'
tasks:
- name: Start Nodepool Builder
service:
name: nodepool-builder
state: started

30
playbooks/nodepool_stop.yaml

@ -0,0 +1,30 @@
# Run this with "-f 20"
- hosts: 'nodepool-builder_opendev:!disabled'
any_errors_fatal: true
tasks:
- include_role:
name: nodepool-builder
tasks_from: stop
- hosts: 'nodepool-launcher:!disabled'
any_errors_fatal: true
tasks:
- include_role:
name: nodepool-launcher
tasks_from: stop
- hosts: 'nb03.openstack.orgr:!disabled'
any_errors_fatal: true
tasks:
- name: Stop Nodepool Builder
service:
name: nodepool-builder
state: stopped
- name: Wait for (3h10m) to stop Nodepool Builder
wait_for:
path: /var/run/nodepool/nodepool-builder.pid
state: absent
timeout: 11400

6
playbooks/roles/nodepool-builder/tasks/main.yaml

@ -36,10 +36,8 @@
cmd: docker-compose pull
chdir: /etc/nodepool-builder-compose/
- name: Run docker-compose up
shell:
cmd: docker-compose up -d
chdir: /etc/nodepool-builder-compose/
- name: Start nodepool builder
include_tasks: start.yaml
- name: Run docker prune to cleanup unneeded images
shell:

4
playbooks/roles/nodepool-builder/tasks/start.yaml

@ -0,0 +1,4 @@
- name: Run docker-compose up
shell:
cmd: docker-compose up -d
chdir: /etc/nodepool-builder-compose/

6
playbooks/roles/nodepool-builder/tasks/stop.yaml

@ -0,0 +1,6 @@
- name: Stop Nodepool builder
shell:
cmd: docker-compose down
chdir: /etc/nodepool-builder-compose
become: true
become_user: root

6
playbooks/roles/nodepool-launcher/tasks/stop.yaml

@ -0,0 +1,6 @@
- name: Stop Nodepool Launcher
shell:
cmd: docker-compose down
chdir: /etc/nodepool-docker/
become: true
become_user: root
Loading…
Cancel
Save