Deploy root password

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
Yohann D'ANELLO 2021-06-04 15:51:04 +02:00
parent 8c4684a450
commit 145dccac2d
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
4 changed files with 17 additions and 0 deletions

View File

@ -5,3 +5,6 @@ glob_apt:
extra_repositories: []
pin:
bullseye: []
glob_root:
passwd_hash: '{{ vault.root_passwd_hash }}'

View File

@ -1,6 +1,7 @@
#!/usr/bin/env ansible-playbook
---
- import_playbook: root.yml
- import_playbook: apt.yml
- import_playbook: ntp.yml
- import_playbook: ldap-client.yml

7
plays/root.yml Executable file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env ansible-playbook
---
- hosts: debian
vars:
root: "{{ glob_root | default({}) | combine(loc_root | default({})) }}"
roles:
- root

View File

@ -0,0 +1,6 @@
---
- name: Deploys root password hash
replace:
path: /etc/shadow
regexp: '^root:[^:]*:'
replace: 'root:{{ root.passwd_hash }}:'