---
- name: Install nginx
  hosts: vm-web
  roles:
    - zabbix-agent2
    - firewall
    - chrony
  vars:
###### Zabbix agent configuration ######
    agent_major_version: "7.0"
    agent_variant: "2"
    agent_package_state: present # present or latest
    agent_param_server: ::/0
    agent_param_listenport: 10050
    # agent_2_plugin_list: ['named'] # set in inventory vars
    agent_param_tlsconnect: unencrypted
    agent_param_tlsaccept:
      - unencrypted
    agent_apply_firewalld_rule: auto # force or auto

###### Firewalld configuration ######
    firewall:
      - previous: replaced
      - zone: internal
        state: enabled
        permanent: true
        service:
          - ssh
          - zabbix-agent
          - ntp
          - http

      - 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
    chrony_log_enable: true
    chrony_log: measurements statistics tracking
    chrony_logdir: /var/log/chrony/
    chrony_ntp_servers:
      - 10.203.2.11
      - 10.203.2.12
    chrony_rtcsync: true
    chrony_timezone: Europe/Moscow
