Docsite: update user_guide/playbooks_prompts (#72049)
This commit is contained in:
parent
c12fce3aa9
commit
3efc8b6de8
1 changed files with 11 additions and 10 deletions
|
@ -16,15 +16,16 @@ Here is a most basic example::
|
||||||
vars_prompt:
|
vars_prompt:
|
||||||
|
|
||||||
- name: username
|
- name: username
|
||||||
prompt: "What is your username?"
|
prompt: What is your username?
|
||||||
private: no
|
private: no
|
||||||
|
|
||||||
- name: password
|
- name: password
|
||||||
prompt: "What is your password?"
|
prompt: What is your password?
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
- debug:
|
- name: Print a message
|
||||||
|
ansible.builtin.debug:
|
||||||
msg: 'Logging in as {{ username }}'
|
msg: 'Logging in as {{ username }}'
|
||||||
|
|
||||||
The user input is hidden by default but it can be made visible by setting ``private: no``.
|
The user input is hidden by default but it can be made visible by setting ``private: no``.
|
||||||
|
@ -36,8 +37,8 @@ If you have a variable that changes infrequently, you can provide a default valu
|
||||||
|
|
||||||
vars_prompt:
|
vars_prompt:
|
||||||
|
|
||||||
- name: "release_version"
|
- name: release_version
|
||||||
prompt: "Product release version"
|
prompt: Product release version
|
||||||
default: "1.0"
|
default: "1.0"
|
||||||
|
|
||||||
Encrypting values supplied by ``vars_prompt``
|
Encrypting values supplied by ``vars_prompt``
|
||||||
|
@ -47,10 +48,10 @@ You can encrypt the entered value so you can use it, for instance, with the user
|
||||||
|
|
||||||
vars_prompt:
|
vars_prompt:
|
||||||
|
|
||||||
- name: "my_password2"
|
- name: my_password2
|
||||||
prompt: "Enter password2"
|
prompt: Enter password2
|
||||||
private: yes
|
private: yes
|
||||||
encrypt: "sha512_crypt"
|
encrypt: sha512_crypt
|
||||||
confirm: yes
|
confirm: yes
|
||||||
salt_size: 7
|
salt_size: 7
|
||||||
|
|
||||||
|
@ -96,8 +97,8 @@ Allowing special characters in ``vars_prompt`` values
|
||||||
Some special characters, such as ``{`` and ``%`` can create templating errors. If you need to accept special characters, use the ``unsafe`` option::
|
Some special characters, such as ``{`` and ``%`` can create templating errors. If you need to accept special characters, use the ``unsafe`` option::
|
||||||
|
|
||||||
vars_prompt:
|
vars_prompt:
|
||||||
- name: "my_password_with_weird_chars"
|
- name: my_password_with_weird_chars
|
||||||
prompt: "Enter password"
|
prompt: Enter password
|
||||||
unsafe: yes
|
unsafe: yes
|
||||||
private: yes
|
private: yes
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue