forked from ansible-collections/community.zabbix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Use of Molecule (ansible-collections#1303)
- Loading branch information
Showing
23 changed files
with
220 additions
and
256 deletions.
There are no files selected for viewing
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
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,4 @@ | ||
--- | ||
collections: | ||
- name: community.docker | ||
version: ">=3.0.0" |
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,47 @@ | ||
--- | ||
- name: Create | ||
hosts: localhost | ||
connection: local | ||
|
||
gather_facts: false | ||
|
||
pre_tasks: | ||
- name: Create network | ||
community.docker.docker_network: | ||
name: zabbix | ||
|
||
tasks: | ||
- name: Create OS container(s) | ||
community.docker.docker_container: | ||
state: started | ||
recreate: true | ||
name: "{{ item.name }}" | ||
image: "{{ item.image }}" | ||
privileged: "{{ item.privileged | default(omit) }}" | ||
command: "{{ item.command | default(omit) }}" | ||
networks: "{{ item.networks | default(omit) }}" | ||
volumes: "{{ item.volumes | default(omit) }}" | ||
cgroupns_mode: "{{ item.cgroupns_mode | default(omit) }}" | ||
loop: "{{ molecule_yml.platforms }}" | ||
|
||
- name: Create database container(s) | ||
community.docker.docker_container: | ||
name: "{{ item.name }}-db" | ||
image: "{{ _container[_db_type].image }}" | ||
state: started | ||
recreate: true | ||
networks: | ||
- name: zabbix | ||
env: "{{ _container[_db_type].env }}" | ||
loop: "{{ molecule_yml.platforms }}" | ||
when: item.groups | intersect(_database_groups) | ||
vars: | ||
_database_groups: ['mysql', 'pgsql'] | ||
_db_type: "{{ item.groups | intersect(_database_groups) | first }}" | ||
_container: | ||
mysql: | ||
image: "mysql:8.0" | ||
env: { MYSQL_ROOT_PASSWORD: changeme } | ||
pgsql: | ||
image: "postgres:13" | ||
env: { POSTGRES_PASSWORD: changeme } |
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,27 @@ | ||
--- | ||
- name: Destroy | ||
hosts: localhost | ||
connection: local | ||
|
||
gather_facts: false | ||
|
||
tasks: | ||
- name: Destroy OS container(s) | ||
community.docker.docker_container: | ||
name: "{{ item.name }}" | ||
state: absent | ||
force_kill: "{{ item.force_kill | default(True) }}" | ||
loop: "{{ molecule_yml.platforms }}" | ||
|
||
- name: Destroy database container(s) | ||
community.docker.docker_container: | ||
name: "{{ item.name }}-db" | ||
state: absent | ||
force_kill: true | ||
loop: "{{ molecule_yml.platforms }}" | ||
|
||
post_tasks: | ||
- name: Destroy network | ||
community.docker.docker_network: | ||
name: zabbix | ||
state: absent |
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 |
---|---|---|
@@ -1,13 +1,7 @@ | ||
# Install CI dependencies for the Zabbix Roles | ||
#ansible==8.0.0 # commented out to avoid installing collections in site-packages/ansible_collections | ||
ansible-compat==3.0.0 | ||
ansible-core==2.15.11 | ||
docker==6.1.3 | ||
molecule<5 | ||
molecule-docker @ git+https://github.com/ansible-community/molecule-docker@main | ||
netaddr==1.2.1 | ||
pytest==7.2.1 | ||
pytest-testinfra==7.0.0 | ||
ipaddr==2.2.0 | ||
ipaddress==1.0.23 | ||
requests==2.31.0 | ||
ansible-core<2.17 | ||
docker | ||
molecule>=6,<24.7.0 | ||
netaddr>=1.2.1 | ||
pytest<8 # newer versions require python>=3.8 | ||
pytest-testinfra<9 # newer versions require python>=3.9 |
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,4 @@ | ||
--- | ||
collections: | ||
- name: community.docker | ||
version: ">=3.0.0" |
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
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: Create | ||
hosts: localhost | ||
connection: local | ||
|
||
gather_facts: false | ||
|
||
pre_tasks: | ||
- name: Create network | ||
community.docker.docker_network: | ||
name: zabbix | ||
|
||
tasks: | ||
- name: "Create OS container" | ||
community.docker.docker_container: | ||
state: started | ||
recreate: true | ||
name: "{{ item.name }}" | ||
image: "{{ item.image }}" | ||
privileged: "{{ item.privileged | default(omit) }}" | ||
command: "{{ item.command | default(omit) }}" | ||
networks: "{{ item.networks | default(omit) }}" | ||
volumes: "{{ item.volumes | default(omit) }}" | ||
cgroupns_mode: "{{ item.cgroupns_mode | default(omit) }}" | ||
loop: "{{ molecule_yml.platforms }}" |
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,20 @@ | ||
--- | ||
- name: Destroy | ||
hosts: localhost | ||
connection: local | ||
|
||
gather_facts: false | ||
|
||
tasks: | ||
- name: Destroy OS container(s) | ||
community.docker.docker_container: | ||
name: "{{ item.name }}" | ||
state: absent | ||
force_kill: "{{ item.force_kill | default(True) }}" | ||
loop: "{{ molecule_yml.platforms }}" | ||
|
||
post_tasks: | ||
- name: Destroy network | ||
community.docker.docker_network: | ||
name: zabbix | ||
state: absent |
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
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
--- | ||
- name: Prepare | ||
hosts: all | ||
|
||
pre_tasks: | ||
- name: "Installing packages on CentOS" | ||
ansible.builtin.yum: | ||
|
This file was deleted.
Oops, something went wrong.
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
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.