diff --git a/roles/docker-mailu/files/mailu.service b/roles/docker-mailu/files/mailu.service deleted file mode 100644 index 54ed4193..00000000 --- a/roles/docker-mailu/files/mailu.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Mailu service -After=network.target docker.service - -[Service] -Type=simple -WorkingDirectory=/usr/local/bin/mailu -ExecStart=/bin/docker-compose up -ExecStop=/bin/docker-compose down - -[Install] -WantedBy=multi-user.target diff --git a/roles/docker-mailu/handlers/main.yml b/roles/docker-mailu/handlers/main.yml index d31efdc3..d4e20737 100644 --- a/roles/docker-mailu/handlers/main.yml +++ b/roles/docker-mailu/handlers/main.yml @@ -1,8 +1,5 @@ --- -- name: "restart mailu" - systemd: - name: mailu - state: restarted - enabled: yes - daemon_reload: yes - become: yes +- name: rescreate mailu + command: + cmd: docker-compose -p mailu up -d --force-recreate + chdir: /usr/local/bin/mailu/ diff --git a/roles/docker-mailu/tasks/main.yml b/roles/docker-mailu/tasks/main.yml index 5e8cd029..89fa000d 100644 --- a/roles/docker-mailu/tasks/main.yml +++ b/roles/docker-mailu/tasks/main.yml @@ -21,14 +21,8 @@ - name: add docker-compose.yml template: src=docker-compose.yml.j2 dest=/usr/local/bin/mailu/docker-compose.yml - notify: restart mailu + notify: rescreate mailu - name: add mailu.env template: src=mailu.env.j2 dest=/usr/local/bin/mailu/mailu.env - notify: restart mailu - -- name: "install mailu service" - copy: - src: "mailu.service" - dest: "/etc/systemd/system/mailu.service" - notify: restart mailu + notify: rescreate mailu