Browse Source

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

Luke Cyca 11 years ago
parent
commit
f6d74de487

+ 10
- 6
roles/ircbouncer/tasks/znc.yml View File

41
 - name: Ensure znc user and group can read cert
41
 - name: Ensure znc user and group can read cert
42
   file: path=/var/lib/znc/znc.pem group=znc owner=znc
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 View File

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

+ 5
- 0
vars/defaults.yml View File

15
 
15
 
16
 # ircbouncer
16
 # ircbouncer
17
 znc_version: 1.0
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
 # # mailserver
24
 # # mailserver
20
 # mail_server_hostname: mail.TODO.com
25
 # mail_server_hostname: mail.TODO.com

+ 5
- 0
vars/user.yml View File

15
 
15
 
16
 # # ircbouncer
16
 # # ircbouncer
17
 # znc_version: 1.0
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
 # # mailserver
24
 # # mailserver
20
 # mail_server_hostname: mail.TODO.com
25
 # mail_server_hostname: mail.TODO.com

Loading…
Cancel
Save