Skip to content

Commit

Permalink
Use creates/removes with linger enable/disable commands
Browse files Browse the repository at this point in the history
This increases the idempotency of this bit of Ansible code.
  • Loading branch information
jsf9k committed Jul 30, 2021
1 parent 718f5bd commit 2fbada7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/vnc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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') }}"
Expand Down

0 comments on commit 2fbada7

Please sign in to comment.