2022-12-18 22:18:43 -06:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Ensure directory permissions
|
|
|
|
become: yes
|
|
|
|
file:
|
|
|
|
state: directory
|
|
|
|
path: "{{ item }}"
|
|
|
|
owner: ircd
|
|
|
|
group: ircd
|
|
|
|
mode: 0750
|
|
|
|
loop:
|
|
|
|
- "/var/log/inspircd"
|
|
|
|
- "/etc/inspircd"
|
|
|
|
|
2023-01-20 08:49:56 -06:00
|
|
|
- name: Generate dhparam
|
|
|
|
become: yes
|
|
|
|
command:
|
|
|
|
cmd: openssl dhparam -out /etc/inspircd/dhparams.pem 2048
|
|
|
|
creates: /etc/inspircd/dhparams.pem
|
|
|
|
|
|
|
|
- name: Permissions on dhparam
|
|
|
|
become: yes
|
|
|
|
file:
|
|
|
|
state: file
|
|
|
|
path: /etc/inspircd/dhparams.pem
|
|
|
|
owner: ircd
|
|
|
|
group: ircd
|
|
|
|
mode: 0640
|
|
|
|
|
2022-12-18 22:18:43 -06:00
|
|
|
- name: Copy config and fill in attributes
|
|
|
|
register: templatefiles
|
|
|
|
become: yes
|
|
|
|
template:
|
|
|
|
src: "inspircd/{{ item }}.j2"
|
|
|
|
dest: "/etc/inspircd/{{ item }}"
|
|
|
|
owner: ircd
|
|
|
|
group: ircd
|
|
|
|
mode: 0600
|
|
|
|
loop:
|
|
|
|
- inspircd.conf
|
|
|
|
- modules.conf
|
|
|
|
- links.conf
|
|
|
|
- opers.conf
|
|
|
|
- rules.txt
|
|
|
|
- motd.txt
|
|
|
|
|
|
|
|
- name: Copy service file
|
|
|
|
become: yes
|
|
|
|
register: servicesfile
|
|
|
|
copy:
|
|
|
|
src: services/irc.service
|
|
|
|
dest: /usr/lib/systemd/system/irc.service
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
|
|
|
|
- name: Reload services
|
|
|
|
when: servicesfile.changed
|
|
|
|
become: yes
|
|
|
|
systemd:
|
|
|
|
daemon_reload: true
|
|
|
|
|
|
|
|
- name: Ensure service running
|
|
|
|
become: yes
|
|
|
|
service:
|
|
|
|
name: irc
|
|
|
|
state: started
|
|
|
|
enabled: yes
|
|
|
|
|
|
|
|
- name: Reload on config change
|
|
|
|
become: yes
|
|
|
|
when: templatefiles.changed or servicesfile.changed
|
|
|
|
service:
|
|
|
|
name: irc
|
|
|
|
state: reloaded
|