Added all files
This commit is contained in:
5
examples/013_wait_for/playbook/hostname.yml
Normal file
5
examples/013_wait_for/playbook/hostname.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- hosts: all
|
||||
tasks:
|
||||
- name: get server hostname
|
||||
command: hostname
|
||||
33
examples/013_wait_for/playbook/stack_restart.yml
Normal file
33
examples/013_wait_for/playbook/stack_restart.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
# Bring stack down
|
||||
- hosts: loadbalancer
|
||||
become: true
|
||||
tasks:
|
||||
- service: name=nginx state=stopped
|
||||
- wait_for: port=80 state=drained
|
||||
|
||||
- hosts: webserver
|
||||
become: true
|
||||
tasks:
|
||||
- service: name=apache2 state=stopped
|
||||
- wait_for: port=80 state=stopped
|
||||
|
||||
# Restart mysql
|
||||
- hosts: database
|
||||
become: true
|
||||
tasks:
|
||||
- service: name=mysql state=restarted
|
||||
- wait_for: port=3306 state=started
|
||||
|
||||
# Bring stack up
|
||||
- hosts: webserver
|
||||
become: true
|
||||
tasks:
|
||||
- service: name=apache2 state=started
|
||||
- wait_for: port=80
|
||||
|
||||
- hosts: loadbalancer
|
||||
become: true
|
||||
tasks:
|
||||
- service: name=nginx state=started
|
||||
- wait_for: port=80
|
||||
27
examples/013_wait_for/playbook/stack_status.yml
Normal file
27
examples/013_wait_for/playbook/stack_status.yml
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
- hosts: loadbalancer
|
||||
become: true
|
||||
tasks:
|
||||
- name: verify nginx service
|
||||
command: service nginx status
|
||||
|
||||
- name: verify nginx is listening on 80
|
||||
wait_for: port=80 timeout=3
|
||||
|
||||
- hosts: webserver
|
||||
become: true
|
||||
tasks:
|
||||
- name: verify apache2 service
|
||||
command: service apache2 status
|
||||
|
||||
- name: verify apache2 is listening on 80
|
||||
wait_for: port=80 timeout=3
|
||||
|
||||
- hosts: database
|
||||
become: true
|
||||
tasks:
|
||||
- name: verify mysql service
|
||||
command: service mysql status
|
||||
|
||||
- name: verify mysql is listening on 3306
|
||||
wait_for: port=3306 timeout=3
|
||||
Reference in New Issue
Block a user