2024-04-20 12:17:10 +02:00
|
|
|
- name: "(Re)Create {{ project_dir }} project directory"
|
|
|
|
file:
|
|
|
|
path: "{{ project_dir }}"
|
|
|
|
state: "{{ item }}"
|
|
|
|
loop:
|
|
|
|
- absent
|
|
|
|
- directory
|
|
|
|
|
2024-05-02 22:49:00 +02:00
|
|
|
- name: Template docker-compose.yaml & config.toml to project directory
|
2024-04-20 12:17:10 +02:00
|
|
|
template:
|
2024-05-02 22:49:00 +02:00
|
|
|
src: "{{ item }}"
|
|
|
|
dest: "{{ project_dir }}/{{ item }}"
|
2024-04-20 12:17:10 +02:00
|
|
|
owner: "{{ host_uid }}"
|
|
|
|
group: "{{ users['mailserver'] + uid_shift }}"
|
2024-05-02 22:49:00 +02:00
|
|
|
mode: '660'
|
|
|
|
loop:
|
|
|
|
- docker-compose.yaml
|
|
|
|
- config.toml
|
2024-04-20 12:17:10 +02:00
|
|
|
become: true
|
|
|
|
|
|
|
|
- name: Set limited permissions on certificate directories
|
|
|
|
file:
|
|
|
|
path: "/etc/{{ item }}"
|
|
|
|
state: directory
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: '751'
|
|
|
|
become: true
|
|
|
|
loop:
|
|
|
|
- letsencrypt
|
|
|
|
- letsencrypt/live
|
|
|
|
- letsencrypt/archive
|
|
|
|
|
|
|
|
- name: Set limited permissions on certificate directories
|
|
|
|
file:
|
|
|
|
path: "/etc/letsencrypt/{{ item }}/mail.{{ domain }}"
|
|
|
|
state: directory
|
|
|
|
owner: root
|
|
|
|
group: "{{ host_uid }}"
|
|
|
|
mode: '550'
|
|
|
|
become: true
|
|
|
|
loop:
|
|
|
|
- live
|
|
|
|
- archive
|
|
|
|
|
|
|
|
- name: Set limited permissions on certificate key file
|
|
|
|
file:
|
|
|
|
path: "/etc/letsencrypt/live/mail.{{ domain }}/privkey.pem"
|
|
|
|
owner: root
|
|
|
|
group: "{{ host_uid }}"
|
|
|
|
mode: '640'
|
|
|
|
become: true
|