Deploy and stack status
This commit is contained in:
4
examples/015_2_roles/deploy.yml
Normal file
4
examples/015_2_roles/deploy.yml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# import_playbook soporta handlers correctamente.
|
||||||
|
# Por lo tanto, este playbook importa otros playbooks que contienen handlers.
|
||||||
|
- import_playbook: site.yml
|
||||||
|
- import_playbook: stack_status.yml
|
||||||
27
examples/015_2_roles/stack_status.yml
Normal file
27
examples/015_2_roles/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