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