ansible/roles/shell/tasks/znc.yml

67 lines
1.3 KiB
YAML

# Configure znc
---
- name: Create home dirs for znc
file:
path: /var/lib/znc
state: directory
owner: znc
group: root
mode: 0771
- name: Create znc run dir
file:
path: /var/run/znc
state: directory
owner: znc
group: root
mode: 0770
- name: Install znc target
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]
ExecStart=/usr/bin/znc -f --datadir=/var/lib/znc
ExecReload=/bin/kill -HUP $MAINPID
User=znc
[Install]
WantedBy=multi-user.target
- name: Install LE hook
copy:
src: ../files/etc/letsencrypt/renewal-hooks/deploy/update-znc.pem
dest: /etc/letsencrypt/renewal-hooks/deploy/update-znc.pem
owner: root
group: root
mode: 0755
- name: Insert/update configuration
blockinfile:
dest: /etc/oidentd.conf
content: |
# ZNC reply with the name of the user that initiated the connection.
user "znc"
{
default
{
allow spoof
allow spoof_all
}
}
- 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