Using a Git Repository as a Pillar source in SaltStack
-
This is the page that got me up and running using GitLab as my Pillar source in Salt: https://docs.saltstack.com/en/latest/ref/pillar/all/salt.pillar.git_pillar.html#module-salt.pillar.git_pillar
More specifically, this section here: https://docs.saltstack.com/en/latest/ref/pillar/all/salt.pillar.git_pillar.html#configuring-git-pillar-for-salt-releases-2015-8-0-and-later
And finally, this page for using Pillars. Don't use this one for setting it up with GitLab: https://docs.saltstack.com/en/latest/topics/tutorials/pillar.html#pillar-walkthrough
In my GitLab, it's
salt/pillars
.I added the following to my
/etc/salt/master.d/custom.conf
file:ext_pillar: - git: - master [email protected]:username/salt.git: - root: pillars - pubkey: /etc/salt/master.d/ssh-git-ro.pub - privkey: /etc/salt/master.d/ssh-git-ro.priv
My
salt/pillars/top.sls
file:{{saltenv}}: '*': - data
Note that the above
top.sls
is just a test. It assigns thesalt/pillars/data.sls
file to all minions.My
data.sls
file only contains the following:info: some data
Now you can start using Pillar data in States as shown in that last link, the Walkthrough.
And for Pillar encryption: https://docs.saltstack.com/en/latest/topics/pillar/#pillar-encryption