Преглед на файлове

Provide a good initial config for znc (but leave it alone after that)

Luke Cyca преди 11 години
родител
ревизия
f6d74de487
променени са 4 файла, в които са добавени 30 реда и са изтрити 17 реда
  1. 10
    6
      roles/ircbouncer/tasks/znc.yml
  2. 10
    11
      roles/ircbouncer/templates/var_lib_znc_configs_znc.conf.j2
  3. 5
    0
      vars/defaults.yml
  4. 5
    0
      vars/user.yml

+ 10
- 6
roles/ircbouncer/tasks/znc.yml Целия файл

@@ -41,11 +41,15 @@
41 41
 - name: Ensure znc user and group can read cert
42 42
   file: path=/var/lib/znc/znc.pem group=znc owner=znc
43 43
 
44
-# NOTE: you should probably just generate this using the directions above and then edit via the web panel
45
-#- name: Copy znc configuration file into place
46
-#  template: src=var_lib_znc_configs_znc.conf.j2 dest=/var/lib/znc/configs/znc.conf owner=znc group=znc
44
+- name: Check for existing config file
45
+  command: cat /var/lib/znc/configs/znc.conf
46
+  register: znc_config
47
+  ignore_errors: True
48
+  changed_when: False  # never report as "changed"
47 49
 
48
-- name: Ensure znc is a system service
49
-  command: update-rc.d znc defaults
50
-  notify: restart znc
50
+- name: Copy znc configuration file into place
51
+  template: src=var_lib_znc_configs_znc.conf.j2 dest=/var/lib/znc/configs/znc.conf owner=znc group=znc
52
+  when: znc_config.rc != 0
51 53
 
54
+- name: Ensure znc is a system service
55
+  service: name=znc state=started enabled=true

+ 10
- 11
roles/ircbouncer/templates/var_lib_znc_configs_znc.conf.j2 Целия файл

@@ -11,9 +11,12 @@ ConnectDelay = 5
11 11
 LoadModule = webadmin
12 12
 LoadModule = fail2ban
13 13
 LoadModule = lastseen
14
+LoadModule = partyline
14 15
 MaxBufferSize = 500
16
+Motd = Connected to ZNC
15 17
 PidFile = /var/run/znc/znc.pid
16 18
 ProtectWebSessions = true
19
+SSLCertFile = /var/lib/znc/znc.pem
17 20
 ServerThrottle = 30
18 21
 Skin = _default_
19 22
 StatusPrefix = *
@@ -28,17 +31,17 @@ Version = 1.0
28 31
 	SSL = true
29 32
 </Listener>
30 33
 
31
-<User TODO>
34
+<User {{ irc_nick }}>
32 35
 	Admin = true
33 36
 	Allow = *
34
-	AltNick = TODO_
37
+	AltNick = {{ irc_nick }}_
35 38
 	AppendTimestamp = false
36 39
 	AutoClearChanBuffer = true
37 40
 	Buffer = 5000
38 41
 	ChanModes = +stn
39 42
 	DenyLoadMod = false
40 43
 	DenySetBindHost = false
41
-	Ident = TODO
44
+	Ident = {{ irc_ident }}
42 45
 	JoinTries = 10
43 46
 	LoadModule = controlpanel
44 47
 	LoadModule = perform
@@ -46,10 +49,10 @@ Version = 1.0
46 49
 	LoadModule = clientnotify
47 50
 	MaxNetworks = 1
48 51
 	MultiClients = true
49
-	Nick = TODO
52
+	Nick = {{ irc_nick }}
50 53
 	PrependTimestamp = true
51
-	QuitMsg = TODO
52
-	RealName = TODO
54
+	QuitMsg = {{ irc_quitmsg }}
55
+	RealName = {{ irc_realname }}
53 56
 	TimestampFormat = [%H:%M:%S]
54 57
 
55 58
 	<Network freenode>
@@ -62,9 +65,5 @@ Version = 1.0
62 65
 		Server = chat.freenode.net 6665
63 66
 	</Network>
64 67
 
65
-	<Pass password>
66
-		Hash = TODO
67
-		Method = SHA256
68
-		Salt = TODO
69
-	</Pass>
68
+	Pass = {{ irc_password_hash }}
70 69
 </User>

+ 5
- 0
vars/defaults.yml Целия файл

@@ -15,6 +15,11 @@
15 15
 
16 16
 # ircbouncer
17 17
 znc_version: 1.0
18
+# irc_nick: TODO
19
+# irc_ident: TODO
20
+# irc_realname: TODO
21
+# irc_quitmsg: TODO
22
+# irc_password_hash: TODO
18 23
 
19 24
 # # mailserver
20 25
 # mail_server_hostname: mail.TODO.com

+ 5
- 0
vars/user.yml Целия файл

@@ -15,6 +15,11 @@
15 15
 
16 16
 # # ircbouncer
17 17
 # znc_version: 1.0
18
+# irc_nick: TODO
19
+# irc_ident: TODO
20
+# irc_realname: TODO
21
+# irc_quitmsg: TODO
22
+# irc_password_hash: TODO
18 23
 
19 24
 # # mailserver
20 25
 # mail_server_hostname: mail.TODO.com

Loading…
Отказ
Запис