New logic added cert and other 75/3975/1
authorarvind.patel@huawei.com <arvind.patel@huawei.com>
Mon, 7 Dec 2020 13:30:16 +0000 (19:00 +0530)
committerarvind.patel@huawei.com <arvind.patel@huawei.com>
Mon, 7 Dec 2020 13:31:15 +0000 (19:01 +0530)
Signed-off-by: arvind.patel@huawei.com <arvind.patel@huawei.com>
Change-Id: I755bad6af4969e9becd3f151ef13521d2dbdce16

blueprints/iotgateway/playbooks/config.yml
blueprints/iotgateway/playbooks/roles/eg_certs/tasks/install.yml
blueprints/iotgateway/playbooks/roles/eg_mecm-meo/tasks/install.yml
blueprints/iotgateway/playbooks/roles/prometheus/tasks/install.yml

index ed5ee5b..c45dc1d 100644 (file)
@@ -55,12 +55,6 @@ mecm_mepm_postgresk8sPluginPassword:
   name:
 
 ########### Master config ###########
-######### Mandatory #########
-mecm_meo_edgeRepoUserName:
-  name:
-mecm_meo_edgeRepoPassword:
-  name:
-
 ######### Optional #########
 usermgmt_port:
   name: 30067
index 4aa99bf..1aa05cf 100644 (file)
@@ -33,5 +33,5 @@
 
 - name: generate cert
   # yamllint disable rule:line-length
-  command: docker run -e CERT_VALIDITY_IN_DAYS=365 -v /tmp/ssl-eg-keys-certs:/certs swr.ap-southeast-1.myhuaweicloud.com/edgegallery/deploy-tool:latest
+  command: docker run -e CERT_VALIDITY_IN_DAYS=365 -v /tmp/ssl-eg-keys-certs:/certs {{ vardata.private_repo_ip.name}}:{{ vardata.docker_registry_port.name}}/edgegallery/deploy-tool:latest
   # yamllint disable rule:line-length
index e6c2fc7..ecbd950 100644 (file)
@@ -50,7 +50,7 @@
 
 - name: Create certificate edgegallery-mecm-secret with common pwd
   # yamllint disable rule:line-length
-  command: kubectl create secret generic edgegallery-mecm-secret --from-file=postgres_init.sql=/tmp/eg_mecm-meo/deploy/conf/keys/postgres_init.sql --from-literal=postgresPassword={{ vardata.common_pwd.name}} --from-literal=postgresApmPassword={{ vardata.common_pwd.name}} --from-literal=postgresAppoPassword={{ vardata.common_pwd.name}} --from-literal=postgresInventoryPassword={{ vardata.common_pwd.name}} --from-literal=edgeRepoUserName={{ vardata.mecm_meo_edgeRepoUserName.name}}  --from-literal=edgeRepoPassword={{ vardata.mecm_meo_edgeRepoPassword.name}}
+  command: kubectl create secret generic edgegallery-mecm-secret --from-file=postgres_init.sql=/tmp/eg_mecm-meo/deploy/conf/keys/postgres_init.sql --from-literal=postgresPassword={{ vardata.common_pwd.name}} --from-literal=postgresApmPassword={{ vardata.common_pwd.name}} --from-literal=postgresAppoPassword={{ vardata.common_pwd.name}} --from-literal=postgresInventoryPassword={{ vardata.common_pwd.name}} --from-literal=edgeRepoUserName=admin --from-literal=edgeRepoPassword={{ vardata.common_pwd.name}}
   # yamllint disable rule:line-length
   args:
     chdir: /tmp/eg_mecm-meo/deploy/
@@ -58,7 +58,7 @@
 
 - name: Generates certificate edgegallery-mecm-secret
   # yamllint disable rule:line-length
