From 9103d7a96d55ffdac1fad83daa235608c2a399ab Mon Sep 17 00:00:00 2001 From: Bertrand Lanson Date: Sun, 30 Apr 2023 20:21:23 +0200 Subject: [PATCH] added chain to client cert, and CI --- .gitlab-ci.yml | 82 ++++++++++++++++++++++++++++++++ templates/consul_cert.pem.tpl.j2 | 2 + 2 files changed, 84 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..468a01d --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,82 @@ +--- +stages: + - verify + - test-default + - test-with-custom-config + +image: + name: registry.ednz.fr/forge/ansible-runner + +variables: + ANSIBLE_HOST_KEY_CHECKING: 'false' + ANSIBLE_FORCE_COLOR: 'true' + ANSIBLE_PYTHON_INTERPRETER: /usr/bin/python3 + DOCKER_AUTH_CONFIG: $CI_DOCKER_AUTH_CONFIG + +.stage-test-default: + stage: test-default + +.stage-test-with-custom-config: + stage: test-with-custom-config + +.variables-ubuntu-2004: + variables: + MOLECULE_TEST_OS: "ubuntu2004" + +.variables-ubuntu-2204: + variables: + MOLECULE_TEST_OS: "ubuntu2204" + +.variables-debian-11: + variables: + MOLECULE_TEST_OS: "debian11" + +.script-molecule-test-default: + script: + - molecule test + +.script-molecule-test-with-custom-config: + script: + - molecule test -s with_custom_config + +ansible-verify: + stage: verify + script: + - yamllint . -c .yamllint + - ansible-lint + +ansible-test-ubuntu-2004-default: + extends: + - .stage-test-default + - .variables-ubuntu-2004 + - .script-molecule-test-default + +ansible-test-ubuntu-2204-default: + extends: + - .stage-test-default + - .variables-ubuntu-2204 + - .script-molecule-test-default + +ansible-test-debian-11-default: + extends: + - .stage-test-default + - .variables-debian-11 + - .script-molecule-test-default + +ansible-test-ubuntu-2004-with-custom-config: + extends: + - .stage-test-with-custom-config + - .variables-ubuntu-2004 + - .script-molecule-test-with-custom-config + +ansible-test-ubuntu-2204-with-custom-config: + extends: + - .stage-test-with-custom-config + - .variables-ubuntu-2204 + - .script-molecule-test-with-custom-config + +ansible-test-debian-11-with-custom-config: + extends: + - .stage-test-with-custom-config + - .variables-debian-11 + - .script-molecule-test-with-custom-config diff --git a/templates/consul_cert.pem.tpl.j2 b/templates/consul_cert.pem.tpl.j2 index 223634d..b45ded2 100644 --- a/templates/consul_cert.pem.tpl.j2 +++ b/templates/consul_cert.pem.tpl.j2 @@ -2,4 +2,6 @@ {% raw %}{{ .Data.certificate }}{% endraw %} +{% raw %}{{ .Data.issuing_ca }}{% endraw %} + {% raw %}{{ end }}{% endraw %}