Autopassword is too smart for me

This commit is contained in:
citty 2021-10-15 21:42:51 -04:00
parent 2e0bb20110
commit 3261933cb0
2 changed files with 9 additions and 6 deletions

View File

@ -1,8 +1,8 @@
---
- name: Generate password
delegate_to: localhost
shell: bash autopassword.sh {{ inventory_hostname }}
register: genPass
# - name: Generate password
# delegate_to: localhost
# shell: bash autopassword.sh {{ inventory_hostname }}
# register: genPass
- name: Backup ssh config
fetch:
@ -78,11 +78,11 @@
user:
name: root
shell: /bin/bash
password: "{{ genPass.stdout | password_hash('sha512') }}"
password: "{{ password | password_hash('sha512') }}"
- name: Change admin password
user:
name: "{{ ansible_user }}"
shell: /bin/bash
password: "{{ genPass.stdout | password_hash('sha512') }}"
password: "{{ password | password_hash('sha512') }}"
become: yes

View File

@ -1,6 +1,9 @@
---
- hosts: all
vars_prompt:
- name: password
prompt: "Enter new root and admin password"
roles:
- immortal