Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
ansible / community / zabbix / roles / zabbix_agent / tasks / firewall.yml
Size: Mime:
---

- name: "Firewall | Configure IPTables (zabbix_agent_listenport)"
  iptables:
    action: "{{ zabbix_agent_firewall_action }}"
    destination_port: "{{ zabbix_agent_listenport | string }}"
    source: "{{ zabbix_agent_firewall_source | default(omit) }}"
    protocol: tcp
    chain: "{{ zabbix_agent_firewall_chain }}"
    jump: ACCEPT
  become: true
  when:
    - zabbix_agent_firewall_enable | bool

- name: "Firewall | Configure IPTables (zabbix_agent_jmx_listenport)"
  iptables:
    action: "{{ zabbix_agent_firewall_action }}"
    destination_port: "{{ zabbix_agent_listenport | string }}"
    source: "{{ zabbix_agent_firewall_source | default(omit) }}"
    protocol: tcp
    chain: "{{ zabbix_agent_firewall_chain }}"
    jump: ACCEPT
  become: true
  when:
    - zabbix_agent_firewall_enable | bool
    - zabbix_agent_jmx_listenport | bool

- name: "Firewall | Configure firewalld (zabbix_agent_listenport)"
  ansible.posix.firewalld:
    rich_rule: 'rule family="ipv4" source address="{{ zabbix_agent_firewalld_source }}" port protocol="tcp" port="{{ zabbix_agent_listenport }}" accept'
    zone: "{{ zabbix_agent_firewalld_zone }}"
    permanent: true
    state: enabled
  become: true
  when:
    - zabbix_agent_firewalld_enable | bool
  notify:
    - firewalld-reload
  tags: zabbix_agent_firewalld_enable

- name: "Firewall | Configure firewalld (zabbix_agent_jmx_listenport)"
  ansible.posix.firewalld:
    rich_rule: 'rule family="ipv4" source address="{{ zabbix_agent_firewalld_source }}" port protocol="tcp" port="{{ zabbix_agent_jmx_listenport }}" accept'
    zone: "{{ zabbix_agent_firewalld_zone }}"
    permanent: true
    state: enabled
  become: true
  when:
    - zabbix_agent_firewalld_enable | bool
    - zabbix_agent_jmx_listenport | bool
  notify:
    - firewalld-reload
  tags: zabbix_agent_firewalld_enable