ansible/roles/shell/tasks/znc.yml

67 lines
1.3 KiB
YAML
Raw Normal View History

# Configure znc
2019-02-04 13:58:54 +00:00
---
- name: Create home dirs for znc
file:
2020-12-27 19:13:19 +00:00
path: /var/lib/znc
2019-02-04 13:58:54 +00:00
state: directory
owner: znc
group: root
mode: 0771
2019-02-04 13:58:54 +00:00
- name: Create znc run dir
file:
path: /var/run/znc
state: directory
owner: znc
group: root
2019-02-04 14:15:40 +00:00
mode: 0770
2019-02-04 13:58:54 +00:00
- name: Install znc target
2019-02-04 13:58:54 +00:00
copy:
dest: /etc/systemd/system/znc.service
content: |
[Install]
WantedBy=multi-user.target
[Unit]
Description=ZNC, an advanced IRC bouncer
After=network-online.target
[Service]
2020-12-27 19:13:19 +00:00
ExecStart=/usr/bin/znc -f --datadir=/var/lib/znc
2019-02-04 13:58:54 +00:00
ExecReload=/bin/kill -HUP $MAINPID
User=znc
[Install]
WantedBy=multi-user.target
2019-03-15 22:21:51 +00:00
- name: Install LE hook
copy:
src: ../files/etc/letsencrypt/renewal-hooks/deploy/update-znc.pem
dest: /etc/letsencrypt/renewal-hooks/deploy/update-znc.pem
2019-03-15 22:21:51 +00:00
owner: root
group: root
2020-09-18 11:29:57 +00:00
mode: 0755
2021-06-16 14:20:08 +00:00
- name: Insert/update configuration
blockinfile:
dest: /etc/oidentd.conf
content: |
# ZNC reply with the name of the user that initiated the connection.
user "znc"
{
2021-06-16 14:30:03 +00:00
default
2021-06-16 14:50:01 +00:00
{
allow spoof
allow spoof_all
}
2021-06-16 14:20:08 +00:00
}
2021-09-18 14:45:20 +00:00
- name: Rewrite znc.conf
copy:
src: ../files/etc/cron.hourly/znc_saveconfig.sh
dest: /etc/cron.hourly/znc_saveconfig.sh
owner: root
group: znc
mode: 0754