Skip to content

Commit

Permalink
rolling-update - update databases first
Browse files Browse the repository at this point in the history
  • Loading branch information
itewk authored and curt-matthews committed Mar 9, 2018
1 parent 1220799 commit 942ea2f
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 29 deletions.
42 changes: 14 additions & 28 deletions playbooks/rolling-update.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
- name: CFME | Rolling Update | All Preparation
hosts: cfme
become: True
Expand All @@ -14,37 +15,22 @@
changed_when: packages_need_update_result.rc == 100
failed_when: packages_need_update_result.rc != 0 and packages_need_update_result.rc != 100

- name: CFME | Rolling Update | Update Packages
hosts: cfme
- name: CFME | Rolling Update | Update Databases
hosts: cfme-databases
become: True
gather_facts: False
serial: 1
tasks:
- block:
- name: CFME | Rolling Update | Stop evmserverd
service:
name: evmserverd
state: stopped
when: "'cfme-appliances' in group_names"

- name: CFME | Rolling Update | Stop postgres
service:
name: rh-postgresql95-postgresql
state: stopped
when: "'cfme-databases' in group_names"

- name: CFME | Rolling Update | Include Tasks for Updating Packages
include_tasks: tasks/update-packages.yml

- name: CFME | Rolling Update | Start postgres
service:
name: rh-postgresql95-postgresql
state: started
when: "'cfme-databases' in group_names"
- name: CFME | Rolling Update | Include Tasks for Updating Packages
include_tasks: tasks/update-packages.yml
when: packages_need_update_result | changed

- name: CFME | Rolling Update | Start evmserverd
service:
name: evmserverd
state: started
when: "'cfme-appliances' in group_names"
- name: CFME | Rolling Update | Update Appliances
hosts: cfme-appliances:!cfme-databases
become: True
gather_facts: False
serial: 1
tasks:
- name: CFME | Rolling Update | Include Tasks for Updating Packages
include_tasks: tasks/update-packages.yml
when: packages_need_update_result | changed
27 changes: 26 additions & 1 deletion tasks/update-packages.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,33 @@
---
- name: CFME | Update Packages
- name: CFME | Update Packages | Stop evmserverd
service:
name: evmserverd
state: stopped
when: "'cfme-appliances' in group_names"

- name: CFME | Update Packages | Stop postgres
service:
name: rh-postgresql95-postgresql
state: stopped
when: "'cfme-databases' in group_names"

- name: CFME | Update Packages | Latest
package:
name: '*'
state: latest

- name: CFME | Update Packages | Include Tasks for Host Reboot
include_tasks: tasks/host-reboot.yml

- name: CFME | Update Packages | Start postgres
service:
name: rh-postgresql95-postgresql
state: started
when: "'cfme-databases' in group_names"

- name: CFME | Update Packages | Start evmserverd
service:
name: evmserverd
state: started
when: "'cfme-appliances' in group_names"

0 comments on commit 942ea2f

Please sign in to comment.