aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/roles')
-rw-r--r--ansible/roles/prometheus-bird-exporter/handlers/main.yml5
-rw-r--r--ansible/roles/prometheus-bird-exporter/tasks/main.yml18
-rw-r--r--ansible/roles/prometheus-node-exporter/handlers/main.yml5
-rw-r--r--ansible/roles/prometheus-node-exporter/tasks/main.yml18
-rw-r--r--ansible/roles/superusers/tasks/main.yml2
-rw-r--r--ansible/roles/unifi/handlers/main.yml3
-rw-r--r--ansible/roles/unifi/tasks/main.yml23
7 files changed, 47 insertions, 27 deletions
diff --git a/ansible/roles/prometheus-bird-exporter/handlers/main.yml b/ansible/roles/prometheus-bird-exporter/handlers/main.yml
new file mode 100644
index 0000000..f4f9381
--- /dev/null
+++ b/ansible/roles/prometheus-bird-exporter/handlers/main.yml
@@ -0,0 +1,5 @@
+- name: restart
+ become: yes
+ systemd:
+ name: prometheus-bird-exporter
+ state: restarted
diff --git a/ansible/roles/prometheus-bird-exporter/tasks/main.yml b/ansible/roles/prometheus-bird-exporter/tasks/main.yml
new file mode 100644
index 0000000..6d8b999
--- /dev/null
+++ b/ansible/roles/prometheus-bird-exporter/tasks/main.yml
@@ -0,0 +1,18 @@
+- become: yes
+ package:
+ name: "{{ items }}"
+ state: present
+ vars:
+ items:
+ - prometheus-bird-exporter
+- name: /etc/default/prometheus-bird-exporter
+ become: yes
+ copy:
+ dest: /etc/default/prometheus-bird-exporter
+ content: |
+ # Set the command-line arguments to pass to the server.
+ # Due to shell escaping, to pass backslashes for regexes, you need to double
+ # them (\\d for \d). If running under systemd, you need to double them again
+ # (\\\\d to mean \d), and escape newlines too.
+ ARGS="-bird.v2 -format.new"
+ notify: restart
diff --git a/ansible/roles/prometheus-node-exporter/handlers/main.yml b/ansible/roles/prometheus-node-exporter/handlers/main.yml
new file mode 100644
index 0000000..f4f9381
--- /dev/null
+++ b/ansible/roles/prometheus-node-exporter/handlers/main.yml
@@ -0,0 +1,5 @@
+- name: restart
+ become: yes
+ systemd:
+ name: prometheus-bird-exporter
+ state: restarted
diff --git a/ansible/roles/prometheus-node-exporter/tasks/main.yml b/ansible/roles/prometheus-node-exporter/tasks/main.yml
new file mode 100644
index 0000000..e7c6d18
--- /dev/null
+++ b/ansible/roles/prometheus-node-exporter/tasks/main.yml
@@ -0,0 +1,18 @@
+- become: yes
+ package:
+ name: "{{ items }}"
+ state: present
+ vars:
+ items:
+ - prometheus-node-exporter
+- name: /etc/default/prometheus-node-exporter
+ become: yes
+ copy:
+ dest: /etc/default/prometheus-node-exporter
+ content: |
+ # Set the command-line arguments to pass to the server.
+ # Due to shell escaping, to pass backslashes for regexes, you need to double
+ # them (\\d for \d). If running under systemd, you need to double them again
+ # (\\\\d to mean \d), and escape newlines too.
+ ARGS=""
+ notify: restart
diff --git a/ansible/roles/superusers/tasks/main.yml b/ansible/roles/superusers/tasks/main.yml
index c1f5a47..12672ec 100644
--- a/ansible/roles/superusers/tasks/main.yml
+++ b/ansible/roles/superusers/tasks/main.yml
@@ -16,7 +16,7 @@
unix_groups:
- sudo
- systemd-journal
- with_items: "{{ unix_groups }}"
+ with_items: "{{ unix_groups + (['docker'] if 'docker' in getent_group else []) }}"
loop_control:
loop_var: group
include_tasks: adjust-group.yml
diff --git a/ansible/roles/unifi/handlers/main.yml b/ansible/roles/unifi/handlers/main.yml
deleted file mode 100644
index ce78323..0000000
--- a/ansible/roles/unifi/handlers/main.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-- name: update apt cache
- apt:
- update_cache: yes
diff --git a/ansible/roles/unifi/tasks/main.yml b/ansible/roles/unifi/tasks/main.yml
deleted file mode 100644
index 11c4c00..0000000
--- a/ansible/roles/unifi/tasks/main.yml
+++ /dev/null
@@ -1,23 +0,0 @@
----
-- name: Ubiquiti APT key
- notify: update apt cache
- apt_key:
- id: 06E85760C0A52C50
- keyserver: keyserver.ubuntu.com
-
-- name: Ubiquiti APT repository
- notify: update apt cache
- copy:
- dest: /etc/apt/sources.list.d/unifi.list
- content: 'deb http://www.ubnt.com/downloads/unifi/debian stable ubiquiti'
-
-- meta: flush_handlers
-
-- name: packages
- apt:
- name: "{{ items }}"
- install_recommends: no
- vars:
- items:
- - openjdk-8-jre
- - unifi