diff options
Diffstat (limited to 'playbooks/roles/mail/tasks/main.yml')
-rw-r--r-- | playbooks/roles/mail/tasks/main.yml | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/playbooks/roles/mail/tasks/main.yml b/playbooks/roles/mail/tasks/main.yml new file mode 100644 index 0000000..12b789d --- /dev/null +++ b/playbooks/roles/mail/tasks/main.yml @@ -0,0 +1,67 @@ +--- + +- name: Build mail compose dirs + ansible.builtin.file: + state: directory + dest: '{{ mail_base }}/{{ item.path }}' + owner: 1000 + group: 1000 + mode: 0755 + with_filetree: '../templates' + when: item.state == 'directory' + +- name: Build mail compose files + ansible.builtin.template: + src: '{{ item.src }}' + dest: '{{ mail_base }}/{{ item.path }}' + owner: 1000 + group: 1000 + mode: 0755 + with_filetree: '../templates' + when: item.state == 'file' + +# https://github.com/docker-mailserver/docker-mailserver/blob/23bb1c8e50dad1462c645b8a9cf50aeee8bc2625/Dockerfile#L149C19-L149C20 +- name: Build DMS compose dirs + ansible.builtin.file: + state: directory + dest: '{{ mail_base }}/volumes/data/dms/{{ item.path }}' + owner: 5000 + group: 5000 + mode: 0755 + with_filetree: '../templates/volumes/data/dms' + when: item.state == 'directory' + +- name: Build DMS template files with correct UID for docker mailserver + ansible.builtin.template: + src: '{{ item.src }}' + dest: '{{ mail_base }}/volumes/data/dms/{{ item.path }}' + owner: 5000 + group: 5000 + mode: 0755 + with_filetree: '../templates/volumes/data/dms' + when: item.state == 'file' + +- name: Build Roundcube compose dirs + ansible.builtin.file: + state: directory + dest: '{{ mail_base }}/volumes/data/roundcube/{{ item.path }}' + mode: 0755 + # https://github.com/roundcube/roundcubemail-docker/blob/ef4b8cc59eecbf0e25c66c7f3c464594cc310761/apache/Dockerfile#L145 + owner: 33 + group: 33 + with_filetree: '../templates/volumes/data/roundcube' + when: item.state == 'directory' + +- name: Build Roundcube template files + ansible.builtin.template: + src: '{{ item.src }}' + dest: '{{ mail_base }}/volumes/data/roundcube/{{ item.path }}' + owner: 33 + group: 33 + mode: 0755 + with_filetree: '../templates/volumes/data/roundcube' + when: item.state == 'file' + +- name: Deploy mail stack + ansible.builtin.command: + cmd: 'docker stack deploy -c {{ mail_base }}/stacks/docker-compose.yml mail' |