diff options
Diffstat (limited to 'playbooks/common')
| -rw-r--r-- | playbooks/common/openshift-cluster/config.yml | 65 | ||||
| -rw-r--r-- | playbooks/common/openshift-cluster/evaluate_groups.yml | 64 | ||||
| -rw-r--r-- | playbooks/common/openshift-cluster/scaleup.yml | 7 | ||||
| -rw-r--r-- | playbooks/common/openshift-cluster/tasks/set_etcd_launch_facts.yml (renamed from playbooks/common/openshift-cluster/set_etcd_launch_facts_tasks.yml) | 0 | ||||
| -rw-r--r-- | playbooks/common/openshift-cluster/tasks/set_master_launch_facts.yml (renamed from playbooks/common/openshift-cluster/set_master_launch_facts_tasks.yml) | 0 | ||||
| -rw-r--r-- | playbooks/common/openshift-cluster/tasks/set_node_launch_facts.yml (renamed from playbooks/common/openshift-cluster/set_node_launch_facts_tasks.yml) | 0 | ||||
| -rw-r--r-- | playbooks/common/openshift-master/config.yml | 9 | 
7 files changed, 81 insertions, 64 deletions
| diff --git a/playbooks/common/openshift-cluster/config.yml b/playbooks/common/openshift-cluster/config.yml index 4c74f96db..57de7130b 100644 --- a/playbooks/common/openshift-cluster/config.yml +++ b/playbooks/common/openshift-cluster/config.yml @@ -1,68 +1,5 @@  --- -- name: Populate config host groups -  hosts: localhost -  gather_facts: no -  tasks: -  - fail: -      msg: This playbook rquires g_etcd_group to be set -    when: g_etcd_group is not defined - -  - fail: -      msg: This playbook rquires g_masters_group to be set -    when: g_masters_group is not defined - -  - fail: -      msg: This playbook rquires g_nodes_group to be set -    when: g_nodes_group is not defined - -  - name: Evaluate oo_etcd_to_config -    add_host: -      name: "{{ item }}" -      groups: oo_etcd_to_config -      ansible_ssh_user: "{{ g_ssh_user | default(omit) }}" -      ansible_sudo: "{{ g_sudo | default(omit) }}" -    with_items: groups[g_etcd_group] | default([]) - -  - name: Evaluate oo_masters_to_config -    add_host: -      name: "{{ item }}" -      groups: oo_masters_to_config -      ansible_ssh_user: "{{ g_ssh_user | default(omit) }}" -      ansible_sudo: "{{ g_sudo | default(omit) }}" -    with_items: groups[g_masters_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([]) - -  - 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_masters_group] | default([]) -    when: g_nodeonmaster is defined and g_nodeonmaster == true - -  - name: Evaluate oo_first_etcd -    add_host: -      name: "{{ groups[g_etcd_group][0] }}" -      groups: oo_first_etcd -      ansible_ssh_user: "{{ g_ssh_user | default(omit) }}" -      ansible_sudo: "{{ g_sudo | default(omit) }}" -    when: g_etcd_group in groups and (groups[g_etcd_group] | length) > 0 - -  - name: Evaluate oo_first_master -    add_host: -      name: "{{ groups[g_masters_group][0] }}" -      groups: oo_first_master -      ansible_ssh_user: "{{ g_ssh_user | default(omit) }}" -      ansible_sudo: "{{ g_sudo | default(omit) }}" -    when: g_masters_group in groups and (groups[g_masters_group] | length) > 0 +- include: evaluate_groups.yml  - include: ../openshift-etcd/config.yml diff --git a/playbooks/common/openshift-cluster/evaluate_groups.yml b/playbooks/common/openshift-cluster/evaluate_groups.yml new file mode 100644 index 000000000..1919660dd --- /dev/null +++ b/playbooks/common/openshift-cluster/evaluate_groups.yml @@ -0,0 +1,64 @@ +--- +- name: Populate config host groups +  hosts: localhost +  gather_facts: no +  tasks: +  - fail: +      msg: This playbook rquires g_etcd_group to be set +    when: g_etcd_group is not defined + +  - fail: +      msg: This playbook rquires g_masters_group to be set +    when: g_masters_group is not defined + +  - fail: +      msg: This playbook rquires g_nodes_group to be set +    when: g_nodes_group is not defined + +  - name: Evaluate oo_etcd_to_config +    add_host: +      name: "{{ item }}" +      groups: oo_etcd_to_config +      ansible_ssh_user: "{{ g_ssh_user | default(omit) }}" +      ansible_sudo: "{{ g_sudo | default(omit) }}" +    with_items: groups[g_etcd_group] | default([]) + +  - name: Evaluate oo_masters_to_config +    add_host: +      name: "{{ item }}" +      groups: oo_masters_to_config +      ansible_ssh_user: "{{ g_ssh_user | default(omit) }}" +      ansible_sudo: "{{ g_sudo | default(omit) }}" +    with_items: groups[g_masters_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([]) + +  - 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_masters_group] | default([]) +    when: g_nodeonmaster is defined and g_nodeonmaster == true + +  - name: Evaluate oo_first_etcd +    add_host: +      name: "{{ groups[g_etcd_group][0] }}" +      groups: oo_first_etcd +      ansible_ssh_user: "{{ g_ssh_user | default(omit) }}" +    when: g_etcd_group in groups and (groups[g_etcd_group] | length) > 0 + +  - name: Evaluate oo_first_master +    add_host: +      name: "{{ groups[g_masters_group][0] }}" +      groups: oo_first_master +      ansible_ssh_user: "{{ g_ssh_user | default(omit) }}" +      ansible_sudo: "{{ g_sudo | default(omit) }}" +    when: g_masters_group in groups and (groups[g_masters_group] | length) > 0 diff --git a/playbooks/common/openshift-cluster/scaleup.yml b/playbooks/common/openshift-cluster/scaleup.yml new file mode 100644 index 000000000..201320de8 --- /dev/null +++ b/playbooks/common/openshift-cluster/scaleup.yml @@ -0,0 +1,7 @@ +--- +- include: evaluate_groups.yml + +- include: ../openshift-node/config.yml +  vars: +    osn_cluster_dns_domain: "{{ hostvars[groups.oo_first_master.0].openshift.dns.domain }}" +    osn_cluster_dns_ip: "{{ hostvars[groups.oo_first_master.0].openshift.dns.ip }}" diff --git a/playbooks/common/openshift-cluster/set_etcd_launch_facts_tasks.yml b/playbooks/common/openshift-cluster/tasks/set_etcd_launch_facts.yml index 1a6580795..1a6580795 100644 --- a/playbooks/common/openshift-cluster/set_etcd_launch_facts_tasks.yml +++ b/playbooks/common/openshift-cluster/tasks/set_etcd_launch_facts.yml diff --git a/playbooks/common/openshift-cluster/set_master_launch_facts_tasks.yml b/playbooks/common/openshift-cluster/tasks/set_master_launch_facts.yml index 36d7b7870..36d7b7870 100644 --- a/playbooks/common/openshift-cluster/set_master_launch_facts_tasks.yml +++ b/playbooks/common/openshift-cluster/tasks/set_master_launch_facts.yml diff --git a/playbooks/common/openshift-cluster/set_node_launch_facts_tasks.yml b/playbooks/common/openshift-cluster/tasks/set_node_launch_facts.yml index 278942f8b..278942f8b 100644 --- a/playbooks/common/openshift-cluster/set_node_launch_facts_tasks.yml +++ b/playbooks/common/openshift-cluster/tasks/set_node_launch_facts.yml diff --git a/playbooks/common/openshift-master/config.yml b/playbooks/common/openshift-master/config.yml index 1dec923fc..59c4b2370 100644 --- a/playbooks/common/openshift-master/config.yml +++ b/playbooks/common/openshift-master/config.yml @@ -199,9 +199,18 @@        validate_checksum: yes      with_items: masters_needing_certs +- name: Inspect named certificates +  hosts: oo_first_master +  tasks: +  - name: Collect certificate names +    set_fact: +      parsed_named_certificates: "{{ openshift_master_named_certificates | oo_parse_certificate_names(master_cert_config_dir, openshift.common.internal_hostnames) }}" +    when: openshift_master_named_certificates is defined +  - name: Configure master instances    hosts: oo_masters_to_config    vars: +    named_certificates: "{{ hostvars[groups['oo_first_master'][0]]['parsed_named_certificates'] | default([])}}"      sync_tmpdir: "{{ hostvars.localhost.g_master_mktemp.stdout }}"      openshift_master_ha: "{{ groups.oo_masters_to_config | length > 1 }}"      embedded_etcd: "{{ openshift.master.embedded_etcd }}" | 
