diff options
| author | Kenny Woodson <kwoodson@redhat.com> | 2015-10-29 11:14:51 -0400 | 
|---|---|---|
| committer | Kenny Woodson <kwoodson@redhat.com> | 2015-10-29 11:14:51 -0400 | 
| commit | 9bbaa824da5e1a049cdec1a6523c3841d713386c (patch) | |
| tree | 93e80f1577ad0f2f5f8931b493c50cd9aa657c77 /playbooks/common/openshift-cluster | |
| parent | 15df494fb781dd1509854eeb366e981930b52c22 (diff) | |
| parent | 16d1bce0be2f8c3942489630adcb7030aecadc55 (diff) | |
Merge pull request #763 from openshift/master
Merge master into prod.
Diffstat (limited to 'playbooks/common/openshift-cluster')
7 files changed, 101 insertions, 14 deletions
| diff --git a/playbooks/common/openshift-cluster/config.yml b/playbooks/common/openshift-cluster/config.yml index 14ffa928f..4c74f96db 100644 --- a/playbooks/common/openshift-cluster/config.yml +++ b/playbooks/common/openshift-cluster/config.yml @@ -1,4 +1,74 @@  --- +- 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: ../openshift-etcd/config.yml +  - include: ../openshift-master/config.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/create_services.yml b/playbooks/common/openshift-cluster/create_services.yml deleted file mode 100644 index e70709d19..000000000 --- a/playbooks/common/openshift-cluster/create_services.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- name: Deploy OpenShift Services -  hosts: "{{ g_svc_master }}" -  connection: ssh -  gather_facts: yes -  roles: -  - openshift_registry -  - openshift_router diff --git a/playbooks/common/openshift-cluster/lookup_plugins b/playbooks/common/openshift-cluster/lookup_plugins new file mode 120000 index 000000000..ac79701db --- /dev/null +++ b/playbooks/common/openshift-cluster/lookup_plugins @@ -0,0 +1 @@ +../../../lookup_plugins
\ No newline at end of file diff --git a/playbooks/common/openshift-cluster/set_etcd_launch_facts_tasks.yml b/playbooks/common/openshift-cluster/set_etcd_launch_facts_tasks.yml new file mode 100644 index 000000000..1a6580795 --- /dev/null +++ b/playbooks/common/openshift-cluster/set_etcd_launch_facts_tasks.yml @@ -0,0 +1,13 @@ +--- +- set_fact: k8s_type="etcd" + +- name: Generate etcd instance names(s) +  set_fact: +    scratch_name: "{{ cluster_id }}-{{ k8s_type }}-{{ '%05x' | format(1048576 | random) }}" +  register: etcd_names_output +  with_sequence: count={{ num_etcd }} + +- set_fact: +    etcd_names: "{{ etcd_names_output.results | default([]) +                    | oo_collect('ansible_facts') +                    | oo_collect('scratch_name') }}" diff --git a/playbooks/common/openshift-cluster/set_master_launch_facts_tasks.yml b/playbooks/common/openshift-cluster/set_master_launch_facts_tasks.yml index 118727273..36d7b7870 100644 --- a/playbooks/common/openshift-cluster/set_master_launch_facts_tasks.yml +++ b/playbooks/common/openshift-cluster/set_master_launch_facts_tasks.yml @@ -5,7 +5,9 @@    set_fact:      scratch_name: "{{ cluster_id }}-{{ k8s_type }}-{{ '%05x' | format(1048576 | random) }}"    register: master_names_output -  with_sequence: start=1 end={{ num_masters }} +  with_sequence: count={{ num_masters }}  - set_fact: -    master_names: "{{ master_names_output.results | oo_collect('ansible_facts') | oo_collect('scratch_name') }}" +    master_names: "{{ master_names_output.results | default([]) +                      | oo_collect('ansible_facts') +                      | oo_collect('scratch_name') }}" diff --git a/playbooks/common/openshift-cluster/set_node_launch_facts_tasks.yml b/playbooks/common/openshift-cluster/set_node_launch_facts_tasks.yml index 162315d46..278942f8b 100644 --- a/playbooks/common/openshift-cluster/set_node_launch_facts_tasks.yml +++ b/playbooks/common/openshift-cluster/set_node_launch_facts_tasks.yml @@ -1,11 +1,15 @@  --- -- set_fact: k8s_type="node" +- set_fact: k8s_type=node +- set_fact: sub_host_type="{{ type }}" +- set_fact: number_nodes="{{ count }}"  - name: Generate node instance names(s)    set_fact: -    scratch_name: "{{ cluster_id }}-{{ k8s_type }}-{{ '%05x' | format(1048576 | random) }}" +    scratch_name: "{{ cluster_id }}-{{ k8s_type }}-{{ sub_host_type }}-{{ '%05x' | format(1048576 | random) }}"    register: node_names_output -  with_sequence: start=1 end={{ num_nodes }} +  with_sequence: count={{ number_nodes }}  - set_fact: -    node_names: "{{ node_names_output.results | oo_collect('ansible_facts') | oo_collect('scratch_name') }}" +    node_names: "{{ node_names_output.results | default([]) +                    | oo_collect('ansible_facts') +                    | oo_collect('scratch_name') }}" diff --git a/playbooks/common/openshift-cluster/update_repos_and_packages.yml b/playbooks/common/openshift-cluster/update_repos_and_packages.yml index e92c6f1ee..190e2d862 100644 --- a/playbooks/common/openshift-cluster/update_repos_and_packages.yml +++ b/playbooks/common/openshift-cluster/update_repos_and_packages.yml @@ -3,5 +3,10 @@    vars:      openshift_deployment_type: "{{ deployment_type }}"    roles: +  - role: rhel_subscribe +    when: deployment_type == "enterprise" and +          ansible_distribution == "RedHat" and +          lookup('oo_option', 'rhel_skip_subscription') | default(rhsub_skip, True) | +            default('no', True) | lower in ['no', 'false']    - openshift_repos    - os_update_latest | 
