Implemented role docker-mailu

This commit is contained in:
Kevin Veen-Birkenbach 2020-12-27 13:22:47 +01:00
parent 810a56b39d
commit 46837c3eff
5 changed files with 65 additions and 0 deletions

View File

@ -0,0 +1,13 @@
# role docker-mailu
Keep in mind to change the conflicting ports manual.
Execute
```bash
netstat -tulpn
```
to verify that there aren't port conflicts
## See
- https://gist.github.com/marienfressinaud/f284a59b18aad395eb0de2d22836ae6b
- https://mailu.io/1.7/compose/setup.html

View File

@ -0,0 +1,12 @@
[Unit]
Description=Mailu service
After=network.target docker.service
[Service]
Type=simple
WorkingDirectory=/mailu
ExecStart=/usr/local/bin/docker-compose up
ExecStop=/usr/local/bin/docker-compose down
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,8 @@
---
- name: "Restart Mailu"
systemd:
name: mailu
state: restarted
enabled: yes
daemon_reload: yes
become: yes

View File

@ -0,0 +1,30 @@
---
- name: "Create mailu dir"
file:
path: "/mailu"
state: directory
mode: 0755
become: yes
- name: "Add docker-compose.yml"
copy:
src: "docker-compose.yml"
dest: "{{ inventory_dir }}/files/{{ inventory_hostname }}/mailu/docker-compose.yml"
force: no
become: yes
- name: "Add mailu.env"
copy:
src: "mailu.env"
dest: "{{ inventory_dir }}/files/{{ inventory_hostname }}/mailu/mailu.env"
force: no
become: yes
- name: "Install mailu service"
copy:
src: "mailu.service"
dest: "/etc/systemd/system/mailu.service"
become: yes
notify:
- "Restart Mailu"

View File

@ -0,0 +1,2 @@
# role native-mailserver
This role is not implemented yet. For further information check: https://www.netarky.com/programming/arch_linux/Arch_Linux_mail_server_setup_1.html