--- # Install and configure node-exporter - name: Include role for installing node-exporter include_role: name: cloudalchemy.node-exporter public: yes vars: node_exporter_web_listen_address: "0.0.0.0:{{ node_exporter_port }}" - name: Configure Nginx for node-exporter import_role: name: nginx vars: nginx_config_file: node-exporter.conf nginx_server: name: "{{ inventory_hostname }}" port: "{{ node_exporter_public_port }}" locations: - path: "{{ node_exporter_path }}" basic_auth: file: .htpasswd.node-exporter password: "{{ node_exporter_password }}" proxy_pass: port: "{{ node_exporter_port }}" path: /metrics - name: Allow node-exporter port {{ node_exporter_public_port }} ufw: rule: allow port: "{{ node_exporter_public_port }}"