Browse code

Add prompts example

Michael DeHaan authored on 2012/04/03 09:35:51
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,28 @@
0
+---
1
+
2
+# it is possible to ask for variables from the user at the start
3
+# of a playbook run, for example, as part of a release script.
4
+
5
+- hosts: all
6
+  user: root
7
+
8
+# regular variables are a dictionary of keys and values
9
+
10
+  vars:
11
+     this_is_a_regular_var: 'moo'
12
+     so_is_this: 'quack'
13
+
14
+# prompted variables
15
+
16
+  vars_prompt:
17
+     release_version: "product release version"
18
+
19
+  tasks:
20
+
21
+# this is just a simple example to show that vars_prompt works, but
22
+# you might ask for a tag to use with the git module or perhaps
23
+# a package version to use with the yum module.
24
+
25
+  - name: imagine this did something interesting with $release_version
26
+    action: shell echo foo >> /tmp/$release_version
27
+