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>
7 # Sympa is broken in debian, in that it cannot be installed with dbconfig-no-thanks.
8 # To work around this, we have to first debconf-preseed some config values and deploy the config file before AND after installing the sympa package.
9 # todo: move to sertvices?
11 - name: create /etc/sympa
19 - name: create /etc/sympa/sympa
21 path: "/etc/sympa/sympa"
28 - name: copy sympa.debconf
31 dest: "/etc/sympa/sympa/sympa.debconf"
36 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/sympa.debconf"
37 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/sympa.debconf"
38 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/sympa.debconf"
39 - "default/sympa.debconf"
40 notify: restart sympa.service
43 - name: preseed sympa.debconf
44 shell: 'debconf-set-selections /etc/sympa/sympa/sympa.debconf'
47 - name: copy sympa config
50 dest: "/etc/sympa/sympa/sympa.conf"
55 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/sympa.conf"
56 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/sympa.conf"
57 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/sympa.conf"
58 - "default/sympa.conf"
59 notify: restart sympa.service
69 ignore_errors: "{{ignore_online_errors | bool}}"
73 - name: copy sympa config again
76 dest: "/etc/sympa/sympa/sympa.conf"
81 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/sympa.conf"
82 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/sympa.conf"
83 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/sympa.conf"
84 - "default/sympa.conf"
85 notify: restart sympa.service
89 - name: copy key_dkim.private
92 dest: "/etc/sympa/sympa/key_dkim.private"
97 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/key_dkim.private"
98 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/key_dkim.private"
99 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/key_dkim.private"
100 - "default/key_dkim.private"
101 notify: restart sympa.service
104 - name: copy list_aliases.tt2
107 dest: "/etc/sympa/list_aliases.tt2"
112 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/list_aliases.tt2"
113 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/list_aliases.tt2"
114 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/list_aliases.tt2"
115 - "default/list_aliases.tt2"
116 notify: restart sympa.service
119 - name: include vars_nginx_vhost_custom
122 name: vars_nginx_vhost_custom
124 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/{{sympa_main_host_name}}-vars_nginx_vhost_custom.yml"
125 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/{{sympa_main_host_name}}-vars_nginx_vhost_custom.yml"
126 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/{{sympa_main_host_name}}-vars_nginx_vhost_custom.yml"
127 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/vars_nginx_vhost_custom.yml"
128 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/vars_nginx_vhost_custom.yml"
129 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/vars_nginx_vhost_custom.yml"
130 - "default/vars_nginx_vhost_custom.yml"
133 - name: configure vhost for "{{sympa_main_host_name}}"
135 name: server/nginx/vhost-unified
138 vhost_name: "{{sympa_main_host_name}}"
140 vhost_custom_pre_server: "{{vars_nginx_vhost_custom.vhost_custom_pre_server}}"
141 vhost_custom: "{{vars_nginx_vhost_custom.vhost_custom}}"
144 - name: enable and start sympa.service
145 include_role: name="base/systemd/enable-and-start"
147 service_name: sympa.service
149 - name: enable and start wwsympa.socket
150 include_role: name="base/systemd/enable-and-start"
152 service_name: wwsympa.socket