Skip to content

Instantly share code, notes, and snippets.

@mikequentel
Created February 13, 2017 16:28
Show Gist options
  • Save mikequentel/5cec6d01dc7e9a6d17c9f3c5e3d431a0 to your computer and use it in GitHub Desktop.
Save mikequentel/5cec6d01dc7e9a6d17c9f3c5e3d431a0 to your computer and use it in GitHub Desktop.
---
# Assuming there is a roles pattern in use,
# including subdirectory roles with
# roles/vars/main.yml (for storing variables in roles/vars/main.yml)
# and roles/example/main.yml
#
# top-level playbook example.yml looks like:
# ---
#
#- hosts: myhost
# roles:
# - example
#
# the underlying tasks at roles/example/main.yml looks like:
#
- name: echo_vars
command: echo "{{vars[item]}}"
with_items: "{{vars}}"
register: output_echo_vars
- debug: var=output_echo_vars.stdout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment