Skip to content

Commit

Permalink
fix reset_confirmation in reset.yml
Browse files Browse the repository at this point in the history
* skip reset_confirmation promtp when reset_confirmation is defined via extra-vars option (for tests)
* check both string type and object type with user_input for reset_confirmation var
  • Loading branch information
somewho authored Jul 15, 2023
1 parent 07be571 commit ab96fb9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion playbooks/reset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@
run_once: True
when:
- not (skip_confirmation | default(false) | bool)
- reset_confirmation is not defined
- name: Check confirmation
fail:
msg: "Reset confirmation failed"
when: (reset_confirmation.user_input | default('')) != "yes"
when: ((reset_confirmation.user_input | default(reset_confirmation)) | default('no')) != "yes"

- name: Gather information about installed services
service_facts:
Expand Down

0 comments on commit ab96fb9

Please sign in to comment.