aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--playbooks/dc0.rgoncalves.se.yml1
-rw-r--r--roles/znc/tasks/main.yml32
-rw-r--r--roles/znc/vars/main.yml8
3 files changed, 41 insertions, 0 deletions
diff --git a/playbooks/dc0.rgoncalves.se.yml b/playbooks/dc0.rgoncalves.se.yml
index ac983c9..53ba6aa 100644
--- a/playbooks/dc0.rgoncalves.se.yml
+++ b/playbooks/dc0.rgoncalves.se.yml
@@ -7,6 +7,7 @@
- hosts: dc0
roles:
+ - { role: znc, tags: "role_znc" }
- { role: website, tags: "role_website" }
- { role: httpd, tags: "role_httpd" }
- { role: acme, tags: "role_acme" }
diff --git a/roles/znc/tasks/main.yml b/roles/znc/tasks/main.yml
new file mode 100644
index 0000000..6161a05
--- /dev/null
+++ b/roles/znc/tasks/main.yml
@@ -0,0 +1,32 @@
+
+# znc ~~ roles/znc/tasks/main.yml
+# Init znc user, daemon and settings
+
+---
+
+- name: ensure znc package is present
+ package: name=znc state=present
+
+- name: ensure znc group exists
+ group:
+ name: "{{ znc_group }}"
+ state: present
+
+- name: ensure znc user exists
+ user:
+ name: "{{ znc_user }}"
+ group: "{{ znc_group }}"
+ system: true
+ create_home: false
+
+- name: generate and enable znc daemon
+ include_role: name=rc
+ vars:
+ rc_cmd: /usr/local/bin/znc
+ rc_args: ""
+ rc_name: znc
+ rc_user: "{{ znc_user }}"
+
+- name: show hints for generating configuration
+ debug:
+ msg: Please generate the znc configuration with `znc --makeconf` as user "{{ znc_user }}"
diff --git a/roles/znc/vars/main.yml b/roles/znc/vars/main.yml
new file mode 100644
index 0000000..dc43ede
--- /dev/null
+++ b/roles/znc/vars/main.yml
@@ -0,0 +1,8 @@
+
+# znc ~~ roles/znc/tasks/vars.yml
+# default vars for znc role
+
+---
+
+znc_user: "znc"
+znc_group: "znc"
remember that computers suck.