Clean Code
This commit is contained in:
30
01-old/packer/ansible/test.yaml
Executable file
30
01-old/packer/ansible/test.yaml
Executable file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
- name: Set session timeout
|
||||
hosts: all
|
||||
tasks:
|
||||
- lineinfile:
|
||||
dest: /etc/profile
|
||||
regexp: '^TMOUT=.*'
|
||||
insertbefore: '^readonly TMOUT'
|
||||
line: 'TMOUT={{shell_timeout}}'
|
||||
state: "{{ 'absent' if (shell_timeout == 0) else 'present' }}"
|
||||
|
||||
- name: Set TMOUT readonly
|
||||
hosts: all
|
||||
tasks:
|
||||
- lineinfile:
|
||||
dest: /etc/profile
|
||||
regexp: '^readonly TMOUT'
|
||||
insertafter: 'TMOUT={{shell_timeout}}'
|
||||
line: 'readonly TMOUT'
|
||||
state: "{{ 'absent' if (shell_timeout == 0) else 'present' }}"
|
||||
|
||||
- name: Set export TMOUT
|
||||
hosts: all
|
||||
tasks:
|
||||
- lineinfile:
|
||||
dest: /etc/profile
|
||||
regexp: '^export TMOUT.*'
|
||||
insertafter: 'readonly TMOUT'
|
||||
line: 'export TMOUT'
|
||||
state: "{{ 'absent' if (shell_timeout == 0) else 'present' }}"
|
||||
Reference in New Issue
Block a user