Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor initialize groups tasks used for byo #3895

Merged
merged 1 commit into from
Apr 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the significance of putting l_ on this variable? This is for my own sake. I've seen this pattern used else where in this repo.

I generally shy away from naming variables with l as it appears to the viewer as l, L, |, or even 1.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

local, something internal to the role that one should never expect to set from the outside

Copy link
Contributor

@kwoodson kwoodson Apr 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sdodson, thanks for the explanation. The irony of it is, if its internal to a role, then why are we in a playbook defining it? At that point it becomes global. Its fine for now but I'd prefer if we moved away from l_. I'd prefer group_ or something that denotes our intention.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kwoodson From what I've been able to dig out, the l_oo_all_hosts group was supposed to be something that was only referenced in the original playbook for creating the all g_ group names, which are then processed into the oo_ group names. The group name initialization process is something I have a card for to come back to. I've found where this l_oo_all_hosts group name has been used in other places, outside of the original playbook (probably by mistake), which should be corrected.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sdodson @mtnbikenc, Thanks for the explanations.

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