Sign inSign up

tlnk/mgm-infra

By tlnk

•Updated about 5 years ago

Ansible and terraform tool for gitlab CI/CD pipeline

Image
0

7.6K

tlnk/mgm-infra repository overview

⁠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

⁠Image configuration

Build from python:latest⁠

Added packages:

⁠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

⁠how to use this image with gitlab CI/CD

The exemple below show ansible integration with 2 step

  1. lint of the file
  2. 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
  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
  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/*

Tag summary

Content type

Image

Digest

Size

698.7 MB

Last updated

about 5 years ago

docker pull tlnk/mgm-infra