salt stack - SaltStack : Identify environment with DNS record -


i have multiple isolated environments setup saltstack. have created base states , custom states each environment. moment, way can identify environment requesting txt record on dns server. there way can select right environment in saltstack. how can put information in pillar or grain?

salt's dig module might here. can use query information dns records. needs command line dig tool installed.

use command line:

salt-call dig.txt google.com 

to produce output this:

local:     - "v=spf1 include:_spf.google.com ~all" 

use salt state put grain:

# setupgrain.sls mygrainname:   grains.present:     - value: {{ salt['dig.txt']('google.com') }} 

once have information in grain can select salt nodes on grain information using matchers.


Comments

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Using jquery append to add option values into a select element not working -

javascript - Restarting Supervisor and effect on FlaskSocketIO -