Skip to content

Commit

Permalink
Refactor initialize groups tasks
Browse files Browse the repository at this point in the history
Two tasks for initializing group names for the byo playbooks was located
in the common folder in the std_include.yml file.  Byo dependencies
should not be in the common folder.  The two tasks have been removed
from common/openshift-cluster/std_include.yml to a new file
byo/openshift-cluster/initialize_groups.yml.  All references where these
tasks were included from either std_include.yml or other various files
have been updated to use the byo initialize_groups.yml.  The methodology
implemented follows the pattern of having groups set up in byo then
calling out to playbooks in common, which are common to all deployments.
  • Loading branch information
mtnbikenc committed Apr 12, 2017
1 parent 2942b03 commit 558796b
Show file tree
Hide file tree
Showing 35 changed files with 109 additions and 187 deletions.
4 changes: 4 additions & 0 deletions playbooks/byo/openshift-cluster/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
- include: initialize_groups.yml
tags:
- always

- include: ../../common/openshift-cluster/std_include.yml
tags:
- always
Expand Down
24 changes: 1 addition & 23 deletions playbooks/byo/openshift-cluster/enable_dnsmasq.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,4 @@
---
- name: Create initial host groups for localhost
hosts: localhost
connection: local
become: no
gather_facts: no
tags:
- always
tasks:
- include_vars: ../../byo/openshift-cluster/cluster_hosts.yml
- name: Evaluate group l_oo_all_hosts
add_host:
name: "{{ item }}"
groups: l_oo_all_hosts
with_items: "{{ g_all_hosts | default([]) }}"
changed_when: False

- name: Create initial host groups for all hosts
hosts: l_oo_all_hosts
gather_facts: no
tags:
- always
tasks:
- include_vars: ../../byo/openshift-cluster/cluster_hosts.yml
- include: initialize_groups.yml

- include: ../../common/openshift-cluster/enable_dnsmasq.yml
24 changes: 24 additions & 0 deletions playbooks/byo/openshift-cluster/initialize_groups.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
- name: Create initial host groups for localhost
hosts: localhost
connection: local
become: no
gather_facts: no
tags:
- always
tasks:
- include_vars: cluster_hosts.yml
- name: Evaluate group l_oo_all_hosts
add_host:
name: "{{ item }}"
groups: l_oo_all_hosts
with_items: "{{ g_all_hosts | default([]) }}"
changed_when: no

- name: Create initial host groups for all hosts
hosts: l_oo_all_hosts
gather_facts: no
tags:
- always
tasks:
- include_vars: cluster_hosts.yml
24 changes: 1 addition & 23 deletions playbooks/byo/openshift-cluster/openshift-logging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,7 @@
# Hosted logging on. See inventory/byo/hosts.*.example for the
# currently supported method.
#
- name: Create initial host groups for localhost
hosts: localhost
connection: local
become: no
gather_facts: no
tags:
- always
tasks:
- include_vars: ../../byo/openshift-cluster/cluster_hosts.yml
- name: Evaluate group l_oo_all_hosts
add_host:
name: "{{ item }}"
groups: l_oo_all_hosts
with_items: "{{ g_all_hosts | default([]) }}"
changed_when: False

- name: Create initial host groups for all hosts
hosts: l_oo_all_hosts
gather_facts: no
tags:
- always
tasks:
- include_vars: ../../byo/openshift-cluster/cluster_hosts.yml
- include: initialize_groups.yml

- include: ../../common/openshift-cluster/openshift_logging.yml
vars:
Expand Down
4 changes: 4 additions & 0 deletions playbooks/byo/openshift-cluster/redeploy-certificates.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
- include: initialize_groups.yml
tags:
- always

- include: ../../common/openshift-cluster/std_include.yml
tags:
- always
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
- include: initialize_groups.yml
tags:
- always

- include: ../../common/openshift-cluster/std_include.yml
tags:
- always
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
- include: initialize_groups.yml
tags:
- always

- include: ../../common/openshift-cluster/std_include.yml
tags:
- always
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
- include: initialize_groups.yml
tags:
- always

- include: ../../common/openshift-cluster/std_include.yml
tags:
- always
Expand Down
4 changes: 4 additions & 0 deletions playbooks/byo/openshift-cluster/redeploy-openshift-ca.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
- include: initialize_groups.yml
tags:
- always

- include: ../../common/openshift-cluster/std_include.yml
tags:
- always
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
- include: initialize_groups.yml
tags:
- always

- include: ../../common/openshift-cluster/std_include.yml
tags:
- always
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
- include: initialize_groups.yml
tags:
- always

- include: ../../common/openshift-cluster/std_include.yml
tags:
- always
Expand Down
24 changes: 1 addition & 23 deletions playbooks/byo/openshift-cluster/upgrades/docker/upgrade.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,5 @@
---
# Playbook to upgrade Docker to the max allowable version for an OpenShift cluster.
- name: Create initial host groups for localhost
hosts: localhost
connection: local
become: no
gather_facts: no
tags:
- always
tasks:
- include_vars: ../../cluster_hosts.yml
- name: Evaluate group l_oo_all_hosts
add_host:
name: "{{ item }}"
groups: l_oo_all_hosts
with_items: "{{ g_all_hosts | default([]) }}"
changed_when: False

- name: Create initial host groups for all hosts
hosts: l_oo_all_hosts
gather_facts: no
tags:
- always
tasks:
- include_vars: ../../cluster_hosts.yml
- include: ../../initialize_groups.yml

