2021-06-07 16:24:09 +00:00
|
|
|
image: ansible/ansible-runner
|
|
|
|
|
|
|
|
before_script:
|
|
|
|
# from https://docs.gitlab.com/ee/ci/ssh_keys/
|
|
|
|
#- 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )'
|
|
|
|
- eval $(ssh-agent -s)
|
|
|
|
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
|
2021-06-07 16:43:00 +00:00
|
|
|
- mkdir -p /root/.ssh
|
|
|
|
- chmod 700 /root/.ssh
|
2021-06-07 16:37:40 +00:00
|
|
|
- echo "$SSH_KNOWN_HOSTS" >> /root/.ssh/known_hosts
|
2021-06-07 16:43:00 +00:00
|
|
|
- chmod 644 /root/.ssh/known_hosts
|
2021-06-07 16:26:02 +00:00
|
|
|
|
2021-06-07 16:44:28 +00:00
|
|
|
deploy:
|
2021-06-07 16:26:02 +00:00
|
|
|
script:
|
2021-06-07 16:44:28 +00:00
|
|
|
- ansible-playbook -i config/hosts config/deploy.yml
|