X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=ocd%2Finfra%2Fplaybooks%2Froles%2Feg_mecm-mepm%2Ftasks%2Finstall.yml;h=12a388c1b7f6744a84acb0754506555a3fd086d0;hb=refs%2Fchanges%2F95%2F3895%2F5;hp=26eb2885ba045f7e24ebeca4079349fe07ca1183;hpb=c1ec72d0f22345c0c3484c774430be476a5290e7;p=ealt-edge.git diff --git a/ocd/infra/playbooks/roles/eg_mecm-mepm/tasks/install.yml b/ocd/infra/playbooks/roles/eg_mecm-mepm/tasks/install.yml index 26eb288..12a388c 100644 --- a/ocd/infra/playbooks/roles/eg_mecm-mepm/tasks/install.yml +++ b/ocd/infra/playbooks/roles/eg_mecm-mepm/tasks/install.yml @@ -26,11 +26,15 @@ 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 @@ -46,10 +50,17 @@ args: chdir: /tmp/ssl-eg-keys-certs/ +- 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.common_pwd.name}} --from-literal=postgresLcmCntlrPassword={{ vardata.common_pwd.name}} --from-literal=postgresk8sPluginPassword={{ vardata.common_pwd.name}} + # yamllint disable rule:line-length + 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.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.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: comm_pwd == "" - name: Create mepm service account command: kubectl apply -f /tmp/eg_mecm-mepm/deploy/conf/manifest/mepm/mepm-service-account.yaml