From 34455e0f4f2d4b6ea0b21703f711448e947bf0c7 Mon Sep 17 00:00:00 2001 From: Jason DeTiberus Date: Tue, 2 Feb 2016 16:47:39 -0500 Subject: Fix infra_node deployment - Do not deploy the router/registry when the infra_nodes variable is present but does not contain a list of infra nodes. - use right node group and only set openshift_infra_nodes if group is present --- playbooks/common/openshift-master/config.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'playbooks/common/openshift-master') diff --git a/playbooks/common/openshift-master/config.yml b/playbooks/common/openshift-master/config.yml index 3d646be64..648a63150 100644 --- a/playbooks/common/openshift-master/config.yml +++ b/playbooks/common/openshift-master/config.yml @@ -170,10 +170,10 @@ master_cert_subdir: master-{{ openshift.common.hostname }} master_cert_config_dir: "{{ openshift.common.config_base }}/master" - set_fact: - openshift_infra_nodes: "{{ hostvars | oo_select_keys(groups['nodes']) + openshift_infra_nodes: "{{ hostvars | oo_select_keys(groups['oo_nodes_to_config']) | oo_nodes_with_label('region', 'infra') | oo_collect('inventory_hostname') }}" - when: openshift_infra_nodes is not defined + when: openshift_infra_nodes is not defined and groups.oo_nodes_to_config | default([]) | length > 0 - name: Configure master certificates hosts: oo_first_master @@ -408,7 +408,6 @@ - name: Configure service accounts hosts: oo_first_master vars: - accounts: ["router", "registry"] roles: - openshift_serviceaccounts @@ -417,10 +416,17 @@ vars: persistent_volumes: "{{ hostvars[groups.oo_first_master.0] | oo_persistent_volumes(groups) }}" persistent_volume_claims: "{{ hostvars[groups.oo_first_master.0] | oo_persistent_volume_claims }}" + attach_registry_volume: "{{ openshift.hosted.registry.storage.kind != None }}" + deploy_infra: "{{ openshift.master.infra_nodes | default(0) | length > 0 }}" + pre_tasks: + - set_fact: + nfs_host: "{{ groups.oo_nfs_to_config.0 }}" + registry_volume_path: "{{ hostvars[groups.oo_nfs_to_config.0].openshift.nfs.exports_dir + '/' + hostvars[groups.oo_nfs_to_config.0].openshift.nfs.registry_volume }}" + when: attach_registry_volume | bool roles: - role: openshift_persistent_volumes when: persistent_volumes | length > 0 or persistent_volume_claims | length > 0 - role: openshift_router - when: openshift.master.infra_nodes is defined + when: deploy_infra | bool - role: openshift_registry - when: openshift.master.infra_nodes is defined and openshift.hosted.registry.storage.kind != None + when: deploy_infra | bool and attach_registry_volume | bool -- cgit v1.2.3 From d30acfb23637525cf79cd05c94d0d3c900cc4b88 Mon Sep 17 00:00:00 2001 From: Jason DeTiberus Date: Wed, 3 Feb 2016 16:27:30 -0500 Subject: openshift_serviceaccounts updates - make service account creation more flexible - create service accounts near where they are consumed --- playbooks/common/openshift-master/config.yml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'playbooks/common/openshift-master') diff --git a/playbooks/common/openshift-master/config.yml b/playbooks/common/openshift-master/config.yml index 648a63150..a4da68573 100644 --- a/playbooks/common/openshift-master/config.yml +++ b/playbooks/common/openshift-master/config.yml @@ -405,19 +405,11 @@ - file: name={{ g_master_mktemp.stdout }} state=absent changed_when: False -- name: Configure service accounts - hosts: oo_first_master - vars: - roles: - - openshift_serviceaccounts - -- name: Create persistent volumes and services +- name: Create persistent volumes hosts: oo_first_master vars: persistent_volumes: "{{ hostvars[groups.oo_first_master.0] | oo_persistent_volumes(groups) }}" persistent_volume_claims: "{{ hostvars[groups.oo_first_master.0] | oo_persistent_volume_claims }}" - attach_registry_volume: "{{ openshift.hosted.registry.storage.kind != None }}" - deploy_infra: "{{ openshift.master.infra_nodes | default(0) | length > 0 }}" pre_tasks: - set_fact: nfs_host: "{{ groups.oo_nfs_to_config.0 }}" @@ -426,6 +418,21 @@ roles: - role: openshift_persistent_volumes when: persistent_volumes | length > 0 or persistent_volume_claims | length > 0 + +- name: Create hosted infrastructure services + hosts: oo_first_master + vars: + accounts: ["router", "registry"] + attach_registry_volume: "{{ openshift.hosted.registry.storage.kind != None }}" + deploy_infra: "{{ openshift.master.infra_nodes | default(0) | length > 0 }}" + roles: + - role: openshift_serviceaccounts + openshift_serviceaccounts_names: + - router + - registry + openshift_serviceaccounts_namespace: default + openshift_serviceaccounts_sccs: + - privileged - role: openshift_router when: deploy_infra | bool - role: openshift_registry -- cgit v1.2.3 From 2ce5997322acd407bc4c2d6af3bf361ca3cc50c8 Mon Sep 17 00:00:00 2001 From: Jason DeTiberus Date: Wed, 3 Feb 2016 17:16:20 -0500 Subject: consolidate oo_first_master post-config a bit, fix some roles that use openshift_facts without declaring a dependency --- playbooks/common/openshift-master/config.yml | 42 +++++++--------------------- 1 file changed, 10 insertions(+), 32 deletions(-) (limited to 'playbooks/common/openshift-master') diff --git a/playbooks/common/openshift-master/config.yml b/playbooks/common/openshift-master/config.yml index a4da68573..aa1a8b34f 100644 --- a/playbooks/common/openshift-master/config.yml +++ b/playbooks/common/openshift-master/config.yml @@ -360,6 +360,8 @@ - name: Additional master configuration hosts: oo_first_master vars: + cockpit_plugins: "{{ osm_cockpit_plugins | default(['cockpit-kubernetes']) }}" + etcd_urls: "{{ openshift.master.etcd_urls }}" openshift_master_ha: "{{ groups.oo_masters_to_config | length > 1 }}" omc_cluster_hosts: "{{ groups.oo_masters_to_config | join(' ')}}" roles: @@ -371,30 +373,16 @@ when: openshift.common.use_cluster_metrics | bool - role: openshift_manageiq when: openshift.common.use_manageiq | bool - -- name: Enable cockpit - hosts: oo_first_master - vars: - cockpit_plugins: "{{ osm_cockpit_plugins | default(['cockpit-kubernetes']) }}" - roles: - role: cockpit when: not openshift.common.is_atomic and ( deployment_type in ['atomic-enterprise','openshift-enterprise'] ) and (osm_use_cockpit | bool or osm_use_cockpit is undefined ) - -- name: Configure flannel - hosts: oo_first_master - vars: - etcd_urls: "{{ openshift.master.etcd_urls }}" - roles: - role: flannel_register when: openshift.common.use_flannel | bool + - role: pods + when: openshift.common.deployment_type == 'online' + - role: os_env_extras + when: openshift.common.deployment_type == 'online' -# Additional instance config for online deployments -- name: Additional instance config - hosts: oo_masters_deployment_type_online - roles: - - pods - - os_env_extras - name: Delete temporary directory on localhost hosts: localhost @@ -405,27 +393,16 @@ - file: name={{ g_master_mktemp.stdout }} state=absent changed_when: False -- name: Create persistent volumes +- name: Create persistent volumes and create hosted services hosts: oo_first_master vars: + attach_registry_volume: "{{ openshift.hosted.registry.storage.kind != None }}" + deploy_infra: "{{ openshift.master.infra_nodes | default(0) | length > 0 }}" persistent_volumes: "{{ hostvars[groups.oo_first_master.0] | oo_persistent_volumes(groups) }}" persistent_volume_claims: "{{ hostvars[groups.oo_first_master.0] | oo_persistent_volume_claims }}" - pre_tasks: - - set_fact: - nfs_host: "{{ groups.oo_nfs_to_config.0 }}" - registry_volume_path: "{{ hostvars[groups.oo_nfs_to_config.0].openshift.nfs.exports_dir + '/' + hostvars[groups.oo_nfs_to_config.0].openshift.nfs.registry_volume }}" - when: attach_registry_volume | bool roles: - role: openshift_persistent_volumes when: persistent_volumes | length > 0 or persistent_volume_claims | length > 0 - -- name: Create hosted infrastructure services - hosts: oo_first_master - vars: - accounts: ["router", "registry"] - attach_registry_volume: "{{ openshift.hosted.registry.storage.kind != None }}" - deploy_infra: "{{ openshift.master.infra_nodes | default(0) | length > 0 }}" - roles: - role: openshift_serviceaccounts openshift_serviceaccounts_names: - router @@ -437,3 +414,4 @@ when: deploy_infra | bool - role: openshift_registry when: deploy_infra | bool and attach_registry_volume | bool + -- cgit v1.2.3 From 9a0dcd5dc1431ef21cb45b5abb3f55a28cc0ed93 Mon Sep 17 00:00:00 2001 From: Jason DeTiberus Date: Wed, 10 Feb 2016 14:16:39 -0500 Subject: fix default value --- playbooks/common/openshift-master/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'playbooks/common/openshift-master') diff --git a/playbooks/common/openshift-master/config.yml b/playbooks/common/openshift-master/config.yml index aa1a8b34f..9bd6f73cf 100644 --- a/playbooks/common/openshift-master/config.yml +++ b/playbooks/common/openshift-master/config.yml @@ -397,7 +397,7 @@ hosts: oo_first_master vars: attach_registry_volume: "{{ openshift.hosted.registry.storage.kind != None }}" - deploy_infra: "{{ openshift.master.infra_nodes | default(0) | length > 0 }}" + deploy_infra: "{{ openshift.master.infra_nodes | default([]) | length > 0 }}" persistent_volumes: "{{ hostvars[groups.oo_first_master.0] | oo_persistent_volumes(groups) }}" persistent_volume_claims: "{{ hostvars[groups.oo_first_master.0] | oo_persistent_volume_claims }}" roles: -- cgit v1.2.3