-  command: kubectl create secret generic edgegallery-mecm-secret --from-file=postgres_init.sql=/tmp/eg_mecm-meo/deploy/conf/keys/postgres_init.sql --from-literal=postgresPassword={{ vardata.mecm_meo_postgresPassword.name}} --from-literal=postgresApmPassword={{ vardata.mecm_meo_postgresApmPassword.name}} --from-literal=postgresAppoPassword={{ vardata.mecm_meo_postgresAppoPassword.name}} --from-literal=postgresInventoryPassword={{ vardata.mecm_meo_postgresInventoryPassword.name}} --from-literal=edgeRepoUserName={{ vardata.mecm_meo_edgeRepoUserName.name}}  --from-literal=edgeRepoPassword={{ vardata.mecm_meo_edgeRepoPassword.name}}
+  command: kubectl create secret generic edgegallery-mecm-secret --from-file=postgres_init.sql=/tmp/eg_mecm-meo/deploy/conf/keys/postgres_init.sql --from-literal=postgresPassword={{ vardata.mecm_meo_postgresPassword.name}} --from-literal=postgresApmPassword={{ vardata.mecm_meo_postgresApmPassword.name}} --from-literal=postgresAppoPassword={{ vardata.mecm_meo_postgresAppoPassword.name}} --from-literal=postgresInventoryPassword={{ vardata.mecm_meo_postgresInventoryPassword.name}} --from-literal=edgeRepoUserName=admin --from-literal=edgeRepoPassword={{ vardata.common_pwd.name}}
   # yamllint disable rule:line-length
   args:
     chdir: /tmp/eg_mecm-meo/deploy/
index bdb4c66..2c0d05a 100644 (file)
@@ -33,6 +33,8 @@
 - name: "INSTALL: Install prometheus on x86_64"
   shell:
     cmd: helm install mep-prometheus stable/prometheus --version v9.3.1
+  ignore_errors: yes
+  no_log: True
   when: result is failed and ansible_architecture == 'x86_64'
 
 - name: "INSTALL: copy values.yaml to host"
   # yamllint disable rule:line-length
   command: helm install mep-prometheus stable/prometheus -f /tmp/prometheus/values.yaml --version v9.3.1 --set alertmanager.image.repository={{ vardata.private_repo_ip.name}}:{{ vardata.docker_registry_port.name}}/prom/alertmanager --set configmapReload.image.repository={{ vardata.private_repo_ip.name}}:{{ vardata.docker_registry_port.name}}/jimmidyson/configmap-reload --set nodeExporter.image.repository={{ vardata.private_repo_ip.name}}:{{ vardata.docker_registry_port.name}}/prom/node-exporter --set server.image.repository={{ vardata.private_repo_ip.name}}:{{ vardata.docker_registry_port.name}}/prom/prometheus --set pushgateway.image.repository={{ vardata.private_repo_ip.name}}:{{ vardata.docker_registry_port.name}}/prom/pushgateway --set kubeStateMetrics.image.repository={{ vardata.private_repo_ip.name}}:{{ vardata.docker_registry_port.name}}/carlosedp/kube-state-metrics --set alertmanager.image.pullPolicy=IfNotPresent --set configmapReload.image.pullPolicy=IfNotPresent --set nodeExporter.image.pullPolicy=IfNotPresent --set server.image.pullPolicy=IfNotPresent --set pushgateway.image.pullPolicy=IfNotPresent --set kubeStateMetrics.image.pullPolicy=IfNotPresent
   # yamllint disable rule:line-length
+  ignore_errors: yes
+  no_log: True
   when: result is failed and ansible_architecture == 'aarch64'
 
 - name: Expose promethious server
   # yamllint disable rule:line-length
   command: kubectl expose deployment mep-prometheus-server  --type=NodePort --name nodeport-mep-prometheus-server
   # yamllint disable rule:line-length
+  ignore_errors: yes
+  no_log: True
 
 - name: Execute patch service with given port
   shell:
     # yamllint disable rule:line-length
     cmd: "kubectl patch service nodeport-mep-prometheus-server  --type='json' --patch='[{ \"op\": \"replace\", \"path\": \"/spec/ports/0/nodePort\", \"value\":{{ vardata.prometheus_node_port.name }}}]'"
     # yamllint disable rule:line-length
+  ignore_errors: yes
+  no_log: True