diff options
-rw-r--r-- | setup.yml | 30 |
1 files changed, 28 insertions, 2 deletions
@@ -27,8 +27,9 @@ # -- LINGER ---------------------------------------------------------------- - # Enable lingering for user, such that processes are not killed if - # there is no login session. + # Enable lingering for user. A user manager is spawned for the user at boot + # and kept around after logouts. This allows users who are not logged in to + # run long-running services. - name: enable-linger become: true command: loginctl enable-linger {{ user }} @@ -117,3 +118,28 @@ - "/etc/localtime:/etc/localtime:ro" device: - "/dev/ttyUSB0:/dev/ttyUSB0" + + # -- USER SYSTEMD UNITS ---------------------------------------------------- + + - name: generate-user-systemd-units + containers.podman.podman_generate_systemd: + name: "{{ item }}" + dest: ~/.config/systemd/user/ + restart_policy: on-failure + restart_sec: 10 + loop: + - ftp + - mosquitto + - homeassistant + + - name: enable-user-systemd-units + ansible.builtin.systemd: + name: "container-{{ item }}" + scope: user + daemon_reload: true + #state: started + enabled: true + loop: + - ftp + - mosquitto + - homeassistant |