Skip to content

Instantly share code, notes, and snippets.

Created May 29, 2017 12:50
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 anonymous/78c3d4b3bc44eb80c7d9b0e80794d810 to your computer and use it in GitHub Desktop.
Save anonymous/78c3d4b3bc44eb80c7d9b0e80794d810 to your computer and use it in GitHub Desktop.
# This is an very poor solution.
# Don't use it.
# file: pillar/top.sls
##################################
base:
'*':
- default
- users
'fqdn:{{salt['grains.get']('fqdn') }}':
- match: grain
- fqdn.{{salt['grains.get']('fqdn').split('.')|join('_')}}
##################################
# path: pillar/fqdn/
# file: hostname_domain_com.sls
##################################
# As you can see here i use grains to get FQDN from minion and then match that
# to a file in pillar/fqdn/*.sls
#
# Reason for this is that i can overwrite pillars in pillar/default.sls
#
# How ever in case that a server is going to use pillar/default.sls it still needs a file
# in pillar/fqdn/ that matches its FQDN name that is empty. This causes some frustration.
#
# Problem:
# 1. In case /pillar/fqdn/hostname_domain_com.sls is missing it should just ignore it.
#
# 2. Files that are located in pillar/fqdn are named hostname_domain_com.sls becuase salt uses dots
# as sub-dir. This looks bad in the infra structure and is not ideal by any means.
#
# Suggestions on how to solve the 2 above problems would be greatly appritiated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment