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
Post a Comment