fix: add users_pass_min_day and enforce users_global_umask
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
fa786ded90
commit
0c87d61d90
@ -13,7 +13,9 @@ users_default_users: []
|
|||||||
|
|
||||||
users_default_groups: []
|
users_default_groups: []
|
||||||
|
|
||||||
users_default_umask: "022"
|
users_global_umask: "022"
|
||||||
|
users_pass_min_day: 1
|
||||||
|
|
||||||
users_global_bash_aliases:
|
users_global_bash_aliases:
|
||||||
- alias: "ll"
|
- alias: "ll"
|
||||||
command: "ls -lh"
|
command: "ls -lh"
|
||||||
|
@ -16,5 +16,21 @@
|
|||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
|
||||||
|
- name: Set umask to /etc/login.defs
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/login.defs
|
||||||
|
regexp: '^UMASK(\s+)'
|
||||||
|
line: 'UMASK\1{{ users_global_umask }}'
|
||||||
|
backrefs: yes
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Enforcing minimum password lifetime
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/login.defs
|
||||||
|
regexp: '^PASS_MIN_DAYS(\s+)'
|
||||||
|
line: 'PASS_MIN_DAYS\1{{ users_pass_min_day }}'
|
||||||
|
backrefs: yes
|
||||||
|
state: present
|
||||||
become: True
|
become: True
|
||||||
become_user: root
|
become_user: root
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
---
|
---
|
||||||
- block:
|
- block:
|
||||||
- name: Create common groups
|
- name: Create groups
|
||||||
group:
|
group:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: present
|
state: present
|
||||||
loop: "{{ users_default_groups }}"
|
loop: "{{ users_default_groups }}"
|
||||||
|
|
||||||
- name: Create common users
|
- name: Create users
|
||||||
user:
|
user:
|
||||||
name: "{{ item.name }}"
|
name: "{{ item.name }}"
|
||||||
groups: "{{ item.groups | default([]) | join(',') or omit }}"
|
groups: "{{ item.groups | default([]) | join(',') or omit }}"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#jinja2:lstrip_blocks: True
|
#jinja2:lstrip_blocks: True
|
||||||
{{ ansible_managed | comment }}
|
{{ ansible_managed | comment }}
|
||||||
umask {{ users_default_umask }}
|
umask {{ users_global_umask }}
|
||||||
|
|
||||||
# are we an interactive shell?
|
# are we an interactive shell?
|
||||||
if [ "$PS1" ]; then
|
if [ "$PS1" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user