Can't find a way to authenticate for pillars in a git over ssh with gitfs
Hi,
Am setting up gitfs with an ssh access. The publickey works fine for gitfs_remotes :
gitfs_remotes:
- ssh://[email protected]/home/git/states:
- pubkey: /root/.ssh/id_rsa_gitfs.pub
- privkey: /root/.ssh/id_rsa_gitfs
but the ext_pillar doesn't seem to give the same possibility :
http://docs.saltstack.com/en/latest/topics/tutorials/gitfs.html#using-git-as-an-external-pillar-source
I tried using the .ssh/config trick but that doesn't seem to work (using a different name stored in /etc/hosts so as to enable "normal" ssh as usual between the two servers)
ext_pillar:
- git: master ssh://[email protected]/home/git/pillars
Thanks for the report. I know @terminalmage at some point wanted to get the ext_pillar in line and using basically the same code as the gitfs backend, but he's been way too busy to get to it. We'll get this fixed.
@basepi So what are the cool kids doing these days in large organizations with multiple salt-master servers and many many minions? How do we share and version control Salt state files, pillar, etc...?
I was thinking I would try using the gitfs backend for both states and pillar by specifying the same Git repo with two different subdirectory/roots specified (i.e. repo/salt and repo/pillar).
@juanqui That could totally work. I think gitfs is definitely the go-to, but I bet most organizations have separate state and pillar repos. The pillar repos have much more sensitive data in them.
.ssh/config & git ext_pillar work great for me.
ext_pillar:
- git: master git@github-salt:sprightco/salt.git root=pillar
- git: master git@github-secrets:sprightco/secrets.git root=pillar
Host github-secrets
IdentityFile /root/.ssh/id_rsa_secrets.private
HostName github.com
User git
Host github-salt
IdentityFile /root/.ssh/id_rsa_salt.private
HostName github.com
User git
Make sure there's an entry for your git hostname (github.com in our case) in your known_hosts file, and that everything in .ssh has the correct permissions.
+1; would be great to have ext_pillar git options be the same as gitfs; was looking to nuke my ~/.ssh/config file only to find out that my git ext_pillar stopped working :(
+1; it's often to have sensitive info in the pillar, so the repository should be protected too, having gitfs with auth for the states but not pillars seems strange :)
This is actually supported, starting in 2015.8. Basically, @terminalmage rewrote git_pillar for 2015.8.0 so that it shares the same codebase and functionality as gitfs. So git_pillar is in line with gitfs starting in that version.
Here are some relevant docs: http://docs.saltstack.com/en/develop/ref/pillar/all/salt.pillar.git_pillar.html#configuring-git-pillar-for-salt-releases-2015-8-0-and-later
I'm going to close this as resolved.