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
|
|
|
|
|
2023-05-02 17:32:11 -05:00
|
|
|
- name: Add ircd user to ssl
|
|
|
|
become: yes
|
|
|
|
user:
|
|
|
|
name: ircd
|
|
|
|
groups: ssl
|
|
|
|
append: yes
|
|
|
|
|
2023-03-22 17:44:57 -05:00
|
|
|
- name: Copy service file
|
|
|
|
become: yes
|
|
|
|
register: servicesfile
|
|
|
|
copy:
|
2024-07-23 14:18:32 -05:00
|
|
|
src: services/inspircd.service
|
|
|
|
dest: /usr/lib/systemd/system/inspircd.service
|
2023-03-22 17:44:57 -05:00
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
|
|
|
|
- name: Reload services
|
|
|
|
when: servicesfile.changed
|
|
|
|
become: yes
|
|
|
|
systemd:
|
|
|
|
daemon_reload: true
|
|
|
|
|
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
|
|
|
|
|
2023-03-22 17:44:57 -05:00
|
|
|
- name: Tracking directory
|
2022-12-18 22:18:43 -06:00
|
|
|
become: yes
|
2023-03-22 17:44:57 -05:00
|
|
|
file:
|
|
|
|
dest: "/etc/inspircd/data/"
|
|
|
|
owner: ircd
|
|
|
|
group: ircd
|
|
|
|
mode: 0750
|
|
|
|
state: directory
|
2022-12-18 22:18:43 -06:00
|
|
|
|
2023-03-22 17:44:57 -05:00
|
|
|
- name: Ensure tracking files
|
2022-12-18 22:18:43 -06:00
|
|
|
become: yes
|
2023-03-22 17:44:57 -05:00
|
|
|
file:
|
|
|
|
dest: "/etc/inspircd/{{ item }}"
|
|
|
|
owner: ircd
|
|
|
|
group: ircd
|
|
|
|
mode: 0600
|
|
|
|
loop:
|
|
|
|
- 'data/xline.db'
|
|
|
|
- 'data/permchannels.conf'
|
2022-12-18 22:18:43 -06:00
|
|
|
|
|
|
|
- name: Ensure service running
|
|
|
|
become: yes
|
|
|
|
service:
|
2024-07-23 14:18:32 -05:00
|
|
|
name: inspircd
|
2022-12-18 22:18:43 -06:00
|
|
|
state: started
|
|
|
|
enabled: yes
|
|
|
|
|
|
|
|
- name: Reload on config change
|
|
|
|
become: yes
|
|
|
|
when: templatefiles.changed or servicesfile.changed
|
|
|
|
service:
|
2024-07-23 14:18:32 -05:00
|
|
|
name: inspircd
|
2022-12-18 22:18:43 -06:00
|
|
|
state: reloaded
|