From 9ac0280a31aef23232f7e459f459cde2a9005a63 Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Sat, 28 Jan 2023 00:55:00 +0200 Subject: [PATCH] change order --- ...onfigure_prometheus_exporters_external.yml | 66 +++++++++++-------- 1 file changed, 38 insertions(+), 28 deletions(-) diff --git a/tasks/configure_prometheus_exporters_external.yml b/tasks/configure_prometheus_exporters_external.yml index 65f7999..4584e76 100644 --- a/tasks/configure_prometheus_exporters_external.yml +++ b/tasks/configure_prometheus_exporters_external.yml @@ -19,39 +19,13 @@ path: "/var/www/node-metrics-{{ ansible_fqdn }}/" state: directory owner: www-data + - name: Ensure the document root exists postfixnode exporter file: path: "/var/www/postfix-metrics-{{ ansible_fqdn }}/" state: directory owner: www-data -- name: Enable the Apache2 SSL module - community.general.apache2_module: - state: present - name: ssl -- name: Enable the Apache2 rewrite module - community.general.apache2_module: - state: present - name: rewrite -- name: Enable the Apache2 authnz_external module - community.general.apache2_module: - state: present - name: authnz_external -- name: Enable the Apache2 proxy module - community.general.apache2_module: - state: present - name: proxy -- name: Enable the Apache2 proxy_http module - community.general.apache2_module: - state: present - name: proxy_http -- name: Enable the Apache2 proxy_wstunnel module - community.general.apache2_module: - state: present - name: proxy_wstunnel -- name: Enable the Apache2 authnz_external module - community.general.apache2_module: - state: present - name: authnz_external + # Add DNS entries in OVH - name: Check if certificates exist @@ -68,11 +42,47 @@ include_tasks: configure_prometheus_exporters_certificates.yml when: not node_certificate.stat.exists or not postfix_certificate.stat.exists +- name: Enable the Apache2 SSL module + community.general.apache2_module: + state: present + name: ssl + +- name: Enable the Apache2 rewrite module + community.general.apache2_module: + state: present + name: rewrite + +- name: Enable the Apache2 authnz_external module + community.general.apache2_module: + state: present + name: authnz_external + +- name: Enable the Apache2 proxy module + community.general.apache2_module: + state: present + name: proxy + +- name: Enable the Apache2 proxy_http module + community.general.apache2_module: + state: present + name: proxy_http + +- name: Enable the Apache2 proxy_wstunnel module + community.general.apache2_module: + state: present + name: proxy_wstunnel + +- name: Enable the Apache2 authnz_external module + community.general.apache2_module: + state: present + name: authnz_external + - name: Ensure virtual hosts configuration is deployed template: src: templates/apache2.conf.j2 dest: /etc/apache2/sites-available/25-metrics-exporters.conf backup: yes + - name: Ensure virtual hosts configuration is enabled file: dest: /etc/apache2/sites-enabled/25-metrics-exporters.conf