diff options
Diffstat (limited to 'ansible_collections/community/zabbix/molecule')
12 files changed, 33 insertions, 46 deletions
diff --git a/ansible_collections/community/zabbix/molecule/requirements.txt b/ansible_collections/community/zabbix/molecule/requirements.txt index b7cbb1138..9ccb5e157 100644 --- a/ansible_collections/community/zabbix/molecule/requirements.txt +++ b/ansible_collections/community/zabbix/molecule/requirements.txt @@ -3,9 +3,9 @@ ansible==7.0.0 ansible-compat==3.0.0 ansible-core==2.14.2 docker==6.1.3 -molecule==4.0.4 -molecule-docker==2.1.0 -netaddr==0.8.0 +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 diff --git a/ansible_collections/community/zabbix/molecule/zabbix_agent_tests/common/playbooks/prepare.yml b/ansible_collections/community/zabbix/molecule/zabbix_agent_tests/common/playbooks/prepare.yml index cf1100aab..2ad8efa3f 100644 --- a/ansible_collections/community/zabbix/molecule/zabbix_agent_tests/common/playbooks/prepare.yml +++ b/ansible_collections/community/zabbix/molecule/zabbix_agent_tests/common/playbooks/prepare.yml @@ -47,6 +47,7 @@ hosts: docker tasks: - name: "Download Docker CE repo file" + when: not ansible_check_mode # Because get_url always has changed status in check_mode. ansible.builtin.get_url: url: https://download.docker.com/linux/centos/docker-ce.repo dest: /etc/yum.repos.d/docker-ce.repo diff --git a/ansible_collections/community/zabbix/molecule/zabbix_javagateway/molecule.yml b/ansible_collections/community/zabbix/molecule/zabbix_javagateway/molecule.yml index ee072707d..0c6de4172 100644 --- a/ansible_collections/community/zabbix/molecule/zabbix_javagateway/molecule.yml +++ b/ansible_collections/community/zabbix/molecule/zabbix_javagateway/molecule.yml @@ -3,7 +3,7 @@ driver: name: docker platforms: - - name: zabbix-server-${MY_MOLECULE_CONTAINER:-centos} + - name: zabbix-server-${MY_MOLECULE_VERSION:-v64}-${MY_MOLECULE_DATABASE:-mysql}-${MY_MOLECULE_CONTAINER:-rockylinux8} image: geerlingguy/docker-${MY_MOLECULE_IMAGE:-rockylinux8}-ansible:latest privileged: true pre_build_image: true diff --git a/ansible_collections/community/zabbix/molecule/zabbix_proxy/destroy.yml b/ansible_collections/community/zabbix/molecule/zabbix_proxy/destroy.yml index 54771a5a1..7ef374be5 100644 --- a/ansible_collections/community/zabbix/molecule/zabbix_proxy/destroy.yml +++ b/ansible_collections/community/zabbix/molecule/zabbix_proxy/destroy.yml @@ -17,9 +17,7 @@ - name: Destroy 3rd party instance(s) docker_container: - name: '{{ item }}' + name: "{{ item.name }}-db" state: absent force_kill: true - with_items: - - mysql-host - - postgresql-host + loop: "{{ molecule_yml.platforms }}" diff --git a/ansible_collections/community/zabbix/molecule/zabbix_proxy/molecule.yml b/ansible_collections/community/zabbix/molecule/zabbix_proxy/molecule.yml index 4eb173acf..4eadd60ab 100644 --- a/ansible_collections/community/zabbix/molecule/zabbix_proxy/molecule.yml +++ b/ansible_collections/community/zabbix/molecule/zabbix_proxy/molecule.yml @@ -2,7 +2,7 @@ driver: name: docker platforms: - - name: zabbix-proxy-${MY_MOLECULE_CONTAINER:-centos} + - name: zabbix-proxy-${MY_MOLECULE_VERSION:-v64}-${MY_MOLECULE_DATABASE:-mysql}-${MY_MOLECULE_CONTAINER:-rockylinux8} image: geerlingguy/docker-${MY_MOLECULE_IMAGE:-rockylinux8}-ansible:latest privileged: true pre_build_image: true @@ -37,19 +37,19 @@ provisioner: zabbix_proxy_dbuser: zabbix-dbuser zabbix_proxy_database: mysql zabbix_proxy_dbport: 3306 - zabbix_proxy_dbhost: mysql-host + zabbix_proxy_dbhost: "{{ inventory_hostname }}-db" zabbix_proxy_dbhost_run_install: false zabbix_proxy_privileged_host: "%" - zabbix_proxy_mysql_login_host: mysql-host + zabbix_proxy_mysql_login_host: "{{ inventory_hostname }}-db" zabbix_proxy_mysql_login_user: root zabbix_proxy_mysql_login_password: changeme zabbix_proxy_mysql_login_port: 3306 pgsql: zabbix_proxy_database: pgsql zabbix_proxy_dbport: 5432 - zabbix_proxy_dbhost: postgresql-host + zabbix_proxy_dbhost: "{{ inventory_hostname }}-db" zabbix_proxy_dbhost_run_install: false - zabbix_proxy_pgsql_login_host: postgresql-host + zabbix_proxy_pgsql_login_host: "{{ inventory_hostname }}-db" zabbix_proxy_pgsql_login_user: postgres zabbix_proxy_pgsql_login_password: changeme zabbix_proxy_pgsql_login_port: 5432 diff --git a/ansible_collections/community/zabbix/molecule/zabbix_proxy/prepare.yml b/ansible_collections/community/zabbix/molecule/zabbix_proxy/prepare.yml index c5e3b9e45..1ff492d62 100644 --- a/ansible_collections/community/zabbix/molecule/zabbix_proxy/prepare.yml +++ b/ansible_collections/community/zabbix/molecule/zabbix_proxy/prepare.yml @@ -5,7 +5,7 @@ pre_tasks: - name: "Create MySQL Container" docker_container: - name: mysql-host + name: "{{ item.name }}-db" image: mysql:8.0 state: started recreate: true @@ -20,7 +20,7 @@ - name: "Create postgresql Container" docker_container: - name: postgresql-host + name: "{{ item.name }}-db" image: postgres:13 state: started recreate: true diff --git a/ansible_collections/community/zabbix/molecule/zabbix_server/destroy.yml b/ansible_collections/community/zabbix/molecule/zabbix_server/destroy.yml index 54771a5a1..7ef374be5 100644 --- a/ansible_collections/community/zabbix/molecule/zabbix_server/destroy.yml +++ b/ansible_collections/community/zabbix/molecule/zabbix_server/destroy.yml @@ -17,9 +17,7 @@ - name: Destroy 3rd party instance(s) docker_container: - name: '{{ item }}' + name: "{{ item.name }}-db" state: absent force_kill: true - with_items: - - mysql-host - - postgresql-host + loop: "{{ molecule_yml.platforms }}" diff --git a/ansible_collections/community/zabbix/molecule/zabbix_server/molecule.yml b/ansible_collections/community/zabbix/molecule/zabbix_server/molecule.yml index 2424455f4..52df5ac4e 100644 --- a/ansible_collections/community/zabbix/molecule/zabbix_server/molecule.yml +++ b/ansible_collections/community/zabbix/molecule/zabbix_server/molecule.yml @@ -2,7 +2,7 @@ driver: name: docker platforms: - - name: zabbix-server-${MY_MOLECULE_CONTAINER:-centos} + - name: zabbix-server-${MY_MOLECULE_VERSION:-v64}-${MY_MOLECULE_DATABASE:-mysql}-${MY_MOLECULE_CONTAINER:-rockylinux8} image: geerlingguy/docker-${MY_MOLECULE_IMAGE:-rockylinux8}-ansible:latest privileged: true pre_build_image: true @@ -40,19 +40,19 @@ provisioner: zabbix_server_dbuser: zabbix-dbuser zabbix_server_database: mysql zabbix_server_dbport: 3306 - zabbix_server_dbhost: mysql-host + zabbix_server_dbhost: "{{ inventory_hostname }}-db" zabbix_server_dbhost_run_install: false zabbix_server_privileged_host: "%" - zabbix_server_mysql_login_host: mysql-host + zabbix_server_mysql_login_host: "{{ inventory_hostname }}-db" zabbix_server_mysql_login_user: root zabbix_server_mysql_login_password: changeme zabbix_server_mysql_login_port: 3306 pgsql: zabbix_server_database: pgsql zabbix_server_dbport: 5432 - zabbix_server_dbhost: postgresql-host + zabbix_server_dbhost: "{{ inventory_hostname }}-db" zabbix_server_dbhost_run_install: false - zabbix_server_pgsql_login_host: postgresql-host + zabbix_server_pgsql_login_host: "{{ inventory_hostname }}-db" zabbix_server_pgsql_login_user: postgres zabbix_server_pgsql_login_password: changeme zabbix_server_pgsql_login_port: 5432 diff --git a/ansible_collections/community/zabbix/molecule/zabbix_server/prepare.yml b/ansible_collections/community/zabbix/molecule/zabbix_server/prepare.yml index 922b33753..725e6d718 100644 --- a/ansible_collections/community/zabbix/molecule/zabbix_server/prepare.yml +++ b/ansible_collections/community/zabbix/molecule/zabbix_server/prepare.yml @@ -5,7 +5,7 @@ pre_tasks: - name: "Create MySQL Container" docker_container: - name: mysql-host + name: "{{ item.name }}-db" image: mysql:8.0.32 state: started recreate: true @@ -20,7 +20,7 @@ - name: "Create postgresql Container" docker_container: - name: postgresql-host + name: "{{ item.name }}-db" image: postgres:13 state: started recreate: true @@ -109,11 +109,3 @@ state: absent when: - ansible_os_family == 'RedHat' - - - name: PyMySQL - ansible.builtin.pip: - name: PyMySQL - register: installation_dependencies - until: installation_dependencies is succeeded - when: - - inventory_hostname in groups['mysql'] diff --git a/ansible_collections/community/zabbix/molecule/zabbix_web/destroy.yml b/ansible_collections/community/zabbix/molecule/zabbix_web/destroy.yml index 54771a5a1..7ef374be5 100644 --- a/ansible_collections/community/zabbix/molecule/zabbix_web/destroy.yml +++ b/ansible_collections/community/zabbix/molecule/zabbix_web/destroy.yml @@ -17,9 +17,7 @@ - name: Destroy 3rd party instance(s) docker_container: - name: '{{ item }}' + name: "{{ item.name }}-db" state: absent force_kill: true - with_items: - - mysql-host - - postgresql-host + loop: "{{ molecule_yml.platforms }}" diff --git a/ansible_collections/community/zabbix/molecule/zabbix_web/molecule.yml b/ansible_collections/community/zabbix/molecule/zabbix_web/molecule.yml index 0aa3ab800..549b7ae16 100644 --- a/ansible_collections/community/zabbix/molecule/zabbix_web/molecule.yml +++ b/ansible_collections/community/zabbix/molecule/zabbix_web/molecule.yml @@ -10,7 +10,7 @@ dependency: driver: name: docker platforms: - - name: zabbix-web-${MY_MOLECULE_CONTAINER:-centos} + - name: zabbix-web-${MY_MOLECULE_VERSION:-v64}-${MY_MOLECULE_DATABASE:-mysql}-${MY_MOLECULE_CONTAINER:-rockylinux8} image: geerlingguy/docker-${MY_MOLECULE_IMAGE:-rockylinux8}-ansible:latest privileged: true pre_build_image: true @@ -33,7 +33,7 @@ provisioner: inventory: group_vars: all: - zabbix_api_server_url: zabbix-web-${MY_MOLECULE_CONTAINER:-centos} + zabbix_api_server_url: zabbix-web-${MY_MOLECULE_VERSION:-v64}-${MY_MOLECULE_DATABASE:-mysql}-${MY_MOLECULE_CONTAINER:-rockylinux8} python3: ansible_python_interpreter: /usr/bin/python3 python: @@ -50,19 +50,19 @@ provisioner: mysql: zabbix_server_database: mysql zabbix_server_dbport: 3306 - zabbix_server_dbhost: mysql-host + zabbix_server_dbhost: "{{ inventory_hostname }}-db" zabbix_server_dbhost_run_install: false zabbix_server_privileged_host: "%" - zabbix_server_mysql_login_host: mysql-host + zabbix_server_mysql_login_host: "{{ inventory_hostname }}-db" zabbix_server_mysql_login_user: root zabbix_server_mysql_login_password: changeme zabbix_server_mysql_login_port: 3306 pgsql: zabbix_server_database: pgsql zabbix_server_dbport: 5432 - zabbix_server_dbhost: postgresql-host + zabbix_server_dbhost: "{{ inventory_hostname }}-db" zabbix_server_dbhost_run_install: false - zabbix_server_pgsql_login_host: postgresql-host + zabbix_server_pgsql_login_host: "{{ inventory_hostname }}-db" zabbix_server_pgsql_login_user: postgres zabbix_server_pgsql_login_password: changeme zabbix_server_pgsql_login_port: 5432 diff --git a/ansible_collections/community/zabbix/molecule/zabbix_web/prepare.yml b/ansible_collections/community/zabbix/molecule/zabbix_web/prepare.yml index 204eb8f56..d3dcc1ad0 100644 --- a/ansible_collections/community/zabbix/molecule/zabbix_web/prepare.yml +++ b/ansible_collections/community/zabbix/molecule/zabbix_web/prepare.yml @@ -5,7 +5,7 @@ pre_tasks: - name: "Create MySQL Container" docker_container: - name: mysql-host + name: "{{ item.name }}-db" image: mysql:8.0 state: started recreate: true @@ -20,7 +20,7 @@ - name: "Create postgresql Container" docker_container: - name: postgresql-host + name: "{{ item.name }}-db" image: postgres:13 state: started recreate: true |