From c7d3bd1b07698e9a20bb13e5ea261fded8fb126a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Sachse?= <joerg.sachse@slub-dresden.de> Date: Mon, 11 Sep 2023 13:28:57 +0200 Subject: [PATCH] test: update CI and Molecule configs to be more generic and conform to new requirements concerning Vault password files --- .gitlab-ci.yml | 22 +++++++++++++--------- molecule/virtualbox_centos7/molecule.yml | 2 +- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6af719c..272c4c2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,6 +7,10 @@ stages: # List of stages for jobs, and their order of execution - test +variables: + # CI_DEBUG_TRACE: "true" + SCENARIO: "default" + default: before_script: - source /opt/molecule/bin/activate @@ -14,7 +18,7 @@ default: - molecule --version after_script: - source /opt/molecule/bin/activate - - molecule destroy --scenario-name default + - molecule destroy --scenario-name ${SCENARIO} test-job: stage: test @@ -22,21 +26,21 @@ test-job: - "shell" script: # make sure that Ansible Vaults are present and can be decrypted - - echo "${VAULT_INSTALL_COMMON}" > ../lza_install_common.pass - - echo "${VAULT_ROSETTA_APP}" > ../lza_rosetta_app.pass - - export ANSIBLE_VAULT_IDENTITY_LIST="../lza_install_common.pass, ../lza_rosetta_app.pass" + - echo "${VAULT_INSTALL_COMMON}" > ../../../lza_install_common.pass + - echo "${VAULT_ROSETTA_APP}" > ../../../lza_rosetta_app.pass + - export ANSIBLE_VAULT_IDENTITY_LIST="../../../lza_install_common.pass, ../../../lza_rosetta_app.pass" - rm -rf ../ansible_vaults/ - rm -rf ../ansible_lza_install_common/ - git clone https://gitlab+deploy-token-25:${VAULT_ACCESS_TOKEN}@git.slub-dresden.de/slub-referat-2-3/ansible_vaults.git ../ansible_vaults/; - git clone https://git.slub-dresden.de/digital-preservation/ansible_lza_install_common.git ../ansible_lza_install_common/; # run Molecule tests - - molecule syntax --scenario-name default + - molecule syntax --scenario-name ${SCENARIO} # We cannot use `molecule lint` anymore because: # - https://github.com/ansible-community/molecule/pull/3802 "Remove lint command" # - https://github.com/ansible-community/molecule/discussions/3825#discussioncomment-4908366 - yamllint --strict --format colored ./ - ansible-lint --format full --profile production --strict --force-color ./ - - molecule create --scenario-name default - - molecule converge --scenario-name default - - molecule idempotence --scenario-name default - # - molecule verify --scenario-name default + - molecule create --scenario-name ${SCENARIO} + - molecule converge --scenario-name ${SCENARIO} + - molecule idempotence --scenario-name ${SCENARIO} + # - molecule verify --scenario-name ${SCENARIO} diff --git a/molecule/virtualbox_centos7/molecule.yml b/molecule/virtualbox_centos7/molecule.yml index 177b844..880d6eb 100644 --- a/molecule/virtualbox_centos7/molecule.yml +++ b/molecule/virtualbox_centos7/molecule.yml @@ -43,7 +43,7 @@ provisioner: defaults: # https://stackoverflow.com/questions/57435811/ansible-molecule-pass-multiple-vault-ids # vault_identity_list: "@$HOME/.ansible/roles/lza_install_common.pass, @$HOME/.ansible/roles/passfile_1.pass" - vault_identity_list: "../lza_install_common.pass, ../lza_rosetta_app.pass" + vault_identity_list: "../../../lza_install_common.pass, ../../../lza_rosetta_app.pass" vvv: false playbooks: # create: ../resources/playbooks/create.yml -- GitLab