---
- name: Install zabbix
  hosts:
    - vm-zabbix
#    - vm-zabbix-db
  roles:
    - firewall
    - chrony
    - zabbix-agent2
  vars:
    firewall:
#      - previous: replaced          # flush previous rules

      - zone: internal
        state: enabled
        permanent: true
        service:
          - ssh
          - zabbix-agent
          - ntp
          - dns
          - http
          - https
        port:
          - '10050/tcp'
          - '8080/tcp'
          - '3000/tcp'
        source:
          - 10.200.0.0/16
          - 10.202.0.0/16
          - 10.203.0.0/16
          - 91.218.87.192/26

      - zone: internal
        state: disabled
        permanent: true
        service:
          - cockpit
          - dhcpv6-client
          - mdns
          - samba-client

      - set_default_zone: internal
        state: enabled
        permanent: true

      - interface: ens192
        zone: internal
        state: enabled
        permanent: true

###### chrony-client ######
    chrony_disable_ntpd: true
    chrony_enable: true
# Moved to inventory vars
    agent_package_state: present
    agent_param_server:
      - 127.0.0.1
    agent_param_serveractive:
      - 127.0.0.1
