Przeglądaj źródła

Updating openshift_service_catalog to use oc_service over oc_obj to resolve idempotency issues being seen from rerunning role

Eric Wolinetz 7 lat temu
rodzic
commit
395349cfa6

+ 22 - 22
roles/openshift_service_catalog/tasks/install.yml

@@ -168,19 +168,19 @@
       - "{{ mktemp.stdout }}/service_catalog_api_server.yml"
     delete_after: yes
 
-- template:
-    src: api_server_service.j2
-    dest: "{{ mktemp.stdout }}/service_catalog_api_service.yml"
-
 - name: Set Service Catalog API Server service
-  oc_obj:
-    state: present
-    namespace: "kube-service-catalog"
-    kind: service
+  oc_service:
     name: apiserver
-    files:
-      - "{{ mktemp.stdout }}/service_catalog_api_service.yml"
-    delete_after: yes
+    namespace: kube-service-catalog
+    state: present
+    ports:
+      - name: secure
+        port: 443
+        protocol: TCP
+        targetPort: 6443
+    selector:
+      app: apiserver
+    session_affinity: None
 
 - template:
     src: api_server_route.j2
@@ -216,19 +216,19 @@
       - "{{ mktemp.stdout }}/controller_manager.yml"
     delete_after: yes
 
-- template:
-    src: controller_manager_service.j2
-    dest: "{{ mktemp.stdout }}/controller_manager_service.yml"
-
 - name: Set Controller Manager service
-  oc_obj:
-    state: present
-    namespace: "kube-service-catalog"
-    kind: service
+  oc_service:
     name: controller-manager
-    files:
-      - "{{ mktemp.stdout }}/controller_manager_service.yml"
-    delete_after: yes
+    namespace: kube-service-catalog
+    state: present
+    ports:
+      - port: 6443
+        protocol: TCP
+        targetPort: 6443
+    selector:
+      app: controller-manager
+    session_affinity: None
+    service_type: ClusterIP
 
 - include: start_api_server.yml
 

+ 0 - 13
roles/openshift_service_catalog/templates/api_server_service.j2

@@ -1,13 +0,0 @@
-apiVersion: v1
-kind: Service
-metadata:
-  name: apiserver
-spec:
-  ports:
-  - name: secure
-    port: 443
-    protocol: TCP
-    targetPort: 6443
-  selector:
-    app: apiserver
-  sessionAffinity: None

+ 0 - 13
roles/openshift_service_catalog/templates/controller_manager_service.j2

@@ -1,13 +0,0 @@
-apiVersion: v1
-kind: Service
-metadata:
-  name: controller-manager
-spec:
-  ports:
-  - port: 6443
-    protocol: TCP
-    targetPort: 6443
-  selector:
-    app: controller-manager
-  sessionAffinity: None
-  type: ClusterIP