]> git.somenet.org - root/pub/somesible.git/blob - roles/server/ircd/tasks/main.yml
roles/service/nextcloud/defaults
[root/pub/somesible.git] / roles / server / ircd / tasks / main.yml
1 #####################################
2 ### someone"s ansible provisioner ###
3 #####################################
4 # Part of: https://git.somenet.org/root/pub/somesible.git
5 # 2017-2024 by someone <someone@somenet.org>
6 #
7 ---
8 - name: install inspircd
9   apt:
10     pkg:
11     - inspircd
12     state: present
13     policy_rc_d: 101
14   tags: "online"
15   ignore_errors: "{{ignore_online_errors | bool}}"
16
17
18 - name: create inspircd user's homedir
19   file:
20     path: "/var/lib/inspircd"
21     state: directory
22     mode: 0710
23     owner: "irc"
24     group: "irc"
25
26
27 - name: add irc user to group ssl-cert,letsencrypt
28   user:
29     name: "cyrus"
30     groups: "ssl-cert,letsencrypt"
31     append: yes
32     createhome: no
33     state: present
34
35
36 - name: create inspircd config dir
37   file:
38     path: "/etc/inspircd"
39     state: directory
40     mode: 0750
41     owner: "irc"
42     group: "irc"
43
44
45 - name: copy irc server config files
46   copy:
47     src:  "{{item.src}}"
48     dest: "/etc/inspircd/{{item.path}}"
49     mode: 0640
50     owner: "irc"
51     group: "irc"
52   with_filetree:
53     - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/inspircd/"
54     - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/inspircd/"
55     - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/inspircd/"
56     - "default/inspircd/"
57   when: item.state == "file"
58   notify: reload inspircd.service
59
60
61 - name: copy inspircd.service to /etc/systemd/system/
62   copy:
63     src: "{{item}}"
64     dest: "/etc/systemd/system/inspircd.service"
65     mode: 0644
66     owner: "root"
67     group: "root"
68   with_first_found:
69     - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/inspircd.service"
70     - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/inspircd.service"
71     - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/inspircd.service"
72     - "default/inspircd.service"
73   notify: restart inspircd.service
74
75
76 - name: enable and start inspircd.service
77   include_role: name="base/systemd/enable-and-start"
78   vars:
79     service_name: inspircd.service