- include: ../../../../common/openshift-cluster/upgrades/docker/docker_upgrade.yml
24 changes: 1 addition & 23 deletions playbooks/byo/openshift-cluster/upgrades/upgrade_etcd.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,4 @@
---
- name: Create initial host groups for localhost
hosts: localhost
connection: local
become: no
gather_facts: no
tags:
- always
tasks:
- include_vars: ../cluster_hosts.yml
- name: Evaluate group l_oo_all_hosts
add_host:
name: "{{ item }}"
groups: l_oo_all_hosts
with_items: "{{ g_all_hosts | default([]) }}"
changed_when: False

- name: Create initial host groups for all hosts
hosts: l_oo_all_hosts
gather_facts: no
tags:
- always
tasks:
- include_vars: ../cluster_hosts.yml
- include: ../initialize_groups.yml

- include: ../../../common/openshift-cluster/upgrades/etcd/main.yml
2 changes: 2 additions & 0 deletions playbooks/byo/openshift-cluster/upgrades/v3_3/upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#
# Full Control Plane + Nodes Upgrade
#
- include: ../../initialize_groups.yml

- include: ../../../../common/openshift-cluster/upgrades/init.yml
tags:
- pre_upgrade
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#
# You can run the upgrade_nodes.yml playbook after this to upgrade these components separately.
#
- include: ../../initialize_groups.yml

- include: ../../../../common/openshift-cluster/upgrades/init.yml
tags:
- pre_upgrade
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#
# Upgrades nodes only, but requires the control plane to have already been upgraded.
#
- include: ../../initialize_groups.yml

- include: ../../../../common/openshift-cluster/upgrades/init.yml
tags:
- pre_upgrade
Expand Down
2 changes: 2 additions & 0 deletions playbooks/byo/openshift-cluster/upgrades/v3_4/upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#
# Full Control Plane + Nodes Upgrade
#
- include: ../../initialize_groups.yml

- include: ../../../../common/openshift-cluster/upgrades/init.yml
tags:
- pre_upgrade
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#
# You can run the upgrade_nodes.yml playbook after this to upgrade these components separately.
#
- include: ../../initialize_groups.yml

- include: ../../../../common/openshift-cluster/upgrades/init.yml
tags:
- pre_upgrade
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#
# Upgrades nodes only, but requires the control plane to have already been upgraded.
#
- include: ../../initialize_groups.yml

- include: ../../../../common/openshift-cluster/upgrades/init.yml
tags:
- pre_upgrade
Expand Down
2 changes: 2 additions & 0 deletions playbooks/byo/openshift-cluster/upgrades/v3_5/upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#
# Full Control Plane + Nodes Upgrade
#
- include: ../../initialize_groups.yml

- include: ../../../../common/openshift-cluster/upgrades/init.yml
tags:
- pre_upgrade
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#
# You can run the upgrade_nodes.yml playbook after this to upgrade these components separately.
#
- include: ../../initialize_groups.yml

- include: ../../../../common/openshift-cluster/upgrades/init.yml
tags:
- pre_upgrade
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#
# Upgrades nodes only, but requires the control plane to have already been upgraded.
#
- include: ../../initialize_groups.yml

- include: ../../../../common/openshift-cluster/upgrades/init.yml
tags:
- pre_upgrade
Expand Down
2 changes: 2 additions & 0 deletions playbooks/byo/openshift-cluster/upgrades/v3_6/upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#
# Full Control Plane + Nodes Upgrade
#
- include: ../../initialize_groups.yml

- include: ../../../../common/openshift-cluster/upgrades/init.yml
tags:
- pre_upgrade
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#
# You can run the upgrade_nodes.yml playbook after this to upgrade these components separately.
#
- include: ../../initialize_groups.yml

- include: ../../../../common/openshift-cluster/upgrades/init.yml
tags:
- pre_upgrade
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#
# Upgrades nodes only, but requires the control plane to have already been upgraded.
#
- include: ../../initialize_groups.yml

- include: ../../../../common/openshift-cluster/upgrades/init.yml
tags:
- pre_upgrade
Expand Down
4 changes: 4 additions & 0 deletions playbooks/byo/openshift-etcd/restart.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
- include: ../openshift-cluster/initialize_groups.yml
tags:
- always

- include: ../../common/openshift-cluster/std_include.yml
tags:
- always
Expand Down
4 changes: 4 additions & 0 deletions playbooks/byo/openshift-master/restart.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
- include: ../openshift-cluster/initialize_groups.yml
tags:
- always

- include: ../../common/openshift-cluster/std_include.yml
tags:
- always
Expand Down
24 changes: 1 addition & 23 deletions playbooks/byo/openshift-master/scaleup.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,5 @@
---
- name: Create initial host groups for localhost
hosts: localhost
connection: local
become: no
gather_facts: no
tags:
- always
tasks:
- include_vars: ../../byo/openshift-cluster/cluster_hosts.yml
- name: Evaluate group l_oo_all_hosts
add_host:
name: "{{ item }}"
groups: l_oo_all_hosts
with_items: "{{ g_all_hosts | default([]) }}"
changed_when: False

- name: Create initial host groups for all hosts
hosts: l_oo_all_hosts
gather_facts: no
tags:
- always
tasks:
- include_vars: ../../byo/openshift-cluster/cluster_hosts.yml
- include: ../openshift-cluster/initialize_groups.yml

- include: ../../common/openshift-master/scaleup.yml
vars:
Expand Down
4 changes: 4 additions & 0 deletions playbooks/byo/openshift-node/restart.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
- include: ../openshift-cluster/initialize_groups.yml
tags:
- always

- include: ../../common/openshift-cluster/std_include.yml
tags:
- always
Expand Down
Loading

0 comments on commit 558796b

Please sign in to comment.