From 3261933cb019a07092e4a5530771ac9a71438365 Mon Sep 17 00:00:00 2001 From: citty Date: Fri, 15 Oct 2021 21:42:51 -0400 Subject: [PATCH] Autopassword is too smart for me --- roles/immortal/tasks/main.yml | 12 ++++++------ setup.yml | 3 +++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/roles/immortal/tasks/main.yml b/roles/immortal/tasks/main.yml index 4e433c1..ee517bf 100644 --- a/roles/immortal/tasks/main.yml +++ b/roles/immortal/tasks/main.yml @@ -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 diff --git a/setup.yml b/setup.yml index f8cb630..3e58021 100644 --- a/setup.yml +++ b/setup.yml @@ -1,6 +1,9 @@ --- - hosts: all + vars_prompt: + - name: password + prompt: "Enter new root and admin password" roles: - immortal