- hosts: "{{ variable_host }}"
  become: yes
  become_method: sudo
  tasks:
  - name: Set SSH port
    set_fact:
      ansible_port: "{{SSH_PORT}}"

  - name: Open stat port for iptables
    iptables:
      chain: INPUT
      destination_port: "9101"
      jump: ACCEPT
      protocol: tcp
    ignore_errors: yes
      
      
  roles:
  - role: haproxy_exporter
    vars:
      haproxy_exporter_options: ['--haproxy.scrape-uri=http://{{STATS_USER}}:{{STATS_PASS}}@{{variable_host}}:{{STAT_PORT}}/{{STAT_PAGE}};csv']
