Add stop and start playbooks for nodepool

Organize these like our zuul rules.

Change-Id: Idf6148424c08efee9ad421b01d28d938c7058722
This commit is contained in:
Monty Taylor 2020-06-16 15:48:09 -05:00
parent 9b28b8864a
commit e0a00b4649
7 changed files with 71 additions and 70 deletions

View File

@ -1,68 +1,4 @@
# Run this with "-f 20" # Run this with "-f 20"
- hosts: 'nb03.openstack.orgr:!disabled' - import_playbook: nodepool_stop.yaml
any_errors_fatal: true - import_playbook: nodepool_start.yaml
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

View File

@ -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

View File

@ -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

View File

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

View File

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

View File

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

View File

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