浏览代码

Use packaged ZNC

Alex Payne 9 年前
父节点
当前提交
123dc51517
共有 2 个文件被更改,包括 8 次插入42 次删除
  1. 7
    41
      roles/ircbouncer/tasks/znc.yml
  2. 1
    1
      roles/ircbouncer/templates/usr_lib_znc_configs_znc.conf.j2

+ 7
- 41
roles/ircbouncer/tasks/znc.yml 查看文件

1
 # more or less as per http://wiki.znc.in/Running_ZNC_as_a_system_daemon
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
   apt: pkg={{ item }} state=installed
4
   apt: pkg={{ item }} state=installed
5
   with_items:
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
 - name: Create a combined version of the private key with public cert and intermediate + root CAs
8
 - name: Create a combined version of the private key with public cert and intermediate + root CAs
43
   shell: cat /etc/ssl/private/wildcard_private.key /etc/ssl/certs/wildcard_combined.pem >
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
   notify: restart znc
11
   notify: restart znc
46
 
12
 
47
 - name: Ensure znc user and group can read cert
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
   notify: restart znc
15
   notify: restart znc
50
 
16
 
51
 - name: Check for existing config file
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
   register: znc_config
19
   register: znc_config
54
   ignore_errors: True
20
   ignore_errors: True
55
   changed_when: False  # never report as "changed"
21
   changed_when: False  # never report as "changed"
56
 
22
 
57
 - name: Create znc config directory
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
 - name: Copy znc configuration file into place
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
   when: znc_config.rc != 0
28
   when: znc_config.rc != 0
63
   notify: restart znc
29
   notify: restart znc
64
 
30
 

roles/ircbouncer/templates/var_lib_znc_configs_znc.conf.j2 → roles/ircbouncer/templates/usr_lib_znc_configs_znc.conf.j2 查看文件

16
 Motd = Connected to ZNC
16
 Motd = Connected to ZNC
17
 PidFile = /var/run/znc/znc.pid
17
 PidFile = /var/run/znc/znc.pid
18
 ProtectWebSessions = true
18
 ProtectWebSessions = true
19
-SSLCertFile = /var/lib/znc/znc.pem
19
+SSLCertFile = /usr/lib/znc/znc.pem
20
 ServerThrottle = 30
20
 ServerThrottle = 30
21
 Skin = _default_
21
 Skin = _default_
22
 StatusPrefix = *
22
 StatusPrefix = *

正在加载...
取消
保存