Yes, I understand. However, using "plain-text-password-value" still gives the same error message: "minimum-character-changes configured, use plain-text-password in cli to configure password". I'm using Ansible 11.3.0, and Ansible-core 2.18.3. This problem is a unique scenario invoked by the minimum-character-changes configuration.
------------------------------
ETHAN JOHNSON
------------------------------
Original Message:
Sent: 05-22-2025 19:29
From: asharp
Subject: Ansible password configuration
Which version of Ansible are you using?
Thanks.
Original Message:
Sent: 05-22-2025 12:06
From: ETHAN JOHNSON
Subject: Ansible password configuration
Hi, thank you for the response. I've tried this approach already, along with just using "plain-text-password". The former produces the same error message as the encrypted-password method, and "plain-text-password" is only meant for CLI changes.
------------------------------
ETHAN JOHNSON
Original Message:
Sent: 05-22-2025 05:32
From: asharp
Subject: Ansible password configuration
Probably it is complaining about encrypted_password ?
Perhaps try this approach instead.
---# Playbook to change the password on Juniper Switches- name: Change password on Juniper Switch hosts: Juniper_ex4300 # Switch group from inventory file gather_facts: no # Not needed collections: - juniper.device vars_prompt: - name: username prompt: Enter the username to update private: no - name: new_password prompt: Enter the new password private: yes confirm: yes tasks: - name: Set password for the user juniper.device.config: load: set lines: - set system login user {{ username }} authentication plain-text-password-value "{{ new_password }}" commit: yes comment: "User password updated"
Regards,
Original Message:
Sent: 05-20-2025 14:38
From: ETHAN JOHNSON
Subject: Ansible password configuration
I'm trying to run a password change playbook. When I run it with "minimum-character-changes" configured, which is required by my organization for security, I get the following error: "minimum-character-changes configured, use plain-text-password in cli to configure password".
When I run the playbook without this configuration, it functions properly. Is there any work around for this while still automating the process?
---# Playbook to change the password on Juniper Switches- name: Change password on Juniper Switch hosts: Juniper_ex4300 # Switch group from inventory file gather_facts: no # Not needed collections: - juniper.device vars_prompt: - name: username prompt: Enter the username to update private: no - name: new_password prompt: Enter the new password private: yes confirm: yes vars: salt: salt tasks: - name: Generate encrypted password ansible.builtin.set_fact: encrypted_password: "{{ new_password | password_hash('sha512', salt) }}" - name: Set password for the user juniper.device.config: load: set lines: - set system login user {{ username }} authentication encrypted-password "{{ encrypted_password }}" commit: yes comment: "User password updated"
------------------------------
ETHAN JOHNSON
------------------------------