Skip to content

Instantly share code, notes, and snippets.

@tairov
Created May 10, 2018 12:50
Show Gist options
  • Save tairov/303037747c962caaa8108af9e5c83de2 to your computer and use it in GitHub Desktop.
Save tairov/303037747c962caaa8108af9e5c83de2 to your computer and use it in GitHub Desktop.
Ansible vars
k8s-host:
vars:
definition: "definition from k8s-host"
hosts:
k8s-deployment-host:
vars:
definition: "definition from k8s-deployment-host"
k8s-deployment-host:
vars:
definition: "definition from separate k8s-deployment-host"
TASK [k8s-host : debug] ************************************************************************************************************************************************************************************
task path: my-central-jervis/ansible/roles/k8s-host/tasks/deployment.yml:2
ok: [k8s-deployment-host] => {
"definition": "definition from k8s-host"
}
TASK [k8s-host : debug] ************************************************************************************************************************************************************************************
task path: my-central-jervis/ansible/roles/k8s-host/tasks/deployment.yml:3
ok: [k8s-deployment-host] => {
"inventory_hostname": "k8s-deployment-host"
}
---
- debug: var=definition
- debug: var=inventory_hostname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment