add gilles user
This commit is contained in:
parent
8ea23aec15
commit
075f363cd5
20
create-gilles-user.yml
Normal file
20
create-gilles-user.yml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
- name: install mandatory python for encrypt password
|
||||||
|
dnf:
|
||||||
|
name: [python3, python3-bcrypt]
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: create password for user kadmin
|
||||||
|
shell: python -c 'import crypt;hashed = crypt.crypt("{{ gilles_passwd }}"); print(hashed);'
|
||||||
|
register: passwd
|
||||||
|
|
||||||
|
- name: create user kadmin
|
||||||
|
user:
|
||||||
|
name: gilles
|
||||||
|
comment: Gilles Mouchet
|
||||||
|
password: "{{ passwd.stdout }}"
|
||||||
|
|
||||||
|
- name: copy sudo file
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/sudoers.d/gilles
|
||||||
|
insertbefore: EOF
|
||||||
|
line: 'gilles ALL=(ALL) NOPASSWD: ALL'
|
||||||
@ -5,3 +5,10 @@ mail_domain: gmotech.dyndns.org
|
|||||||
#mail_relay_host: smtp.gmail.com
|
#mail_relay_host: smtp.gmail.com
|
||||||
# DNS
|
# DNS
|
||||||
#dns_domain_search: gmotech.net
|
#dns_domain_search: gmotech.net
|
||||||
|
gilles_passwd: !vault |
|
||||||
|
$ANSIBLE_VAULT;1.1;AES256
|
||||||
|
30333961653331613064333063326538393232633833663932386632653765613933396239316230
|
||||||
|
3061626535666636333866633538623365333139666163340a336531643364626630653331306264
|
||||||
|
35326238636466643938366535666462666534613137633631316638363763313164343563353734
|
||||||
|
6366393333326564340a623738653735363932313635616530613863313639306130363562656332
|
||||||
|
3738
|
||||||
1
main.yml
1
main.yml
@ -22,6 +22,7 @@
|
|||||||
- include_tasks: hosts.yml
|
- include_tasks: hosts.yml
|
||||||
- include_tasks: inst-packages.yml
|
- include_tasks: inst-packages.yml
|
||||||
- include_tasks: misc.yml
|
- include_tasks: misc.yml
|
||||||
|
- include_tasks: create-gilles-user.yml
|
||||||
|
|
||||||
- name: import postfix role
|
- name: import postfix role
|
||||||
import_role:
|
import_role:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user