waja hat die Gist bearbeitet 4 years ago. Zu Änderung gehen
1 file changed, 45 insertions
molecule.yml(Datei erstellt)
| @@ -0,0 +1,45 @@ | |||
| 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 | |
waja hat die Gist bearbeitet 4 years ago. Zu Änderung gehen
1 file changed, 46 insertions
.gitlab-ci.yml(Datei erstellt)
| @@ -0,0 +1,46 @@ | |||
| 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 | |