diff --git a/README.md b/README.md index a714555..fba3e6d 100644 --- a/README.md +++ b/README.md @@ -70,3 +70,30 @@ Smoke tests Service template provisioning and retirment. | cfme\_provision\_service\_dialog\_options | Yes | | Hash of dialog options to pass to the Service Template creation request | cfme\_provision\_service\_retries | No | 60 | Number of attempts at waiting for Provision Service task to complete | cfme\_provision\_service\_delay | No | 60 | Number of seconds between attempts at waiting for Provion Service task to complete + +### start-services.yml +Start all of the DB services then all of the Appliance services. + +#### Required groups +* cfme-appliancees +* cfme-databases + +### stop-services.yml +Stop all of the Appliance services then all of the DB services. + +#### Required groups +* cfme-appliancees +* cfme-databases + +### full-stop-start-services.yml +Stop all of the Appliance services, then all of the DB services, then start all of the DB services, then all of the Appliance services, then perform a helath check. + +#### Required groups +* cfme-appliancees +* cfme-databases + +### health-check.yml +Checks the health of the Appliances. + +#### Required groups +* cfme-appliancees diff --git a/playbooks/full-stop-start-services.yml b/playbooks/full-stop-start-services.yml new file mode 100644 index 0000000..2c317ed --- /dev/null +++ b/playbooks/full-stop-start-services.yml @@ -0,0 +1,8 @@ +--- +- name: CFME | Full Stop / Start Services | Gather Facts + hosts: all + gather_facts: True + +- import_playbook: stop-services.yml +- import_playbook: start-services.yml +- import_playbook: health-check.yml diff --git a/playbooks/health-check.yml b/playbooks/health-check.yml new file mode 100644 index 0000000..89ec372 --- /dev/null +++ b/playbooks/health-check.yml @@ -0,0 +1,17 @@ +--- +- name: CFME | Health Check + hosts: cfme-appliances + gather_facts: True + tasks: + - name: CFME | Health Check | Ping Check + local_action: + module: uri + url: "https://{{ ansible_hostname }}/ping" + method: GET + validate_certs: False + body_format: raw + return_content: Yes + register: cfme_ping_check_result + until: cfme_ping_check_result['content'] == 'pong' + retries: 60 + delay: 5 diff --git a/playbooks/start-services.yml b/playbooks/start-services.yml new file mode 100644 index 0000000..603f7aa --- /dev/null +++ b/playbooks/start-services.yml @@ -0,0 +1,20 @@ +--- +- name: CFME | Start Services | Databases + hosts: cfme-databases + become: True + gather_facts: False + tasks: + - name: CFME | Start Services | PostgreSQL + service: + name: rh-postgresql95-postgresql + state: started + +- name: CFME | Start Services | Appliances + hosts: cfme-appliances + become: True + gather_facts: False + tasks: + - name: CFME | Start Services | EVM + service: + name: evmserverd + state: started diff --git a/playbooks/stop-services.yml b/playbooks/stop-services.yml new file mode 100644 index 0000000..2f072a4 --- /dev/null +++ b/playbooks/stop-services.yml @@ -0,0 +1,20 @@ +--- +- name: CFME | Stop Services | Appliances + hosts: cfme-appliances + become: True + gather_facts: False + tasks: + - name: CFME | Stop Services | EVM + service: + name: evmserverd + state: stopped + +- name: CFME | Stop Services | Databases + hosts: cfme-databases + become: True + gather_facts: False + tasks: + - name: CFME | Stop Services | PostgreSQL + service: + name: rh-postgresql95-postgresql + state: stopped