From b6bd8e47dbdd88e5a8743a4262acbf09dedfe9f5 Mon Sep 17 00:00:00 2001 From: Cedric Girard Date: Thu, 2 Aug 2018 14:08:37 +0200 Subject: [PATCH] 10th exercise: user prompt --- 100.Prompt/100.Prompt.md | 14 ++++++++++++++ 100.Prompt/solution/solution.yml | 10 ++++++++++ README.md | 1 + 3 files changed, 25 insertions(+) create mode 100644 100.Prompt/100.Prompt.md create mode 100644 100.Prompt/solution/solution.yml diff --git a/100.Prompt/100.Prompt.md b/100.Prompt/100.Prompt.md new file mode 100644 index 0000000..6014405 --- /dev/null +++ b/100.Prompt/100.Prompt.md @@ -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`. diff --git a/100.Prompt/solution/solution.yml b/100.Prompt/solution/solution.yml new file mode 100644 index 0000000..ed32bb1 --- /dev/null +++ b/100.Prompt/solution/solution.yml @@ -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: diff --git a/README.md b/README.md index 9ae0565..9afa5fa 100644 --- a/README.md +++ b/README.md @@ -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. [Loops](080.Loops/080.Loops.md) 1. [Vault](090.Vault/090.Vault.md) +1. [User Prompt](100.Prompt/100.Prompt.md)