Skip to content

Commit

Permalink
Split Debian family in molecule tests for docker-jenkins role
Browse files Browse the repository at this point in the history
  • Loading branch information
exitfound committed Dec 20, 2023
1 parent 80c46f5 commit 3896a8a
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# Данный файл используется для преобразования экземпляров в реальное состояние, объявленное в тестируемых ролях:
- name: Converge
hosts: all
tasks:
# Данный шаг вызывает роль docker-jenkins для прогона тестов:
- name: "Include docker-jenkins role for testing"
include_role:
name: "docker-jenkins"
56 changes: 56 additions & 0 deletions ansible/roles/docker-jenkins/molecule/docker-ubuntu/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
dependency:
name: galaxy

driver:
name: docker

platforms:
- name: ubuntu20.04
image: mdd13/ansible-docker-ubuntu:ubuntu20.04
pre_build_image: true
tmpfs:
- /run
- /tmp
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
privileged: true
capabilities:
- SYS_ADMIN
cgroup_parent: docker.slice
cgroupns_mode: host
override_command: false
security_opts:
- seccomp=unconfined

- name: ubuntu22.04
image: mdd13/ansible-docker-ubuntu:ubuntu22.04
pre_build_image: true
tmpfs:
- /run
- /tmp
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
privileged: true
capabilities:
- SYS_ADMIN
cgroup_parent: docker.slice
cgroupns_mode: host
override_command: false
security_opts:
- seccomp=unconfined

provisioner:
name: ansible
env:
ANSIBLE_STDOUT_CALLBACK: yaml
inventory:
links:
group_vars: ../group_vars/

verifier:
name: ansible

lint: |
yamllint -c ../../../.yamllint .
ansible-lint .
25 changes: 25 additions & 0 deletions ansible/roles/docker-jenkins/molecule/docker-ubuntu/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
# Данный файл используется для выполнения шагов на предмет проверки доступности запускаемого нами приложения:
- name: Verify
hosts: all
tasks:
# Добавление интервала по времени для загрузки Jenkins:
- name: Waiting 30 second for checking Jenkins
wait_for:
timeout: 30

# Проверка доступности Jenkins после установки:
- name: Checking Jenkins for availability
uri:
url: "http://127.0.0.1:8080"
method: GET
timeout: 30
return_content: true
validate_certs: no
status_code: [200, 403]
register: output

# Результат выполненной ранее проверки:
- name: Output the result of a registered variable
debug:
msg: "{{ output.content }}"

0 comments on commit 3896a8a

Please sign in to comment.