Install Uninstall end to end testing
[ealt-edge.git] / ocd / infra / playbooks / roles / eg_mecm-mepm / tasks / install.yml
index 42a72bb..12a388c 100644 (file)
     file: ../../../config.yml
     name: vardata
 
+- name: Set a variable
+  ansible.builtin.set_fact:
+    comm_pwd: "{{ vardata.common_pwd.name }}"
+
 - name: Replacing password
   replace:
     path: /tmp/eg_mecm-mepm/deploy/conf/keys/postgres_init.sql
     regexp: 'PASSWORD_VALUE'
-    replace: "{{ vardata.db_password.name }}"
+    replace: "{{ vardata.common_pwd.name }}"
 
 - name: Create mecm-mepm-ssl-secret secret
   # yamllint disable rule:line-length
 
 - name: Create edgegallery-mepm-secret secret with common pwd
   # yamllint disable rule:line-length
-  command: kubectl create secret generic edgegallery-mepm-secret --from-file=postgres_init.sql=/tmp/eg_mecm-mepm/deploy/conf/keys/postgres_init.sql --from-literal=postgresPassword={{ vardata.db_password.name}} --from-literal=postgresLcmCntlrPassword={{ vardata.db_password.name}} --from-literal=postgresk8sPluginPassword={{ vardata.db_password.name}}
+  command: kubectl create secret generic edgegallery-mepm-secret --from-file=postgres_init.sql=/tmp/eg_mecm-mepm/deploy/conf/keys/postgres_init.sql --from-literal=postgresPassword={{ vardata.common_pwd.name}} --from-literal=postgresLcmCntlrPassword={{ vardata.common_pwd.name}} --from-literal=postgresk8sPluginPassword={{ vardata.common_pwd.name}}
   # yamllint disable rule:line-length
-  when: '{{ vardata.db_password.name}}'
+  when: comm_pwd != ""
 
 - name: Create edgegallery-mepm-secret secret
   # yamllint disable rule:line-length
   command: kubectl create secret generic edgegallery-mepm-secret --from-file=postgres_init.sql=/tmp/eg_mecm-mepm/deploy/conf/keys/postgres_init.sql --from-literal=postgresPassword={{ vardata.mecm_mepm_postgresPassword.name}} --from-literal=postgresLcmCntlrPassword={{ vardata.mecm_mepm_postgresLcmCntlrPassword.name}} --from-literal=postgresk8sPluginPassword={{ vardata.mecm_mepm_postgresk8sPluginPassword.name}}
   # yamllint disable rule:line-length
-  when: '{{ vardata.mecm_mepm_postgresPassword.name}}'
+  when: comm_pwd == ""
 
 - name: Create mepm service account
   command: kubectl apply -f /tmp/eg_mecm-mepm/deploy/conf/manifest/mepm/mepm-service-account.yaml