---
dependency:
  name: galaxy
driver:
  name: docker
lint:
  name: yamllint
  options:
    config-file: molecule/default/yaml-lint.yml

platforms:
  - name: influxdb
    image: influxdb:1.7-alpine
    command: influxd
    groups:
      - tsdb
    networks:
      - name: telegraf
    environment:
      INFLUXDB_DB: telegraf
  - name: telegraf-centos
    image: milcom/centos7-systemd
    privileged: True
    groups:
      - telegraf
    networks:
      - name: telegraf
  - name: telegraf-debian
    image: minimum2scp/systemd-stretch
    privileged: True
    command: /sbin/init
    groups:
      - telegraf
      - debian
    networks:
      - name: telegraf
  - name: telegraf-ubuntu
    image: solita/ubuntu-systemd:bionic
    privileged: True
    command: /sbin/init
    groups:
      - telegraf
      - debian
    networks:
      - name: telegraf
  - name: telegraf-opensuse
    image: wdijkerman/molecule-systemd-leap
    privileged: True
    command: /sbin/init
    volumes:
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
    groups:
      - telegraf
    networks:
      - name: telegraf

provisioner:
  name: ansible
  lint:
    name: ansible-lint
  inventory:
    group_vars:
      debian:
        telegraf_agent_package_method: online
      all:
        telegraf_agent_package_state: latest
        telegraf_agent_output:
          - type: influxdb
            config:
              - urls = ["http://influxdb:8086"]
              - database = "telegraf"
              - precision = "s"
        telegraf_plugins_extra:
          logparser:
            plugin: logparser
            config:
              - files = ["/var/log/messages"]
              - from_beginning = false
            filter:
              name: grok
              config:
                - patterns = ["invoked oom-killer"]

scenario:
  name: default
verifier:
  name: testinfra
  lint:
    name: flake8
