summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
authorjerome <jerome@xlinfo.fr>2023-05-03 16:08:36 +0200
committerjerome <jerome@xlinfo.fr>2023-05-03 16:08:36 +0200
commit948266d1c7f1ae107487699340715ddd41665f01 (patch)
treebf4fda27a3edf7bd259e6a9940608fc79545804a /.gitlab-ci.yml
downloadansible-lamp-948266d1c7f1ae107487699340715ddd41665f01.tar.gz
ansible-lamp-948266d1c7f1ae107487699340715ddd41665f01.zip
commit initial0.1
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml26
1 files changed, 26 insertions, 0 deletions
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