first commit

This commit is contained in:
2026-05-19 06:57:40 +02:00
commit 056c5530a2
5 changed files with 86 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
---
- name: Change account password
hosts: all
gather_facts: false
become: true
vars:
target_account_name: >-
{{ password_target_user | default(ansible_user, true) }}
vars_prompt:
- name: new_account_password
prompt: New password for the target account
private: true
confirm: true
pre_tasks:
- name: Validate target user
ansible.builtin.assert:
that:
- target_account_name is defined
- target_account_name | length > 0
fail_msg: "Set password_target_user or ansible_user for each host."
tasks:
- name: Update password for target account
ansible.builtin.command:
cmd: chpasswd
stdin: "{{ target_account_name }}:{{ new_account_password }}"
no_log: true