Merge "Developer install playbook image tag added"
authorGaurav Agrawal <gaurav.agrawal@huawei.com>
Mon, 2 Nov 2020 04:58:46 +0000 (04:58 +0000)
committerGerrit Code Review <gerrit@akraino.org>
Mon, 2 Nov 2020 04:58:46 +0000 (04:58 +0000)
ocd/infra/playbooks/roles/eg_certs/tasks/install.yml [new file with mode: 0644]
ocd/infra/playbooks/roles/eg_certs/tasks/main.yml [new file with mode: 0644]
ocd/infra/playbooks/roles/eg_mecm-fe/tasks/install.yml

diff --git a/ocd/infra/playbooks/roles/eg_certs/tasks/install.yml b/ocd/infra/playbooks/roles/eg_certs/tasks/install.yml
new file mode 100644 (file)
index 0000000..3dc7f8f
--- /dev/null
@@ -0,0 +1,88 @@
+#
+# Copyright 2020 Huawei Technologies Co., Ltd.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+---
+
+- name: Remove old dir
+  command: rm -rf /tmp/.mep_tmp_cer
+  args:
+    chdir: /tmp/
+
+- name: Make dir
+  command: mkdir -p /tmp/.mep_tmp_cer
+  args:
+    chdir: /tmp/
+
+- name: Openssl genrsa
+  command: openssl genrsa -out ca.key 2048
+  args:
+    chdir: /tmp/.mep_tmp_cer/
+
+- name: Opnessl req
+  # yamllint disable rule:line-length
+  command: openssl req -new -key ca.key -subj /C=CN/ST=Peking/L=Beijing/O=edgegallery/CN=edgegallery -out ca.csr
+  # yamllint disable rule:line-length
+  args:
+    chdir: /tmp/.mep_tmp_cer/
+
+- name: Sing key with ca key and ca crt
+  command: openssl x509 -req -days 365 -in ca.csr -extensions v3_ca -signkey ca.key -out ca.crt
+  args:
+    chdir: /tmp/.mep_tmp_cer/
+
+- name: Openssl genrsa
+  command: openssl genrsa -out server_tls.key 2048
+  args:
+    chdir: /tmp/.mep_tmp_cer/
+
+- name: Openssl rsa mep tls
+  command: openssl rsa -in server_tls.key -aes256 -passout pass:{{ vardata.certspass.name}} -out server_encryptedtls.key
+  args:
+    chdir: /tmp/.mep_tmp_cer/
+
+- name: Openssl req new key mepserver tls key
+  # yamllint disable rule:line-length
+  command: openssl req -new -key server_tls.key -subj /C=CN/ST=Beijing/L=Beijing/O=edgegallery/CN=edgegallery -out server_tls.csr
+  # yamllint disable rule:line-length
+  args:
+    chdir: /tmp/.mep_tmp_cer/
+
+- name: Openssl mepserver tls csr
+  # yamllint disable rule:line-length
+  command: openssl x509 -req -in server_tls.csr -extensions v3_req -CA ca.crt -CAkey ca.key -CAcreateserial -out server_tls.crt
+  # yamllint disable rule:line-length
+  args:
+    chdir: /tmp/.mep_tmp_cer/
+
+- name: Openssl genrsa out
+  command: openssl genrsa -out jwt_privatekey 2048
+  args:
+    chdir: /tmp/.mep_tmp_cer/
+
+- name: Openssl rsa jwt privatekey
+  command: openssl rsa -in jwt_privatekey -pubout -out jwt_publickey
+  args:
+    chdir: /tmp/.mep_tmp_cer/
+
+- name: Openssl rsa jwt privatekey
+  command: openssl rsa -in jwt_privatekey -pubout -out jwt_publickey
+  args:
+    chdir: /tmp/.mep_tmp_cer/
+
+- name: Openssl rsa in jwt
+  command: openssl rsa -in jwt_privatekey -aes256 -passout pass:{{ vardata.certspass.name}} -out jwt_encrypted_privatekey
+  args:
+    chdir: /tmp/.mep_tmp_cer/
diff --git a/ocd/infra/playbooks/roles/eg_certs/tasks/main.yml b/ocd/infra/playbooks/roles/eg_certs/tasks/main.yml
new file mode 100644 (file)
index 0000000..b635196
--- /dev/null
@@ -0,0 +1,22 @@
+#
+# Copyright 2020 Huawei Technologies Co., Ltd.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+---
+
+# tasks file for eg_certs
+- include: "install.yml"
+  static: false
+  when: operation == 'install'
index b6373a6..9a62619 100644 (file)
@@ -21,6 +21,6 @@
       file: ../../../config.yml
       name: vardata
 
-- name: Pulling repo mecm-fe
+- name: Mecm-fe chart install and image pull
   # yamllint disable rule:line-length
-  command: helm install mecm-fe-edgegallery edgegallery/mecm-fe --set global.oauth2.authServerAddress=https://{{vardata.authServer.name}}:30067 --set global.ssl.enabled=true --set global.ssl.secretName=edgegallery-ssl-secret
+  command: helm install --wait mecm-fe-edgegallery edgegallery/mecm-fe --set global.oauth2.authServerAddress=https://{{vardata.centernodeip.name}}:30067 --set images.mecmFe.tag={{vardata.imagetag.name}} --set global.ssl.enabled=true --set global.ssl.secretName=edgegallery-ssl-secret