From 54dfc77e78e5aeae2b13caca4bbdc31c0bd2d7c6 Mon Sep 17 00:00:00 2001 From: Maxim Vershinin Date: Thu, 8 Oct 2026 14:03:00 +0400 Subject: [PATCH] fix(task): non default lxc root password failure --- tasks/lxc_root_password_validation.yaml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tasks/lxc_root_password_validation.yaml b/tasks/lxc_root_password_validation.yaml index 845a49f..43d7845 100644 --- a/tasks/lxc_root_password_validation.yaml +++ b/tasks/lxc_root_password_validation.yaml @@ -2,22 +2,20 @@ - name: Set default password ansible.builtin.set_fact: - lxc_root_password: "test-guest" + lxc_root_password: "test-guest" - name: Prompt for password ansible.builtin.pause: prompt: "Enter your password [{{ lxc_root_password }}]" echo: false register: password_result_1 - until: password_result_1.user_input | length == 0 - retries: 2 - delay: 0 -- name: Prompt for password (confirmation) +- name: Prompt for password confirmation (only if a password was entered) ansible.builtin.pause: prompt: "Confirm your new password" echo: false register: password_result_2 + when: password_result_1.user_input | length > 0 - name: Ensure passwords match ansible.builtin.assert: @@ -25,6 +23,7 @@ - password_result_1.user_input == password_result_2.user_input fail_msg: "Passwords do not match!" success_msg: "Password confirmed." + when: password_result_1.user_input | length > 0 - name: Use user input only if provided, otherwise keep the default ansible.builtin.set_fact: