|
@@ -12,8 +12,8 @@
|
|
|
when: g_masters_group is not defined
|
|
|
|
|
|
- fail:
|
|
|
- msg: This playbook requires g_nodes_group to be set
|
|
|
- when: g_nodes_group is not defined
|
|
|
+ msg: This playbook requires g_nodes_group or g_new_nodes_group to be set
|
|
|
+ when: g_nodes_group is not defined and g_new_nodes_group is not defined
|
|
|
|
|
|
- fail:
|
|
|
msg: This playbook requires g_lb_group to be set
|
|
@@ -35,14 +35,19 @@
|
|
|
ansible_sudo: "{{ g_sudo | default(omit) }}"
|
|
|
with_items: groups[g_masters_group] | default([])
|
|
|
|
|
|
+ # Use g_new_nodes_group if it exists otherwise g_nodes_group
|
|
|
+ - set_fact:
|
|
|
+ g_nodes_to_config: "{{ g_new_nodes_group | default(g_nodes_group | default([])) }}"
|
|
|
+
|
|
|
- name: Evaluate oo_nodes_to_config
|
|
|
add_host:
|
|
|
name: "{{ item }}"
|
|
|
groups: oo_nodes_to_config
|
|
|
ansible_ssh_user: "{{ g_ssh_user | default(omit) }}"
|
|
|
ansible_sudo: "{{ g_sudo | default(omit) }}"
|
|
|
- with_items: groups[g_nodes_group] | default([])
|
|
|
+ with_items: groups[g_nodes_to_config] | default([])
|
|
|
|
|
|
+ # Skip adding the master to oo_nodes_to_config when g_new_nodes_group is
|
|
|
- name: Evaluate oo_nodes_to_config
|
|
|
add_host:
|
|
|
name: "{{ item }}"
|
|
@@ -50,7 +55,7 @@
|
|
|
ansible_ssh_user: "{{ g_ssh_user | default(omit) }}"
|
|
|
ansible_sudo: "{{ g_sudo | default(omit) }}"
|
|
|
with_items: groups[g_masters_group] | default([])
|
|
|
- when: g_nodeonmaster is defined and g_nodeonmaster == true
|
|
|
+ when: g_nodeonmaster | default(false) == true and g_new_nodes_group is not defined
|
|
|
|
|
|
- name: Evaluate oo_first_etcd
|
|
|
add_host:
|