---
dependency:
  name: galaxy
  enabled: true
  options:
    requirements-file: molecule/default/collections.yml

driver:
  name: default

platforms:
  - name: zabbix-server-${MY_MOLECULE_VERSION:-v72}-${MY_MOLECULE_DATABASE:-mysql}-${MY_MOLECULE_CONTAINER:-rockylinux8}
    image: geerlingguy/docker-${MY_MOLECULE_IMAGE:-rockylinux8}-ansible:latest
    privileged: true
    pre_build_image: true
    command: ${MOLECULE_DOCKER_COMMAND:-""}
    networks:
      - name: zabbix
    volumes:
      - /sys/fs/cgroup:/sys/fs/cgroup:rw
    cgroupns_mode: host
    groups:
      - ${MY_MOLECULE_DATABASE:-mysql}
      - ${MY_MOLECULE_VERSION:-v72}

provisioner:
  name: ansible
  playbooks:
    create: ../default/create.docker.yml
    destroy: ../default/destroy.docker.yml
  env:
    # https://github.com/ansible/molecule/issues/4015#issuecomment-1680859724
    ANSIBLE_ROLES_PATH: ../../roles
  inventory:
    group_vars:
      all:
        ansible_connection: community.docker.docker
        zabbix_repo_apt_priority: 1
        zabbix_repo_yum_gpg_check: 1
      v72:
        zabbix_server_version: 7.2
      v70:
        zabbix_server_version: 7.0
      v64:
        zabbix_server_version: 6.4
      v60:
        zabbix_server_version: 6.0
      mysql:
        zabbix_server_dbname: zabbix
        zabbix_server_dbuser: zabbix-dbuser
        zabbix_server_database: mysql
        zabbix_server_dbhost: "{{ inventory_hostname }}-db"
        zabbix_server_dbhost_run_install: false
        zabbix_server_privileged_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_dbhost: "{{ inventory_hostname }}-db"
        zabbix_server_dbhost_run_install: false
        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
        zabbix_server_database_timescaledb: true

verifier:
  name: testinfra
