Skip to content

Commit

Permalink
add session_timeout variable and declare TMOUT
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Sjögren <[email protected]>
  • Loading branch information
konstruktoid committed Jan 15, 2024
1 parent 56c9db9 commit 6693996
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 29 deletions.
1 change: 1 addition & 0 deletions defaults/main/umask.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
session_timeout: 900
umask_value: "077"
39 changes: 10 additions & 29 deletions tasks/umask.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,32 +188,13 @@
tags:
- umask

- name: Set TMOUT in /etc/profile
become: true
block:
- name: Configure readonly TMOUT
ansible.builtin.lineinfile:
line: readonly TMOUT
dest: /etc/profile
mode: "0644"
state: present
create: false
insertbefore: ^export

- name: Set TMOUT
ansible.builtin.lineinfile:
line: TMOUT=900
dest: /etc/profile
mode: "0644"
state: present
create: false
insertbefore: ^readonly TMOUT

- name: Export TMOUT
ansible.builtin.lineinfile:
line: export TMOUT
dest: /etc/profile
mode: "0644"
state: present
create: false
insertafter: ^readonly TMOUT
- name: Configure session timeout
become: true
ansible.builtin.lineinfile:
line: declare -xr TMOUT={{ session_timeout }}
dest: /etc/profile
mode: "0644"
state: present
create: false
insertbefore: ^export
when: session_timeout

0 comments on commit 6693996

Please sign in to comment.