This image is build to be use with gitlab CI/CD pipeline. The target is to deploy terraform and ansible configuration with gitlab CI/CD.
- latest Dockerfile
- docker hub
Build from python:latest
Added packages:
-
nano
-
libssl-dev
-
libffi-dev
-
python-dev
-
openssl
-
unzip
-
curl
-
git
-
iputils-ping
-
make
-
python-jmespath
-
go
-
ansible
-
ansible-lint
-
pywinrm
-
netaddr
-
pexpect
-
passlib
-
ansible[azure]
-
kubernetes-validate
-
openshift
-
PyYAML
-
ruamel.yaml
-
PyMySQL
-
yamlpath
-
terraform
-
workdir = /root
Starting the wikijs instance listening on port 80 is as easy as the following:
docker run -d --restart=unless-stopped tlnk/mgm-infra:tag
The exemple below show ansible integration with 2 step
- lint of the file
- ansible deployment with the load of the SSH key and dynamic inventory from terraform
stages:
- job-ansible-lint
- job-ansible-deploy
job-ansible-lint:
stage: job-ansible-lint
image: tlnk/mgm-infra:tag
script:
- cp -r /builds/gitlabusername/infrastructure/ansible /root/ansible
- cd /root/ansible
- ansible-lint *.yml -v
only:
refs:
- master
changes:
- ansible/*
job-ansible-deploy:
stage: job-ansible-deploy
image: tlnk/mgm-infra:tag
script:
- eval $(ssh-agent -s)
- touch /root/.ssh/id_rsa
- echo "$SSH_PRIVATE_KEY" > /root/.ssh/id_rsa
- chmod 600 /root/.ssh/id_rsa
- ansible-playbook -i /etc/ansible/terraform.py -u root ansible/infra.yml
when: on_success
only:
refs:
- master
changes:
- ansible/*