kitchen-salt
kitchen-salt copied to clipboard
Add sshkey option for git based formula dependencies.
Hi all,
At our company we have our salt-formula's in private git repo's and need to authenticate with a deploy key before we can access them. This PR adds the possibility to use ssh deploy keys for dependencies.
You can specify a key per repo as follows:
...
suites:
- name: check31
provisioner:
name: salt_solo
is_file_root: true
loglevel: debug
require_chef: false
ssh_key: ~/.ssh/general-deploy-key
dependencies:
- name: baseline
repo: git
source: [email protected]:acme/baseline-formula.git
- name: something
repo: git
source: [email protected]:acme/something-formula.git
ssh_key: ~/.ssh/something-deploy-key
...
The only problem I have for now is that this PR needs git version >= 2.3.0 because it relies on the GIT_SSH_COMMAND
environment variable. This ssh version is for example not available on CentOS 7.
I am not a developer by trade so let me know if it needs some polishing.
Thanks for considering.
Ai, I've noticed it needs a bit more work to contruct proper commands when mixing https/ssh and authn. Please stay tuned for a update
I have added a commit with a verified pgp signature. I do not understand why the GPG is now failing?
The other commits aren't signed, that's why. If you rebase you should be fine.
@s0undt3ch, I see, I'm not sure how to proceed. I'm trying to find out how to rebase but i'm not sure how. Is the following correct?
git remote add upstream https://github.com/saltstack/kitchen-salt.git
git fetch upstream
git checkout task-add-git-ssh-deploykeys
git rebase -S upstream/master
git push --force # yikes?!
git remote add upstream https://github.com/saltstack/kitchen-salt.git
git fetch upstream
git checkout task-add-git-ssh-deploykeys
git rebase -i FETCH_HEAD
git push --force # yikes?! yes, yikes! :)
So close, yet so far... :)
The build fails now on ubuntu because: On ubuntu 16.04
W: The repository 'https://repo.saltstack.com/apt/ubuntu/16.04/amd64//latest xenial Release' does not have a Release file.
E: Failed to fetch https://repo.saltstack.com/apt/ubuntu/16.04/amd64//latest/dists/xenial/main/binary-amd64/Packages 404 Not Found
And ubuntu 18.04
[ERROR ] stderr: E: The repository 'https://repo.saltstack.com/apt/ubuntu/18.04/amd64//latest bionic Release' does not have a Release file.
[ERROR ] retcode: 100
[ERROR ] An error was encountered while checking the newest available version of package(s): E: The repository 'https://repo.saltstack.com/apt/ubuntu/18.04/amd64//latest bionic Release' does not have a Release file.
Sorry, we now have conflicts, could you please resolve them?
Back to fixing the build....
Command "/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-yFwp2Z/salt/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-G_UBTl-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-yFwp2Z/salt/