Skip to content

Instantly share code, notes, and snippets.

@marienfressinaud
Created March 6, 2019 08:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marienfressinaud/f284a59b18aad395eb0de2d22836ae6b to your computer and use it in GitHub Desktop.
Save marienfressinaud/f284a59b18aad395eb0de2d22836ae6b to your computer and use it in GitHub Desktop.
Mailu Ansible
[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
---
- name: "Restart Mailu"
systemd:
name: mailu
state: restarted
enabled: yes
daemon_reload: yes
become: yes
---
- name: "Create mailu dir"
file:
path: "/mailu"
state: directory
mode: 0755
become: yes
- name: "Add docker-compose.yml"
copy:
src: "docker-compose.yml"
dest: "/mailu/docker-compose.yml"
force: no
become: yes
- name: "Add mailu.env"
copy:
src: "mailu.env"
dest: "/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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment