You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 line
534B

  1. ---
  2. - name: check if systemd lingering is enabled
  3. stat:
  4. path: /var/lib/systemd/linger/{{item}}
  5. register: _users_systemd_linger_stat
  6. with_items: "{{ users.keys() }}"
  7. - name: set systemd lingering
  8. command:
  9. loginctl
  10. {{ users[item].linger | ternary('enable','disable') }}-linger
  11. {{item}}
  12. with_items: "{{ users.keys() }}"
  13. when:
  14. - users[item].linger is defined
  15. - (
  16. _users_systemd_linger_stat.results
  17. | json_query("[?item=='"+item+"'].stat.exists") | first
  18. ) != users[item].linger