Merge "eg_mecm-mepm install playbook image teg added"
[ealt-edge.git] / ocd / infra / playbooks / roles / eg_mecm-mepm / tasks / install.yml
1 #
2 # Copyright 2020 Huawei Technologies Co., Ltd.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16
17 ---
18
19 - name: Doing deployment eg_mecm-mepm  setup for edge gallery eg_mecm-mepm
20   copy:
21     src: deploy
22     dest: /tmp/eg_mecm-mepm/
23
24 - name: Import vars
25   include_vars:
26     file: ../../../config.yml
27     name: vardata
28
29 - name: Generates certificate one eg_mecm-mepm
30   # yamllint disable rule:line-length
31   command: kubectl create secret generic mecm-mepm-jwt-public-secret --from-file=publicKey=/tmp/.mep_tmp_cer/server_encryptedtls.key
32   # yamllint disable rule:line-length
33   args:
34     chdir: /tmp/.mep_tmp_cer/
35
36 - name: Generates certificate one eg_mecm-mepm
37   # yamllint disable rule:line-length
38   command: kubectl create secret generic mecm-mepm-ssl-secret --from-file=server_tls.key=/tmp/.mep_tmp_cer/server_tls.key --from-file=server_tls.crt=/tmp/.mep_tmp_cer/server_tls.crt --from-file=ca.crt=/tmp/.mep_tmp_cer/ca.crt
39   # yamllint disable rule:line-length
40   args:
41     chdir: /tmp/.mep_tmp_cer/
42
43 - name: Generates certificate one eg_mecm-mepm
44   # yamllint disable rule:line-length
45   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.mepmpostgrespass.name}} --from-literal=postgresLcmCntlrPassword={{ vardata.mepmpostgreslcmpass.name}} --from-literal=postgresk8sPluginPassword={{ vardata.mepmpostgresk8spluginpass.name}}
46   # yamllint disable rule:line-length
47   args:
48     chdir: /tmp/.mep_tmp_cer/
49
50 - name: Generates certificate one eg_mecm-mepm
51   command: kubectl apply -f /tmp/eg_mecm-mepm/deploy/conf/manifest/mepm/mepm-service-account.yaml
52   args:
53     chdir: /tmp/eg_mecm-mepm/deploy/
54
55 - name: Repo pulling for mecm-mepm
56   # yamllint disable rule:line-length
57   command: helm install --wait mecm-mepm-edgegallery edgegallery/mecm-mepm --set jwt.publicKeySecretName=mecm-mepm-jwt-public-secret --set mepm.secretName=edgegallery-mepm-secret --set ssl.secretName=mecm-mepm-ssl-secret --set images.lcmcontroller.tag={{ vardata.mepmlcmcontrollerimagetag.name}} --set images.k8splugin.tag={{ vardata.mepmk8spluginimagetag.name}} --set images.postgres.tag={{ vardata.mepmpostgresimagetag.name}}