User-management now creates users
User-management now creates users if they do not exist. This is to handle users that are created after this task runs. Change-Id: I12ea54dbf39d09af27fb4d944a61b9f71c3ead00
This commit is contained in:
parent
b9965761e8
commit
3a4f5d2209
@ -228,11 +228,11 @@ file_permissions:
|
|||||||
- "{{ default_run_context }}"
|
- "{{ default_run_context }}"
|
||||||
# Set password and login shell for existing users
|
# Set password and login shell for existing users
|
||||||
# Mainly intended to lock down system users
|
# Mainly intended to lock down system users
|
||||||
# Will not create user if does not exist
|
# Creates user if does not exist
|
||||||
user_management:
|
user_management:
|
||||||
- name: test
|
- name: test
|
||||||
shell: /usr/sbin/nologin
|
shell: /bin/false
|
||||||
password: '!'
|
password: ''
|
||||||
password_lock: yes
|
password_lock: yes
|
||||||
run_contexts:
|
run_contexts:
|
||||||
- "{{ default_run_context }}"
|
- "{{ default_run_context }}"
|
||||||
|
@ -1,7 +1,3 @@
|
|||||||
- name: "Get all account info"
|
|
||||||
getent:
|
|
||||||
database: passwd
|
|
||||||
|
|
||||||
- name: "User Management | Modifying user settings for {{ item.name }}"
|
- name: "User Management | Modifying user settings for {{ item.name }}"
|
||||||
user:
|
user:
|
||||||
name: "{{ item.name }}"
|
name: "{{ item.name }}"
|
||||||
@ -9,4 +5,4 @@
|
|||||||
password_lock: "{{ item.password_lock }}"
|
password_lock: "{{ item.password_lock }}"
|
||||||
shell: "{{ item.shell }}"
|
shell: "{{ item.shell }}"
|
||||||
loop: "{{ user_management }}"
|
loop: "{{ user_management }}"
|
||||||
when: run_context in item.run_contexts and item.name in ansible_facts.getent_passwd
|
when: run_context in item.run_contexts
|
Loading…
x
Reference in New Issue
Block a user