From 88dab0db2daaf6564cd351209ca5ab484ee0c6b1 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Mon, 2 Apr 2012 20:35:51 -0400 Subject: [PATCH] Add prompts example --- examples/playbooks/prompts.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 examples/playbooks/prompts.yml diff --git a/examples/playbooks/prompts.yml b/examples/playbooks/prompts.yml new file mode 100644 index 0000000000..5af61ec309 --- /dev/null +++ b/examples/playbooks/prompts.yml @@ -0,0 +1,28 @@ +--- + +# it is possible to ask for variables from the user at the start +# of a playbook run, for example, as part of a release script. + +- hosts: all + user: root + +# regular variables are a dictionary of keys and values + + vars: + this_is_a_regular_var: 'moo' + so_is_this: 'quack' + +# prompted variables + + vars_prompt: + release_version: "product release version" + + tasks: + +# 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. + + - name: imagine this did something interesting with $release_version + action: shell echo foo >> /tmp/$release_version +