Skip to content

Commit

Permalink
Fail within scaleup playbooks when new_{nodes,masters} host groups ar…
Browse files Browse the repository at this point in the history
…e empty.
  • Loading branch information
abutcher committed Jul 18, 2017
1 parent 7422035 commit eec2f31
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
14 changes: 14 additions & 0 deletions playbooks/byo/openshift-master/scaleup.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
---
- include: ../openshift-cluster/initialize_groups.yml

- name: Ensure there are new_masters
hosts: localhost
connection: local
become: no
gather_facts: no
tasks:
- fail:
msg: >
Detected no new_masters or no new_nodes in inventory. Please
add hosts to the new_masters and new_nodes host groups to add
masters.
when:
- (g_new_master_hosts | default([]) | length == 0) or (g_new_node_hosts | default([]) | length == 0)

This comment has been minimized.

Copy link
@ingvagabund

ingvagabund Sep 12, 2017

Member

Why do we need to test new nodes as well if this is a master scaling up?

This comment has been minimized.

Copy link
@abutcher

abutcher Sep 12, 2017

Author Member

This comment has been minimized.

Copy link
@abutcher

abutcher Sep 12, 2017

Author Member

I think we might want to only ensure there are masters but this PR will remove the need to have new_nodes defined.


- include: ../../common/openshift-master/scaleup.yml
vars:
openshift_cluster_id: "{{ cluster_id | default('default') }}"
Expand Down
13 changes: 13 additions & 0 deletions playbooks/byo/openshift-node/scaleup.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
---
- include: ../openshift-cluster/initialize_groups.yml

- name: Ensure there are new_nodes
hosts: localhost
connection: local
become: no
gather_facts: no
tasks:
- fail:
msg: >
Detected no new_nodes in inventory. Please add hosts to the
new_nodes host group to add nodes.
when:
- g_new_node_hosts | default([]) | length == 0

- include: ../../common/openshift-node/scaleup.yml
vars:
openshift_cluster_id: "{{ cluster_id | default('default') }}"
Expand Down

0 comments on commit eec2f31

Please sign in to comment.