From 2fbada7c54f7eaa2882cc183cb4e3eff664c9cfe Mon Sep 17 00:00:00 2001 From: Jeremy Frasier Date: Fri, 30 Jul 2021 14:27:34 -0400 Subject: [PATCH] Use creates/removes with linger enable/disable commands This increases the idempotency of this bit of Ansible code. --- src/vnc.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/vnc.yml b/src/vnc.yml index b9c161b..f71fce8 100644 --- a/src/vnc.yml +++ b/src/vnc.yml @@ -44,6 +44,7 @@ - /bin/loginctl - enable-linger - "{{ username }}" + creates: /var/lib/systemd/linger/{{ username }} - name: >- Enable the user-mode systemd service that creates the file share symlink for the vnc user @@ -67,6 +68,7 @@ - /bin/loginctl - disable-linger - "{{ username }}" + removes: /var/lib/systemd/linger/{{ username }} vars: # The username, password, and ssh keys for the VNC user username: "{{ lookup('aws_ssm', '/vnc/username') }}"