Add dynamic ansible inventory from terraform state

This commit is contained in:
Tobias Reisinger 2025-08-10 14:58:54 +02:00
parent bccc07f806
commit 70578f2a13
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
11 changed files with 84 additions and 51 deletions

View file

@ -2,13 +2,17 @@
- name: Change password
hosts: all
become: true
vars_prompt:
- name: name
prompt: User
private: false
- name: password
prompt: Password
encrypt: sha512_crypt
confirm: true
salt_size: 7
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') }}"
name: "{{ user }}"
password: "{{ password }}"