Skip to content

Commit

Permalink
add playbooks for stopping and starting services
Browse files Browse the repository at this point in the history
  • Loading branch information
itewk committed Mar 29, 2018
1 parent ee34b77 commit 816ad5f
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 8 additions & 0 deletions playbooks/full-stop-start-services.yml
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions playbooks/health-check.yml
Original file line number Diff line number Diff line change
@@ -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
20 changes: 20 additions & 0 deletions playbooks/start-services.yml
Original file line number Diff line number Diff line change
@@ -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
20 changes: 20 additions & 0 deletions playbooks/stop-services.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 816ad5f

Please sign in to comment.