Skip to content
Snippets Groups Projects
Commit d424a993 authored by Mathieu Leguay's avatar Mathieu Leguay Committed by Makhtar DIAGNE
Browse files

[DLAB-4126] Upgrade deployment (PKI & Ansible scripts)

- Upgrade functions.sh: 
Addition of genericity on the functions allowing to handle a vault file
- Add ERASE as input parameters on PKI's scripts in order to preverse existing items when we execute scripts (add module, clients ...)
- Upgrade generate_stores.sh in order to populate dynamically the linked vault file
- Upgrade packaging in order to add the archive of deployment
- Upgrade scripts according to the PKI in order to clean/fix deployment for keystores/trustores and linked configuration
parent e125ba6c
No related branches found
No related tags found
1 merge request!1Feature/design/1
...@@ -278,10 +278,7 @@ initVault certs ${ERASE} ...@@ -278,10 +278,7 @@ initVault certs ${ERASE}
if [ "${ERASE}" == "true" ]; then if [ "${ERASE}" == "true" ]; then
if [ -d ${REPERTOIRE_CERTIFICAT} ]; then if [ -d ${REPERTOIRE_CERTIFICAT} ]; then
# We remove all generated certs # We remove all generated certs
find ${REPERTOIRE_CERTIFICAT} -type f -name *.crt -exec rm -f {} \; find "${REPERTOIRE_CERTIFICAT}/" -mindepth 1 -maxdepth 1 -type d -exec rm -Rf {} \;
find ${REPERTOIRE_CERTIFICAT} -type f -name *.key -exec rm -f {} \;
find ${REPERTOIRE_CERTIFICAT} -type f -name *.pem -exec rm -f {} \;
find ${REPERTOIRE_CERTIFICAT} -type d -empty -delete
fi fi
fi fi
if [ ! -d ${REPERTOIRE_CERTIFICAT} ]; then if [ ! -d ${REPERTOIRE_CERTIFICAT} ]; then
......
...@@ -251,6 +251,7 @@ function setComponentPassphrase { ...@@ -251,6 +251,7 @@ function setComponentPassphrase {
local RETURN_CODE=0 local RETURN_CODE=0
local VAULT_FILE=$(getVaultFile "$TYPE") local VAULT_FILE=$(getVaultFile "$TYPE")
local VAULT_PASS=$(getVaultPass "$TYPE") local VAULT_PASS=$(getVaultPass "$TYPE")
local KEY_PREFIX=$(getKeyPrefix "$TYPE")
if [ ! -f "${VAULT_FILE}" ]; then if [ ! -f "${VAULT_FILE}" ]; then
pki_logger "ERROR" "The vault file is not found. Please, initialize it before call me ! Vault file: ${VAULT_FILE}" pki_logger "ERROR" "The vault file is not found. Please, initialize it before call me ! Vault file: ${VAULT_FILE}"
......
# This configuration file indicates profiles , profiles groups and users automatically create when a new customer or customer tenant is created.
# Put as many as you want following the template given
customer-init:
# Default profiles for each customer created
profiles:
#- name: profileName
# description: desc
# level: 1
# app-name: app
# roles:
# - role_1
# - role_2
# - role_3
# ...
# Default profiles groups for each customer created
profiles-groups:
#- name: group1
# description: desc
# level: 2
# profiles:
# - profileName
# ...
# Default users for each customer created
users:
#- last-name: lastName
# first-name: firstName
# profiles-group-name: group1
# level: 1
# email-prefix: a@mail.com
# Default profiles for each tenant created
tenant-profiles:
#- name: profileName
# description: desc
# level: 1
# app-name: app
# roles:
# - role_1
# - role_2
# - role_3
# ...
# Other Default profiles for admin group
admin-profiles:
#- name: profileName
# description: desc
# level: 1
# app-name: app
# roles:
# - role_1
# - role_2
# - role_3
# ...
\ No newline at end of file
...@@ -141,9 +141,21 @@ ...@@ -141,9 +141,21 @@
notify: notify:
- restart service - restart service
- name: "Execute sub-tasks for the component type: {{ vitamui_struct.vitamui_component_type }}" - name: "Copy vitam certificates"
include_tasks: "{{ vitamui_struct.vitamui_component_type }}.yml" copy:
when: "{{ lookup('pipe', 'test -f {{ role_path }}/tasks/{{ vitamui_struct.vitamui_component_type }}.yml || echo nofile') == \"\" }}" src: "{{ item }}"
dest: "{{ vitamui_folder_conf }}/{{ item | basename }}"
owner: "{{ vitamui_defaults.users.vitamui }}"
group: "{{ vitamui_defaults.users.group }}"
mode: "{{ vitamui_defaults.folder.folder_permission }}"
with_fileglob:
- "{{ inventory_dir }}/keystores/client-vitam/*.*"
when:
- vitam_cert is defined
tags:
- update_vitam_configuration
notify:
- restart service
- name: "Execute sub-tasks for the component: {{ vitamui_struct.vitamui_component }}" - name: "Execute sub-tasks for the component: {{ vitamui_struct.vitamui_component }}"
include_tasks: "{{ vitamui_struct.vitamui_component }}.yml" include_tasks: "{{ vitamui_struct.vitamui_component }}.yml"
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment