mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
Improved 'vars_prompt' syntax to support prompt text and (non-)private input
An example of the new syntax: vars_prompt: - name: 'secret_variable_name" prompt: "Enter secret value: " private: "yes" - name: "nonsecret_variable_name" prompt: "Enter non-secret value: " private: "no"
This commit is contained in:
committed by
Michael DeHaan
parent
4ecdd17caf
commit
c717934b7e
@@ -12,22 +12,35 @@
|
||||
this_is_a_regular_var: 'moo'
|
||||
so_is_this: 'quack'
|
||||
|
||||
# prompted variables are a list of variable names and a description
|
||||
# that will be presented to the user.
|
||||
#
|
||||
# alternatively, they can ALSO be passed in from the outside:
|
||||
# ansible-playbook foo.yml --extra-vars="foo=100 bar=101"
|
||||
# or through external inventory scripts (see online API docs)
|
||||
|
||||
# prompted variables are a list of variable names and a description
|
||||
# that will be presented to the user, or a list of variable dictionaries
|
||||
# with the following accepted keys / value types:
|
||||
# 'name' / text
|
||||
# 'prompt' / text (optional)
|
||||
# 'private' / boolean (optional)
|
||||
|
||||
# prompted variables as key/value pairs:
|
||||
vars_prompt:
|
||||
release_version: "product release version"
|
||||
|
||||
tasks:
|
||||
# prompted variables as a list of variable dictionaries:
|
||||
# vars_prompt:
|
||||
# - name: "some_password"
|
||||
# prompt: "Enter password: "
|
||||
# private: True
|
||||
# - name: "release_version"
|
||||
# prompt: "Product release version: "
|
||||
# private: False
|
||||
|
||||
# this is just a simple example to show that vars_prompt works, but
|
||||
# you might ask for a tag to use with the git module or perhaps
|
||||
# a package version to use with the yum module.
|
||||
|
||||
tasks:
|
||||
- name: imagine this did something interesting with $release_version
|
||||
action: shell echo foo >> /tmp/$release_version-$alpha
|
||||
|
||||
|
||||
Reference in New Issue
Block a user