Created
March 6, 2019 08:00
-
-
Save marienfressinaud/f284a59b18aad395eb0de2d22836ae6b to your computer and use it in GitHub Desktop.
Mailu Ansible
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: "Restart Mailu" | |
systemd: | |
name: mailu | |
state: restarted | |
enabled: yes | |
daemon_reload: yes | |
become: yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- 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