From 948266d1c7f1ae107487699340715ddd41665f01 Mon Sep 17 00:00:00 2001 From: jerome Date: Wed, 3 May 2023 16:08:36 +0200 Subject: commit initial --- .gitlab-ci.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .gitlab-ci.yml (limited to '.gitlab-ci.yml') diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..c816acd --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,26 @@ +stages: # List of stages for jobs, and their order of execution + - test + - deploy + +lint-test-job: + stage: test + image: pipelinecomponents/ansible-lint + script: + - ansible-lint -p lamp.yml | ansible-lint-junit -o ansible-lint.xml || true + artifacts: + when: always + reports: + junit: ansible-lint.xml + +deploy-job: + stage: deploy + image: ansible + before_script: + - mkdir -p ~/.ssh + - ssh-keyscan ansible-debian.xlinfo.lan > ~/.ssh/known_hosts + - ssh-keyscan ansible-rocky.xlinfo.lan >> ~/.ssh/known_hosts + - echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa + - chmod 600 ~/.ssh/id_rsa + - chmod 700 ~/.ssh/ + script: + - ansible-playbook lamp.yml -i hosts -- cgit v1.2.3