git.latest identity / ssh key issues
git.latest is unable to correctly use a users private key when it is setup correctly as per the SSH expectation of being unable to be read by other users.
deployment-private-keys:
file.managed:
- name: /home/example/.ssh/id_rsa
- source: salt://files/deployment_private_key
- user: example
- group: example
- mode: 600
local-mirror-of-production-code:
git.latest:
- name: [email protected]:example/example.git
- rev: master
- target: /srv/code/website/
- user: example
- identity: /home/example/.ssh/id_rsa
- require:
- pkg: git
- file: deployment-private-keys
This should work, if the git.latest function correctly operates as the user 'example' then it should have rights to view and use the private key that was set with mode 600. this is failing.
State: - git
Name: [email protected]:example/example.git
Function: latest
Result: False
Comment: Warning: Identity file /home/example/.ssh/id_rsa not accessible: Permission denied.
Found an issue with the system i was running this on. Closing the issue.
Thanks for stating what the issue you found was. Classic "nvm I figured it out" comment.
I had the same issue today. I logged with shsh and found that the user could not read the identity file because /home/chmod 700 /home/<user>/.ssh