feat: deploy pwpolicy if available
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
3d6f7b9129
commit
5a08723238
@ -17,6 +17,10 @@ users_global_umask: "022"
|
|||||||
users_pass_min_day: 1
|
users_pass_min_day: 1
|
||||||
users_default_inactive: -1
|
users_default_inactive: -1
|
||||||
|
|
||||||
|
users_password_pam_retry: 3
|
||||||
|
users_password_pam_minlen: 14
|
||||||
|
users_password_pam_minclass: 4
|
||||||
|
|
||||||
users_global_bash_aliases:
|
users_global_bash_aliases:
|
||||||
- alias: "ll"
|
- alias: "ll"
|
||||||
command: "ls -lh"
|
command: "ls -lh"
|
||||||
|
@ -9,6 +9,11 @@
|
|||||||
- /etc/profile
|
- /etc/profile
|
||||||
register: __users_umask_files
|
register: __users_umask_files
|
||||||
|
|
||||||
|
- name: Stat pwquality files
|
||||||
|
stat:
|
||||||
|
path: "/etc/security/pwquality.conf"
|
||||||
|
register: __users_pwquality_file
|
||||||
|
|
||||||
- name: Set global umask
|
- name: Set global umask
|
||||||
replace:
|
replace:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
@ -39,5 +44,14 @@
|
|||||||
line: \g<inactive>{{ users_default_inactive }}
|
line: \g<inactive>{{ users_default_inactive }}
|
||||||
backrefs: yes
|
backrefs: yes
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
|
- name: Set pwquality if available
|
||||||
|
template:
|
||||||
|
src: etc/security/pwquality.conf.j2
|
||||||
|
dest: /etc/security/pwquality.conf
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0644
|
||||||
|
when: __users_pwquality_file.stat.exists | bool
|
||||||
become: True
|
become: True
|
||||||
become_user: root
|
become_user: root
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#jinja2:lstrip_blocks: True
|
#jinja2:lstrip_blocks: True
|
||||||
{{ ansible_managed | comment }}
|
{{ ansible_managed | comment }}
|
||||||
|
|
||||||
# are we an interactive shell?
|
# are we an interactive shell?
|
||||||
if [ "$PS1" ]; then
|
if [ "$PS1" ]; then
|
||||||
if [[ ${EUID} == 0 ]] ; then
|
if [[ ${EUID} == 0 ]] ; then
|
||||||
|
5
templates/etc/security/pwquality.conf.j2
Normal file
5
templates/etc/security/pwquality.conf.j2
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#jinja2:lstrip_blocks: True
|
||||||
|
{{ ansible_managed | comment }}
|
||||||
|
retry = {{ users_password_pam_retry }}
|
||||||
|
minlen = {{ users_password_pam_minlen }}
|
||||||
|
minclass = {{ users_password_pam_minclass }}
|
Loading…
Reference in New Issue
Block a user