Skip to content

Commit

Permalink
Configure logind.conf IdleAction
Browse files Browse the repository at this point in the history
  • Loading branch information
pyllyukko committed Jan 16, 2025
1 parent 4141293 commit 3788192
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tasks/login_defs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -409,3 +409,19 @@
with_dict:
hash_rounds_min: "{{ crypt_rounds }}"
crypt_style: sha512

- name: Configure logind.conf
tags: configuration
become: true
community.general.ini_file:
path: '{{ logind_conf_location }}'
section: Login
option: "{{ item.key }}"
value: "{{ item.value }}"
owner: root
group: root
mode: '0644'
backup: true
with_dict:
IdleActionSec: '{{ session_timeout }}min'
IdleAction: "lock"
1 change: 1 addition & 0 deletions vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,4 @@ clamav: {
'database': "/var/lib/clamav",
'pid': "/run/clamav/clamd.pid"
}
logind_conf_location: '{% if ansible_distribution == "Slackware" %}/etc/elogind/logind.conf{% else %}/etc/systemd/logind.conf{% endif %}'

0 comments on commit 3788192

Please sign in to comment.