Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add session_timeout variable and declare TMOUT #489

Merged
merged 1 commit into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading