Management infrastructure
Description
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.
Supported tags and respective
- latest Dockerfile
- docker hub
Image configuration
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
How to use this image
Start mgm-infra
Starting the wikijs instance listening on port 80 is as easy as the following:
docker run -d --restart=unless-stopped tlnk/mgm-infra:tag
how to use this image with gitlab CI/CD
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/*