Przeglądaj źródła

Moving projects task within openshift_hosted

Russell Teague 8 lat temu
rodzic
commit
94251afea2

+ 0 - 2
roles/openshift_hosted/meta/main.yml

@@ -15,5 +15,3 @@ dependencies:
 - role: openshift_cli
 - role: openshift_hosted_facts
 - role: lib_openshift
-- role: openshift_projects
-  openshift_projects: "{{ openshift_additional_projects | default({}) | oo_merge_dicts({'default':{'default_node_selector':''},'openshift-infra':{'default_node_selector':''},'logging':{'default_node_selector':''}}) }}"

+ 7 - 0
roles/openshift_hosted/tasks/main.yml

@@ -1,4 +1,11 @@
 ---
+- name: Create projects
+  oc_project:
+    name: "{{ item.key }}"
+    node_selector:
+    - "{{ item.value.default_node_selector }}"
+  with_dict: "{{ openshift_projects }}"
+
 - include: router/router.yml
   when: openshift_hosted_manage_router | default(true) | bool
 

+ 10 - 0
roles/openshift_hosted/vars/main.yml

@@ -1,3 +1,13 @@
 ---
 openshift_master_config_dir: "{{ openshift.common.config_base }}/master"
 registry_config_secret_name: registry-config
+
+openshift_default_projects:
+  default:
+    default_node_selector: ''
+  logging:
+    default_node_selector: ''
+  openshift-infra:
+    default_node_selector: ''
+
+openshift_projects: "{{ openshift_additional_projects | default({}) | oo_merge_dicts(openshift_default_projects) }}"

+ 0 - 7
roles/openshift_projects/tasks/main.yml

@@ -1,7 +0,0 @@
----
-- name: Create projects
-  oc_project:
-    name: "{{ item.key }}"
-    node_selector:
-    -  "{{ item.value.default_node_selector }}"
-  with_dict: "{{ openshift_projects }}"