Trying something different for passlib
This commit is contained in:
parent
c6d7edac85
commit
93cc091cef
@ -1,8 +1,5 @@
|
|||||||
---
|
---
|
||||||
- hosts: all
|
- hosts: all
|
||||||
become: true
|
|
||||||
become_method: sudo
|
|
||||||
become_user: root
|
|
||||||
vars:
|
vars:
|
||||||
password_salt: !vault |
|
password_salt: !vault |
|
||||||
$ANSIBLE_VAULT;1.1;AES256
|
$ANSIBLE_VAULT;1.1;AES256
|
||||||
@ -34,6 +31,13 @@
|
|||||||
- name: Ensure passlib is installed locally
|
- name: Ensure passlib is installed locally
|
||||||
ansible.builtin.pip:
|
ansible.builtin.pip:
|
||||||
name: passlib
|
name: passlib
|
||||||
|
extra_args: "--user"
|
||||||
|
run_once: true
|
||||||
|
delegate_to: 127.0.0.1
|
||||||
|
|
||||||
|
- name: Generate password outside root context
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
hashed_pass: "{{ what_password | password_hash('sha512', password_salt) }}"
|
||||||
run_once: true
|
run_once: true
|
||||||
delegate_to: 127.0.0.1
|
delegate_to: 127.0.0.1
|
||||||
|
|
||||||
@ -41,5 +45,8 @@
|
|||||||
ansible.builtin.user:
|
ansible.builtin.user:
|
||||||
name: "{{ what_user }}"
|
name: "{{ what_user }}"
|
||||||
password: "{{ what_password | password_hash('sha512', password_salt) }}"
|
password: "{{ what_password | password_hash('sha512', password_salt) }}"
|
||||||
|
become: true
|
||||||
|
become_method: sudo
|
||||||
|
become_user: root
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user