--- - name: create main configuration directories loop: - exporters-available - exporters-enabled file: path: "/etc/prometheus-exporter/{{ item }}" state: directory - name: install nginx vhost vars: nginx_vhost: name: prometheus-exporter content: "{{ lookup('template', 'nginx-vhost.conf.j2') }}" include_role: name: nginx/vhost