Skip to content
Snippets Groups Projects
Commit c7d3bd1b authored by Jörg Sachse's avatar Jörg Sachse
Browse files

test: update CI and Molecule configs to be more generic and conform to new...

test: update CI and Molecule configs to be more generic and conform to new requirements concerning Vault password files
parent 4fe3a0da
Branches
Tags
No related merge requests found
Pipeline #4883 passed
...@@ -7,6 +7,10 @@ ...@@ -7,6 +7,10 @@
stages: # List of stages for jobs, and their order of execution stages: # List of stages for jobs, and their order of execution
- test - test
variables:
# CI_DEBUG_TRACE: "true"
SCENARIO: "default"
default: default:
before_script: before_script:
- source /opt/molecule/bin/activate - source /opt/molecule/bin/activate
...@@ -14,7 +18,7 @@ default: ...@@ -14,7 +18,7 @@ default:
- molecule --version - molecule --version
after_script: after_script:
- source /opt/molecule/bin/activate - source /opt/molecule/bin/activate
- molecule destroy --scenario-name default - molecule destroy --scenario-name ${SCENARIO}
test-job: test-job:
stage: test stage: test
...@@ -22,21 +26,21 @@ test-job: ...@@ -22,21 +26,21 @@ test-job:
- "shell" - "shell"
script: script:
# make sure that Ansible Vaults are present and can be decrypted # make sure that Ansible Vaults are present and can be decrypted
- echo "${VAULT_INSTALL_COMMON}" > ../lza_install_common.pass - echo "${VAULT_INSTALL_COMMON}" > ../../../lza_install_common.pass
- echo "${VAULT_ROSETTA_APP}" > ../lza_rosetta_app.pass - echo "${VAULT_ROSETTA_APP}" > ../../../lza_rosetta_app.pass
- export ANSIBLE_VAULT_IDENTITY_LIST="../lza_install_common.pass, ../lza_rosetta_app.pass" - export ANSIBLE_VAULT_IDENTITY_LIST="../../../lza_install_common.pass, ../../../lza_rosetta_app.pass"
- rm -rf ../ansible_vaults/ - rm -rf ../ansible_vaults/
- rm -rf ../ansible_lza_install_common/ - 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://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/; - git clone https://git.slub-dresden.de/digital-preservation/ansible_lza_install_common.git ../ansible_lza_install_common/;
# run Molecule tests # run Molecule tests
- molecule syntax --scenario-name default - molecule syntax --scenario-name ${SCENARIO}
# We cannot use `molecule lint` anymore because: # We cannot use `molecule lint` anymore because:
# - https://github.com/ansible-community/molecule/pull/3802 "Remove lint command" # - https://github.com/ansible-community/molecule/pull/3802 "Remove lint command"
# - https://github.com/ansible-community/molecule/discussions/3825#discussioncomment-4908366 # - https://github.com/ansible-community/molecule/discussions/3825#discussioncomment-4908366
- yamllint --strict --format colored ./ - yamllint --strict --format colored ./
- ansible-lint --format full --profile production --strict --force-color ./ - ansible-lint --format full --profile production --strict --force-color ./
- molecule create --scenario-name default - molecule create --scenario-name ${SCENARIO}
- molecule converge --scenario-name default - molecule converge --scenario-name ${SCENARIO}
- molecule idempotence --scenario-name default - molecule idempotence --scenario-name ${SCENARIO}
# - molecule verify --scenario-name default # - molecule verify --scenario-name ${SCENARIO}
...@@ -43,7 +43,7 @@ provisioner: ...@@ -43,7 +43,7 @@ provisioner:
defaults: defaults:
# https://stackoverflow.com/questions/57435811/ansible-molecule-pass-multiple-vault-ids # 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: "@$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 vvv: false
playbooks: playbooks:
# create: ../resources/playbooks/create.yml # create: ../resources/playbooks/create.yml
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment