mirror of
https://github.com/aminnairi/dotfiles.git
synced 2026-11-13 12:19:09 +01:00
added a new task to handle the creation of users
This commit is contained in:
1 parent
9b76e6282f
commit
9b638b3138
1 file changed
+26
@@ -0,0 +1,26 @@
|
|||||||
|
---
|
||||||
|
- name: Install sudo (permissions management)
|
||||||
|
become: true
|
||||||
|
pacman:
|
||||||
|
name: sudo
|
||||||
|
state: present
|
||||||
|
- name: Create the main user
|
||||||
|
become: true
|
||||||
|
user:
|
||||||
|
name: "{{ user.name }}"
|
||||||
|
uid: "{{ user.uid }}"
|
||||||
|
groups: "{{ user.groups }}"
|
||||||
|
shell: "{{ user.shell }}"
|
||||||
|
- name: Update the root user informations
|
||||||
|
become: true
|
||||||
|
user:
|
||||||
|
name: root
|
||||||
|
shell: "{{ root.shell }}"
|
||||||
|
- name: Allow user as a sudoers
|
||||||
|
become: true
|
||||||
|
community.general.sudoers:
|
||||||
|
commands: ALL
|
||||||
|
name: "{{ user.name }}"
|
||||||
|
runas: root
|
||||||
|
state: present
|
||||||
|
user: "{{ user.name }}"
|
||||||
Reference in new issue
Block a user