infrastructure/playbooks/change-password.yml

15 lines
374 B
YAML
Raw Normal View History

2024-09-26 22:02:36 +00:00
---
- name: Change password
hosts: all
become: true
tasks:
- name: Get new password
ansible.builtin.pause:
prompt: Enter the new password
echo: false
register: new_user_password
- name: Change password
ansible.builtin.user:
name: "{{ interactive_user }}"
password: "{{ new_user_password.user_input | password_hash('sha512') }}"