.gitlab-ci.yml
· 1.1 KiB · YAML
Неформатований
# See https://gitlab.com/richardskumat/ansible-role-client-debian-role/-/blob/master/.gitlab-ci.yml
image: qwe1/dind-ansible-molecule:latest
variables:
# DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
# https://gitlab.com/gitlab-org/gitlab-ce/issues/64959
# 19.03 had some breaking changes compared to 18.09
DOCKER_TLS_CERTDIR: ""
services:
- docker:dind
stages:
- test
before_script:
- docker info
- ansible --version
- molecule --version
test_d10:
stage: test
tags:
- ansible
variables:
MOLECULE_DISTRO: "geerlingguy/docker-debian10-ansible:testing"
script:
- cd roles/common
- molecule test
# need to setup a Matrix (https://docs.gitlab.com/ee/ci/yaml/#parallel-matrix-jobs)
#test_d8:
# stage: test
# tags:
# - ansible
# variables:
# MOLECULE_DISTRO: "geerlingguy/docker-debian8-ansible:testing"
# script:
# - cd roles/common
# - molecule test
#test_d9:
# stage: test
# tags:
# - ansible
# variables:
# MOLECULE_DISTRO: "geerlingguy/docker-debian9-ansible:testing"
# script:
# - cd roles/common
# - molecule test
| 1 | # See https://gitlab.com/richardskumat/ansible-role-client-debian-role/-/blob/master/.gitlab-ci.yml |
| 2 | image: qwe1/dind-ansible-molecule:latest |
| 3 | variables: |
| 4 | # DOCKER_HOST: tcp://docker:2375/ |
| 5 | DOCKER_DRIVER: overlay2 |
| 6 | # https://gitlab.com/gitlab-org/gitlab-ce/issues/64959 |
| 7 | # 19.03 had some breaking changes compared to 18.09 |
| 8 | DOCKER_TLS_CERTDIR: "" |
| 9 | |
| 10 | services: |
| 11 | - docker:dind |
| 12 | stages: |
| 13 | - test |
| 14 | before_script: |
| 15 | - docker info |
| 16 | - ansible --version |
| 17 | - molecule --version |
| 18 | |
| 19 | test_d10: |
| 20 | stage: test |
| 21 | tags: |
| 22 | - ansible |
| 23 | variables: |
| 24 | MOLECULE_DISTRO: "geerlingguy/docker-debian10-ansible:testing" |
| 25 | script: |
| 26 | - cd roles/common |
| 27 | - molecule test |
| 28 | # need to setup a Matrix (https://docs.gitlab.com/ee/ci/yaml/#parallel-matrix-jobs) |
| 29 | #test_d8: |
| 30 | # stage: test |
| 31 | # tags: |
| 32 | # - ansible |
| 33 | # variables: |
| 34 | # MOLECULE_DISTRO: "geerlingguy/docker-debian8-ansible:testing" |
| 35 | # script: |
| 36 | # - cd roles/common |
| 37 | # - molecule test |
| 38 | #test_d9: |
| 39 | # stage: test |
| 40 | # tags: |
| 41 | # - ansible |
| 42 | # variables: |
| 43 | # MOLECULE_DISTRO: "geerlingguy/docker-debian9-ansible:testing" |
| 44 | # script: |
| 45 | # - cd roles/common |
| 46 | # - molecule test |
molecule.yml
· 1.3 KiB · YAML
Неформатований
---
# See https://github.com/ContinuousSecurityTooling/ansible-role-secure-docker/blob/master/molecule/default/molecule.yml
# See https://gitlab.com/richardskumat/ansible-role-client-debian-role/-/blob/master/molecule/default/molecule.yml
dependency:
name: galaxy
driver:
name: docker
lint: |
set -e
yamllint -c molecule/default/yaml-lint.yml .
ansible-lint -c molecule/default/ansible-lint.yml
platforms:
- name: instance
image: "${MOLECULE_DISTRO:-qwe1/docker-debian:10-nonfree}"
command: ${MOLECULE_DOCKER_COMMAND:-""}
# capabilities:
# - SYS_ADMIN # Needed to change hostname via playbook
# see https://github.com/ansible/ansible/issues/19681#issuecomment-450425779
# - AUDIT_CONTROL
# - AUDIT_READ
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
privileged: true
pre_build_image: true
# groups:
# - testgroup
provisioner:
name: ansible
log: true
config_options:
defaults:
local_tmp: /tmp/.ansible-$USER/tmp
remote_tmp: /tmp/.ansible-$USER/tmp
connection_options:
ansible_user: root
inventory:
links:
group_vars: ../../../../inventories/production/group_vars/
host_vars: ../../../../inventories/production/host_vars/
playbooks:
converge: playbook.yml
options:
vvv: true
scenario:
name: default
| 1 | --- |
| 2 | # See https://github.com/ContinuousSecurityTooling/ansible-role-secure-docker/blob/master/molecule/default/molecule.yml |
| 3 | # See https://gitlab.com/richardskumat/ansible-role-client-debian-role/-/blob/master/molecule/default/molecule.yml |
| 4 | dependency: |
| 5 | name: galaxy |
| 6 | driver: |
| 7 | name: docker |
| 8 | lint: | |
| 9 | set -e |
| 10 | yamllint -c molecule/default/yaml-lint.yml . |
| 11 | ansible-lint -c molecule/default/ansible-lint.yml |
| 12 | platforms: |
| 13 | - name: instance |
| 14 | image: "${MOLECULE_DISTRO:-qwe1/docker-debian:10-nonfree}" |
| 15 | command: ${MOLECULE_DOCKER_COMMAND:-""} |
| 16 | # capabilities: |
| 17 | # - SYS_ADMIN # Needed to change hostname via playbook |
| 18 | # see https://github.com/ansible/ansible/issues/19681#issuecomment-450425779 |
| 19 | # - AUDIT_CONTROL |
| 20 | # - AUDIT_READ |
| 21 | volumes: |
| 22 | - /sys/fs/cgroup:/sys/fs/cgroup:ro |
| 23 | privileged: true |
| 24 | pre_build_image: true |
| 25 | # groups: |
| 26 | # - testgroup |
| 27 | provisioner: |
| 28 | name: ansible |
| 29 | log: true |
| 30 | config_options: |
| 31 | defaults: |
| 32 | local_tmp: /tmp/.ansible-$USER/tmp |
| 33 | remote_tmp: /tmp/.ansible-$USER/tmp |
| 34 | connection_options: |
| 35 | ansible_user: root |
| 36 | inventory: |
| 37 | links: |
| 38 | group_vars: ../../../../inventories/production/group_vars/ |
| 39 | host_vars: ../../../../inventories/production/host_vars/ |
| 40 | playbooks: |
| 41 | converge: playbook.yml |
| 42 | options: |
| 43 | vvv: true |
| 44 | scenario: |
| 45 | name: default |