Add an only_if option to vars_prompt to make prompts conditional
Sometimes you may want to allow variables through host_vars or inventory, but prompt for a value if it is not set or if the value does not conform to something specific. This option allows you to specify when you want to offer a prompt. This patch also moves check_conditional to utils, and adds an is_unset() function which is nicer to read: only_if: "not is_set('${var}')" vs only_if: "is_unset('${var}')"
Showing
Please
register
or
sign in
to comment