Skip to content

Instantly share code, notes, and snippets.

@quantonganh
Created December 5, 2013 08:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quantonganh/7802125 to your computer and use it in GitHub Desktop.
Save quantonganh/7802125 to your computer and use it in GitHub Desktop.
{#-
Author: Quan Tong Anh <tonganhquan.net@gmail.com>
Maintainer: Quan Tong Anh <tonganhquan.net@gmail.com>
-#}
{% macro convert_hostname_to_ip(hostname) -%}
{% if salt['dig.A'](hostname) -%}
carbon = {{ salt['dig.A'](hostname)[0] }}:2003
{% else -%}
carbon = {{ hostname }}:2003
{%- endif %}
{%- endmacro %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment