summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Ferrante <mferrante3@gmail.com>2016-08-11 13:23:06 -0400
committerGitHub <noreply@github.com>2016-08-11 13:23:06 -0400
commite448c05f675b0eb34952e3948fcdf32407a2bee5 (patch)
treed7ff0a6602ee5a395b1785876723942261f46035
parentb82d150c42f4640a959b5d8aaac12d38c1c5aab7 (diff)
downloadansible-e448c05f675b0eb34952e3948fcdf32407a2bee5.tar.gz
Update playbooks_lookups.rst
-rw-r--r--docsite/rst/playbooks_lookups.rst18
1 files changed, 18 insertions, 0 deletions
diff --git a/docsite/rst/playbooks_lookups.rst b/docsite/rst/playbooks_lookups.rst
index 62ff66a973..5684961d7c 100644
--- a/docsite/rst/playbooks_lookups.rst
+++ b/docsite/rst/playbooks_lookups.rst
@@ -237,6 +237,24 @@ You can specify regions or tables to fetch secrets from::
- name: "Test credstash lookup plugin -- get the company's github password"
debug: msg="Credstash lookup! {{ lookup('credstash', 'company-github-password', table='company-passwords') }}"
+
+
+If you use the context feature when putting your secret, you can get it by passing a dictionary to the context option like this::
+
+ ---
+ - name: test
+ hosts: localhost
+ vars:
+ context:
+ app: my_app
+ environment: production
+ tasks:
+
+ - name: "Test credstash lookup plugin -- get the password with a context passed as a variable"
+ debug: msg="{{ lookup('credstash', 'some-password', context=context) }}"
+
+ - name: "Test credstash lookup plugin -- get the password with a context defined here"
+ debug: msg="{{ lookup('credstash', 'some-password', context=dict(app='my_app', environment='production')) }}"
If you're not using 2.0 yet, you can do something similar with the credstash tool and the pipe lookup (see below)::