Created
February 2, 2018 12:33
-
-
Save ryanwalder/3b069607a5d7c333d4811e830df91147 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% set id = salt.grains.get('id') %} | |
{% set sid = id.split('.')[0] %} | |
{%- set use = sid[0:3] %} | |
{%- set platform = sid[3:6] %} | |
{%- set component = sid[6:9] %} | |
{%- set os = sid[9] %} | |
{%- set number = sid[10:12] %} | |
{%- set env = sid[12] %} | |
{%- set domain = id.split('.')[1:]|join('.') %} | |
{# If in vagrant use interface1 for things as iface0 is used for vagrant | |
stuff, everywhere else use interface0 #} | |
{% if env == 'v' %} | |
{% set iface0 = 'enp0s3' %} | |
{% else %} | |
{% set iface0 = 'ens160' %} | |
{% endif %} | |
{%- set map = { | |
'use': use, | |
'platform': platform, | |
'component': component, | |
'os': os, | |
'number': number, | |
'env': env, | |
'domain': domain, | |
'timezone': 'Europe/London', | |
'salt_version': '2017.7.2', | |
'iface0': iface0, | |
'user_ids': { | |
'jenkins': { | |
'uid': '5022', | |
'gid': '5022', | |
}, | |
}, | |
} %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% from 'global/map.jinja' import map with context %} | |
# NOTE: Ordering of the file lookups below is very important! | |
# If you define the same pillar keypairs in multiple files the last loaded wins | |
# This allows defaults to be set higher up with per component, platform, and env overrides | |
base: | |
'*': | |
- 'global' | |
- 'global.virt.{{ salt.grains.get('virtual')|lower }}' | |
- 'global.os.{{ salt.grains.get('os_family')|lower }}' | |
- 'global.os.{{ salt.grains.get('os_family')|lower }}.{{ salt.grains.get('oscodename')|lower }}' | |
- 'global.environment.{{ map.env }}' | |
- 'global.environment.{{ map.env }}.anti' | |
- 'global.component.{{ map.component }}' | |
- '{{ map.platform }}' | |
- '{{ map.platform }}.{{ map.env }}' | |
- '{{ map.platform }}.{{ map.env }}.anti' | |
- '{{ map.platform }}.{{ map.component }}' | |
- '{{ map.platform }}.{{ map.component }}.{{ map.number }}' | |
- '{{ map.platform }}.{{ map.component }}.{{ map.env }}' | |
- '{{ map.platform }}.{{ map.component }}.{{ map.env }}.anti' | |
- '{{ map.platform }}.{{ map.component }}.{{ map.env }}.{{ map.number }}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment