-
Notifications
You must be signed in to change notification settings - Fork 0
/
printvars.yml
44 lines (37 loc) · 1.34 KB
/
printvars.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
- name: This playbook test various variable definitions
hosts: all
gather_facts: no
tasks:
- name: Include vault variables
include_vars:
dir: vault
extensions:
- 'yaml'
- 'yml'
- name: Ping the host for testing
ping:
- name: Display encrypted variable value defined for all hosts in the inventory
debug:
msg: "encrypted_var has a value of '{{ encrypted_var }}'"
when: encrypted_var is defined
- name: Display encrypted variable value defined in this playbook repository (vault/)
debug:
msg: "playbook_vault_variable: {{ playbook_vault_variable }}"
when: playbook_vault_variable is defined
# this does not work with automationcontroller
#
# - name: Display vault_encrypted variable value
# debug:
# msg: "encrypted_var has a value of '{{ encrypted_vault_var }}'"
- name: Display host group names
debug:
msg: "This host is in the following groups: {{ group_names }}"
- name: Display a group variable
debug:
msg: "This has a group_variable defined with the value: {{ group_variable }}"
when: group_variable is defined
- name: Display a host variable
debug:
msg: "This has a host_variable defined with the value: {{ host_variable }}"
when: host_variable is defined