diff options
-rw-r--r-- | playbooks/site.yml | 2 | ||||
-rw-r--r-- | roles/znc/defaults/main.yml | 2 | ||||
-rw-r--r-- | roles/znc/tasks/main.yml | 30 |
3 files changed, 34 insertions, 0 deletions
diff --git a/playbooks/site.yml b/playbooks/site.yml index 147db6b..ac4417b 100644 --- a/playbooks/site.yml +++ b/playbooks/site.yml @@ -20,6 +20,8 @@ tags: role_relayd - role: acme tags: role_acme + - role: znc + tags: role_znc - hosts: stack0 roles: diff --git a/roles/znc/defaults/main.yml b/roles/znc/defaults/main.yml new file mode 100644 index 0000000..879ed75 --- /dev/null +++ b/roles/znc/defaults/main.yml @@ -0,0 +1,2 @@ +znc_user: _znc +znc_group: _znc diff --git a/roles/znc/tasks/main.yml b/roles/znc/tasks/main.yml new file mode 100644 index 0000000..a1ccf3d --- /dev/null +++ b/roles/znc/tasks/main.yml @@ -0,0 +1,30 @@ +- name: install znc + package: + name: znc + state: present + +- name: create znc group + group: + name: "{{ znc_group }}" + state: present + +- name: create znc user + user: + name: "{{ znc_user }}" + group: "{{ znc_group }}" + system: true + create_home: true + +- name: generate and enable znc service + include_role: + name: rc + vars: + rc_cmd: /usr/local/bin/znc + rc_user: "{{ znc_user }}" + rc_name: znc + +- name: enable and start znc + service: + name: znc + state: restarted + enabled: true |