add system user task
This commit is contained in:
parent
6093328fa6
commit
f7ccb079a0
@ -84,4 +84,10 @@ system_base_softwares_debian:
|
||||
|
||||
system_upgrade: false
|
||||
system_arch_local_mirror:
|
||||
system_user: []
|
||||
#- name: toto
|
||||
#home: /home/toto
|
||||
#shell: '/bin/zsh'
|
||||
#group: ezfef
|
||||
system_group: []
|
||||
keystodeploy: []
|
||||
|
@ -3,6 +3,7 @@
|
||||
- include_tasks: hostname.yml
|
||||
- include_tasks: locales.yml
|
||||
- include_tasks: time.yml
|
||||
- include_tasks: usergroup.yml
|
||||
- include_tasks: pacman.yml
|
||||
when: ansible_facts['os_family'] == "Archlinux"
|
||||
- include_tasks: depot_debian.yml
|
||||
|
16
tasks/usergroup.yml
Normal file
16
tasks/usergroup.yml
Normal file
@ -0,0 +1,16 @@
|
||||
---
|
||||
- name: create system user
|
||||
become: yes
|
||||
user:
|
||||
name: "{{item.name}}"
|
||||
system: yes
|
||||
home: "{{ item.home | default('/') }}"
|
||||
shell: "{{ item.shell |default('/usr/bin/nologin') }}"
|
||||
with_items: "{{system_user}}"
|
||||
|
||||
|
||||
- name: create system group
|
||||
group:
|
||||
name: "{{item.name}}"
|
||||
with_items: "{{system_group}}"
|
||||
become: yes
|
Loading…
Reference in New Issue
Block a user