|
@@ -1,64 +1,30 @@
|
1
|
1
|
# more or less as per http://wiki.znc.in/Running_ZNC_as_a_system_daemon
|
2
|
2
|
|
3
|
|
-- name: Install znc dependencies
|
|
3
|
+- name: Install znc
|
4
|
4
|
apt: pkg={{ item }} state=installed
|
5
|
5
|
with_items:
|
6
|
|
- - automake
|
7
|
|
- - build-essential
|
8
|
|
- - checkinstall
|
9
|
|
- - g++
|
10
|
|
- - libperl-dev
|
11
|
|
- - libsasl2-dev
|
12
|
|
- - libssl-dev
|
13
|
|
- - libtool
|
14
|
|
- - openssl
|
15
|
|
- - pkg-config
|
16
|
|
- - python3-dev
|
17
|
|
- - swig
|
18
|
|
- tags:
|
19
|
|
- - dependencies
|
20
|
|
-
|
21
|
|
-- name: Download znc release
|
22
|
|
- get_url: url=http://znc.in/releases/archive/znc-{{ znc_version }}.tar.gz dest=/root/znc-{{ znc_version }}.tar.gz
|
23
|
|
-
|
24
|
|
-- name: Decompress znc source
|
25
|
|
- unarchive: src=/root/znc-{{ znc_version }}.tar.gz
|
26
|
|
- dest=/root copy=no
|
27
|
|
- creates=/root/znc-{{ znc_version }}/configure
|
28
|
|
-
|
29
|
|
-- name: Build and install znc
|
30
|
|
- shell: ./configure --enable-python && make && make install executable=/bin/bash chdir=/root/znc-{{ znc_version }} creates=/usr/local/bin/znc
|
31
|
|
- notify: restart znc
|
32
|
|
-
|
33
|
|
-- name: Create znc group
|
34
|
|
- group: name=znc state=present
|
35
|
|
-
|
36
|
|
-- name: Create znc user
|
37
|
|
- user: name=znc state=present home=/var/lib/znc system=yes group=znc shell=/usr/sbin/nologin
|
38
|
|
-
|
39
|
|
-- name: Copy znc init file into place
|
40
|
|
- copy: src=etc_init.d_znc dest=/etc/init.d/znc mode=0755
|
|
6
|
+ - znc
|
41
|
7
|
|
42
|
8
|
- name: Create a combined version of the private key with public cert and intermediate + root CAs
|
43
|
9
|
shell: cat /etc/ssl/private/wildcard_private.key /etc/ssl/certs/wildcard_combined.pem >
|
44
|
|
- /var/lib/znc/znc.pem creates=/var/lib/znc/znc.pem
|
|
10
|
+ /usr/lib/znc/znc.pem creates=/usr/lib/znc/znc.pem
|
45
|
11
|
notify: restart znc
|
46
|
12
|
|
47
|
13
|
- name: Ensure znc user and group can read cert
|
48
|
|
- file: path=/var/lib/znc/znc.pem group=znc owner=znc mode=640
|
|
14
|
+ file: path=/usr/lib/znc/znc.pem group=znc owner=znc mode=640
|
49
|
15
|
notify: restart znc
|
50
|
16
|
|
51
|
17
|
- name: Check for existing config file
|
52
|
|
- command: cat /var/lib/znc/configs/znc.conf
|
|
18
|
+ command: cat /usr/lib/znc/configs/znc.conf
|
53
|
19
|
register: znc_config
|
54
|
20
|
ignore_errors: True
|
55
|
21
|
changed_when: False # never report as "changed"
|
56
|
22
|
|
57
|
23
|
- name: Create znc config directory
|
58
|
|
- file: state=directory path=/var/lib/znc/configs group=znc owner=znc
|
|
24
|
+ file: state=directory path=/usr/lib/znc/configs group=znc owner=znc
|
59
|
25
|
|
60
|
26
|
- name: Copy znc configuration file into place
|
61
|
|
- template: src=var_lib_znc_configs_znc.conf.j2 dest=/var/lib/znc/configs/znc.conf owner=znc group=znc
|
|
27
|
+ template: src=usr_lib_znc_configs_znc.conf.j2 dest=/usr/lib/znc/configs/znc.conf owner=znc group=znc
|
62
|
28
|
when: znc_config.rc != 0
|
63
|
29
|
notify: restart znc
|
64
|
30
|
|