From 476746f999b5e01c2d33b97b5ed96dc3eed7a007 Mon Sep 17 00:00:00 2001 From: HgO Date: Mon, 13 Apr 2020 15:27:39 +0200 Subject: [PATCH] bugfixes --- playbooks/monitoring.yml | 2 ++ roles/common/tasks/nginx.yml | 3 ++- roles/common/tasks/repos.yml | 2 +- roles/monitoring/tasks/alertmanager.yml | 4 ++-- roles/monitoring/tasks/prometheus.yml | 6 +++--- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/playbooks/monitoring.yml b/playbooks/monitoring.yml index b003b0e..689b14c 100644 --- a/playbooks/monitoring.yml +++ b/playbooks/monitoring.yml @@ -1,4 +1,6 @@ - hosts: monitoring + become: yes + roles: - common - monitoring diff --git a/roles/common/tasks/nginx.yml b/roles/common/tasks/nginx.yml index 750f72d..98bf3c3 100644 --- a/roles/common/tasks/nginx.yml +++ b/roles/common/tasks/nginx.yml @@ -71,10 +71,11 @@ - name: Enable default Nginx config file: src: /etc/nginx/sites-available/default - dest: /etc/nginx/sites-enabled/default + path: /etc/nginx/sites-enabled/default owner: root group: www-data mode: "755" + state: link notify: reload nginx - name: Allow default Nginx ports diff --git a/roles/common/tasks/repos.yml b/roles/common/tasks/repos.yml index 42ad9c1..d9f987f 100644 --- a/roles/common/tasks/repos.yml +++ b/roles/common/tasks/repos.yml @@ -6,7 +6,7 @@ update_cache: yes cache_valid_time: "3600" -- name: Install unattend-upgrades for automatic upgrades +- name: Install unattended-upgrades for automatic upgrades apt: name: unattended-upgrades state: present \ No newline at end of file diff --git a/roles/monitoring/tasks/alertmanager.yml b/roles/monitoring/tasks/alertmanager.yml index fa594d3..7a4a463 100644 --- a/roles/monitoring/tasks/alertmanager.yml +++ b/roles/monitoring/tasks/alertmanager.yml @@ -1,5 +1,5 @@ - name: Install Alertmanager - import_role: + include_role: name: cloudalchemy.alertmanager public: yes vars: @@ -9,7 +9,7 @@ alertmanager_web_listen_address: "0.0.0.0:{{ alertmanager_port }}" - name: Configure Nginx for Alertmaneger - import_role: + import_role: name: nginx vars: nginx_config_file: "{{ inventory_hostname }}.d/alertmanager.conf" diff --git a/roles/monitoring/tasks/prometheus.yml b/roles/monitoring/tasks/prometheus.yml index bff20d8..9e37128 100644 --- a/roles/monitoring/tasks/prometheus.yml +++ b/roles/monitoring/tasks/prometheus.yml @@ -1,5 +1,5 @@ - name: Install Prometheus - import_role: + include_role: name: cloudalchemy.prometheus public: yes vars: @@ -11,7 +11,7 @@ prometheus_web_listen_address: "0.0.0.0:{{ prometheus_port }}" - name: Configure Nginx for Prometheus - import_role: + import_role: name: nginx vars: nginx_config_file: "{{ inventory_hostname }}.d/prometheus.conf" @@ -23,4 +23,4 @@ password: "{{ prometheus_password }}" proxy_pass: port: "{{ prometheus_port }}" - path: / + path: / \ No newline at end of file