From bd07a58f411e0519d88c93c626a54a3a81e91d85 Mon Sep 17 00:00:00 2001
From: binary <me@rgoncalves.se>
Date: Fri, 26 Feb 2021 18:05:34 +0100
Subject: Add znc role for domain controller

---
 roles/znc/tasks/main.yml | 32 ++++++++++++++++++++++++++++++++
 roles/znc/vars/main.yml  |  8 ++++++++
 2 files changed, 40 insertions(+)
 create mode 100644 roles/znc/tasks/main.yml
 create mode 100644 roles/znc/vars/main.yml

(limited to 'roles')

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"
-- 
cgit v1.2.3