1 #####################################
2 ### someone's ansible provisioner ###
3 #####################################
4 # Part of: https://git.somenet.org/root/pub/somesible.git
5 # 2017-2026 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 sympa user
14 home: "/var/lib/sympa"
19 - name: create /etc/sympa
27 - name: create /etc/sympa/sympa
29 path: "/etc/sympa/sympa"
36 - name: copy sympa.debconf
39 dest: "/etc/sympa/sympa/sympa.debconf"
44 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/sympa.debconf"
45 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/sympa.debconf"
46 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/sympa.debconf"
47 - "default/sympa.debconf"
48 notify: restart sympa.service
51 - name: preseed sympa.debconf
52 shell: 'debconf-set-selections /etc/sympa/sympa/sympa.debconf'
55 - name: copy sympa config
58 dest: "/etc/sympa/sympa/sympa.conf"
63 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/sympa.conf"
64 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/sympa.conf"
65 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/sympa.conf"
66 - "default/sympa.conf"
67 notify: restart sympa.service
77 ignore_errors: "{{ignore_online_errors | bool}}"
81 - name: copy sympa config again
84 dest: "/etc/sympa/sympa/sympa.conf"
89 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/sympa.conf"
90 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/sympa.conf"
91 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/sympa.conf"
92 - "default/sympa.conf"
93 notify: restart sympa.service
94 when: result is defined and result.changed
97 - name: copy key_dkim.private
100 dest: "/etc/sympa/sympa/key_dkim.private"
105 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/key_dkim.private"
106 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/key_dkim.private"
107 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/key_dkim.private"
108 - "default/key_dkim.private"
109 notify: restart sympa.service
112 - name: copy list_aliases.tt2
115 dest: "/etc/sympa/list_aliases.tt2"
120 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/list_aliases.tt2"
121 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/list_aliases.tt2"
122 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/list_aliases.tt2"
123 - "default/list_aliases.tt2"
124 notify: restart sympa.service
127 - name: include vars_nginx_vhost_custom
130 name: vars_nginx_vhost_custom
132 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/{{sympa_main_host_name}}-vars_nginx_vhost_custom.yml"
133 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/{{sympa_main_host_name}}-vars_nginx_vhost_custom.yml"
134 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/{{sympa_main_host_name}}-vars_nginx_vhost_custom.yml"
135 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/vars_nginx_vhost_custom.yml"
136 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/vars_nginx_vhost_custom.yml"
137 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/vars_nginx_vhost_custom.yml"
138 - "default/vars_nginx_vhost_custom.yml"
141 - name: configure vhost for "{{sympa_main_host_name}}"
143 name: server/nginx/vhost-unified
146 vhost_name: "{{sympa_main_host_name}}"
148 vhost_custom_pre_server: "{{vars_nginx_vhost_custom.vhost_custom_pre_server}}"
149 vhost_custom: "{{vars_nginx_vhost_custom.vhost_custom}}"
152 - name: enable and start sympa.service
153 include_role: name="base/systemd/enable-and-start"
155 service_name: sympa.service
157 - name: enable and start wwsympa.socket
158 include_role: name="base/systemd/enable-and-start"
160 service_name: wwsympa.socket