---
dependency:
  name: galaxy
driver:
  name: docker
lint: |
  set -e
  yamllint .
  ansible-lint .
  flake8 library --ignore=E501,E402
platforms:
  - name: mongo1
    image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"
    command: ${MOLECULE_DOCKER_COMMAND:-""}
    volumes:
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
    privileged: true
    pre_build_image: true
    groups:
      - mongo_master
  - name: mongo2
    image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"
    command: ${MOLECULE_DOCKER_COMMAND:-""}
    volumes:
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
    privileged: true
    pre_build_image: true
    groups:
      - mongo_replicas
  - name: mongo3
    image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"
    command: ${MOLECULE_DOCKER_COMMAND:-""}
    volumes:
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
    privileged: true
    pre_build_image: true
    groups:
      - mongo_replicas
provisioner:
  name: ansible
  config_options:
    defaults:
      pipelining: true
  log: true
  playbooks:
    converge: ${MOLECULE_PLAYBOOK:-../default/converge.yml}
    prepare:  ${MOLECULE_PLAYBOOK:-../default/prepare.yml}
  env:
    MONGODB_VERSION: ${MONGODB_VERSION:-4.4}
    MONGODB_PACKAGE: ${MONGODB_PACKAGE:-mongodb-org}
    AUTH_STATE: ${AUTH_STATE:-disabled}
    REPLICASET: ${REPLICASET:-testrs}
  inventory:
    host_vars:
      mongo1:
        ansible_python_interpreter: auto_silent
        mongodb_master: true
        mongodb_replication_params:
          - host_name: "{{ hostvars[inventory_hostname].ansible_default_ipv4.address }}"
      mongo2:
        ansible_python_interpreter: auto_silent
        mongodb_replication_params:
          - host_name: "{{ hostvars[inventory_hostname].ansible_default_ipv4.address }}"
      mongo3:
        ansible_python_interpreter: auto_silent
        mongodb_net_port: 30000
        mongodb_storage_journal_enabled: "{{ mongodb_major_version is version('4.0', '>=') }}"
        mongodb_storage_smallfiles: true
        mongodb_storage_prealloc: false
        mongodb_replication_params:
          - host_name: "{{ hostvars[inventory_hostname].ansible_default_ipv4.address }}"
            host_port: "{{ mongodb_net_port }}"
            host_type: arbiter
verifier:
  name: ansible
