--- - name: base packages installed package: name: - prometheus - nginx - name: prometheus started and enabled service: name: prometheus state: started enabled: yes - name: prometheus template template: src: prometheus.yml.j2 dest: /etc/prometheus/prometheus.yml notify: restart prometheus tags: prometheus_conf - name: prometheus site template template: src: prometheus_site.j2 dest: /etc/nginx/sites-available/prometheus notify: reload nginx tags: nginx - name: site link file: state: link path: /etc/nginx/sites-enabled/prometheus src: ../sites-available/prometheus notify: reload nginx tags: nginx - name: lxc.yml copy: force: no dest: /etc/prometheus/lxc.yml content: '- targets:'