Skip to content

Instantly share code, notes, and snippets.

@darkone23
Last active December 24, 2015 00:19
Show Gist options
  • Select an option

  • Save darkone23/6716338 to your computer and use it in GitHub Desktop.

Select an option

Save darkone23/6716338 to your computer and use it in GitHub Desktop.
- hosts: localhost
connection: local
vars:
special: '{{ hostvars[inventory_hostname]["ansible_" + cluster_interface]["ipv4"]["address"] }}'
tasks:
- set_fact: {cluster_interface: eth0}
- name: reading special var
debug: msg={{ special }}
- shell: echo {{ special }} > ansible.out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment