10th exercise: user prompt
This commit is contained in:
parent
da27401954
commit
b6bd8e47db
3 changed files with 25 additions and 0 deletions
14
100.Prompt/100.Prompt.md
Normal file
14
100.Prompt/100.Prompt.md
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
# 10 - Prompt
|
||||||
|
|
||||||
|
This exercise makes you create a playbook that prompt the user for a value.
|
||||||
|
|
||||||
|
## Playbook Creation
|
||||||
|
Create a playbook following the given specs:
|
||||||
|
* Run on localhost
|
||||||
|
* Prompt the user for a value
|
||||||
|
* Use the debug module to print back the value
|
||||||
|
|
||||||
|
## Validation
|
||||||
|
The playbook should run and print the typed value.
|
||||||
|
|
||||||
|
There is a working playbook in `solution/solution.yml`.
|
10
100.Prompt/solution/solution.yml
Normal file
10
100.Prompt/solution/solution.yml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
- hosts: localhost
|
||||||
|
gather_facts: false
|
||||||
|
vars_prompt:
|
||||||
|
- name: prompted_value
|
||||||
|
prompt: Enter a value
|
||||||
|
tasks:
|
||||||
|
- name: Print the prompted value
|
||||||
|
debug:
|
||||||
|
msg: "The value is: {{ prompted_value }}"
|
||||||
|
# vim: set ft=yaml sw=2 et:
|
|
@ -15,5 +15,6 @@ Install Ansible and clone this repo. Customize the `hosts` file to your lab setu
|
||||||
1. [Task Delegation](070.Delegate/070.Delegate.md)
|
1. [Task Delegation](070.Delegate/070.Delegate.md)
|
||||||
1. [Loops](080.Loops/080.Loops.md)
|
1. [Loops](080.Loops/080.Loops.md)
|
||||||
1. [Vault](090.Vault/090.Vault.md)
|
1. [Vault](090.Vault/090.Vault.md)
|
||||||
|
1. [User Prompt](100.Prompt/100.Prompt.md)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue