Add stop and start playbooks for nodepool
Organize these like our zuul rules. Change-Id: Idf6148424c08efee9ad421b01d28d938c7058722
This commit is contained in:
parent
9b28b8864a
commit
e0a00b4649
@ -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
Normal file
21
playbooks/nodepool_start.yaml
Normal 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
|
30
playbooks/nodepool_stop.yaml
Normal file
30
playbooks/nodepool_stop.yaml
Normal 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
|
@ -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
Normal file
4
playbooks/roles/nodepool-builder/tasks/start.yaml
Normal file
@ -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
Normal file
6
playbooks/roles/nodepool-builder/tasks/stop.yaml
Normal file
@ -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
Normal file
6
playbooks/roles/nodepool-launcher/tasks/stop.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
- name: Stop Nodepool Launcher
|
||||
shell:
|
||||
cmd: docker-compose down
|
||||
chdir: /etc/nodepool-docker/
|
||||
become: true
|
||||
become_user: root
|
Loading…
Reference in New Issue
Block a user