- name: Install prometheus node exporter become: yes apt: name: prometheus-node-exporter state: present - name: Start and enable node exporter become: yes systemd: name: prometheus-node-exporter state: started enabled: yes - name: Place reverse proxy conf become: yes template: src: templates/nginx.conf.j2 dest: /etc/nginx/conf.d/{{ node_exporter_domain }}.conf mode: 0600 notify: Check and Reload nginx - name: Install apache2-utils become: yes apt: name: apache2-utils state: present - name: Setup htpasswd file become: yes file: path: "/etc/nginx/.htpasswd" owner: www-data group: www-data mode: 0600 state: touch - name: Set Login credentials become: yes command: cmd: "htpasswd -b /etc/nginx/.htpasswd prometheus {{ prometheus_pass }}" changed_when: False