]> git.somenet.org - root/pub/somesible.git/blob - roles/server/mail/milter-dmarc/tasks/main.yml
roles/service/mattermost/defaults
[root/pub/somesible.git] / roles / server / mail / milter-dmarc / 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 opendmarc prereq
9   apt:
10     pkg:
11     - dbconfig-no-thanks
12     state: present
13     policy_rc_d: 101
14   tags: "online"
15   ignore_errors: "{{ignore_online_errors | bool}}"
16
17
18 - name: install opendmarc
19   apt:
20     pkg:
21     - opendmarc
22     state: present
23     policy_rc_d: 101
24   tags: "online"
25   ignore_errors: "{{ignore_online_errors | bool}}"
26
27
28 - name: copy opendmarc defaults
29   copy:
30     src: "{{item}}"
31     dest: "/etc/default/opendmarc"
32     owner: "root"
33     group: "root"
34     mode: 0644
35   with_first_found:
36     - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/opendmarc.defaults"
37     - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/opendmarc.defaults"
38     - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/opendmarc.defaults"
39     - "default/opendmarc.defaults"
40   notify: restart opendmarc.service
41
42
43 - name: copy opendmarc config
44   copy:
45     src: "{{item}}"
46     dest: "/etc/opendmarc.conf"
47     owner: "root"
48     group: "root"
49     mode: 0640
50   with_first_found:
51     - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/opendmarc.conf"
52     - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/opendmarc.conf"
53     - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/opendmarc.conf"
54     - "default/opendmarc.conf"
55   notify: restart opendmarc.service
56
57
58 - name: copy opendmarc.service to /etc/systemd/system/
59   copy:
60     src: "{{item}}"
61     dest: "/etc/systemd/system/opendmarc.service"
62     mode: 0644
63     owner: "root"
64     group: "root"
65   with_first_found:
66     - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/opendmarc.service"
67     - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/opendmarc.service"
68     - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/opendmarc.service"
69     - "default/opendmarc.service"
70
71
72 - name: enable and start opendmarc.service
73   include_role: name="base/systemd/enable-and-start"
74   vars:
75     service_name: opendmarc.service