Ansible roles by Evolix
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

86 lines
1.4 KiB

---
- name: install OpenDKIM
apt:
name:
- opendkim
- opendkim-tools
- ssl-cert
- dns-root-data
state: present
tags:
- opendkim
- name: Add user opendkim in ssl-cert group
user:
name: opendkim
groups: ssl-cert
state: present
append: yes
tags:
- opendkim
- name: add 127.0.0.1 to TrustedHosts
lineinfile:
dest: '/etc/opendkim/TrustedHosts'
line: '127.0.0.1'
create: True
owner: opendkim
group: opendkim
mode: "0640"
notify: reload opendkim
tags:
- opendkim
- name: create config files
file:
name: "/etc/opendkim/{{ item }}"
state: touch
owner: opendkim
group: opendkim
mode: "0640"
with_items:
- 'KeyTable'
- 'SigningTable'
changed_when: False
tags:
- opendkim
- name: copy OpenDKIM config
copy:
src: opendkim.conf
dest: /etc/opendkim.conf
mode: "0644"
force: yes
notify: restart opendkim
tags:
- opendkim
- name: Set folder permissions to 0750
file:
path: "/etc/opendkim/"
owner: opendkim
group: opendkim
mode: "0750"
force: yes
tags:
- opendkim
- name: ensure opendkim is started and enabled
systemd:
name: opendkim
state: started
enabled: True
tags:
- opendkim
- include_role:
name: evolix/remount-usr
- name: deploy opendkim-add.sh script
copy:
src: opendkim-add.sh
dest: /usr/share/scripts/opendkim-add.sh
mode: "0750"
tags:
- opendkim