-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split Debian family in molecule tests for docker-jenkins role
- Loading branch information
Showing
3 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
ansible/roles/docker-jenkins/molecule/docker-ubuntu/converge.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
56
ansible/roles/docker-jenkins/molecule/docker-ubuntu/molecule.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
25
ansible/roles/docker-jenkins/molecule/docker-ubuntu/verify.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }}" |