ansible-role-nextcloud/tasks/systemd.yml

34 lines
922 B
YAML
Raw Permalink Normal View History

---
- name: Generate systemd unit file for the container(s)
containers.podman.podman_generate_systemd:
name: nextcloud
dest: ~/.config/systemd/user/
restart_policy: on-failure
restart_sec: 60
- name: Start the container(s) with systemd, so systemd will know the state of the container(s) moving forward.
ansible.builtin.systemd:
name: container-nextcloud
scope: user
state: started
failed_when: false
#register: systemd_result
#until: systemd_result is succeeded
#retries: 1
- name: Install systemd timer to run cron jobs
ansible.builtin.template:
src: "{{ item }}.j2"
dest: "~/.config/systemd/user/{{ item }}"
loop:
- nextcloud-cron.service
- nextcloud-cron.timer
- name: Install systemd timer to run cron jobs
ansible.builtin.systemd:
name: nextcloud-cron.timer
scope: user
daemon_reload: true
state: started
enabled: true
tags: test