Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {% set user = "" %}
- {% set group = "" %}
- {% set team = "" %}
- {% set repo_name = "" %}
- {% set deployment_key_path = "/home/" + user + "/.ssh/deployment_key_rsa" %}
- # this works
- git:
- pkg.installed
- # this works
- github.com known host for {{ user }}:
- ssh_known_hosts.present:
- - user: {{ user }}
- - name: github.com
- - fingerprint: 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48
- # this works (key looks exactly like it should)
- deployment key {{ deployment_key_path }}:
- file.managed:
- - name: {{ deployment_key_path }}
- # - contents_pillar: deployment_key
- - mode: 0600
- - user: {{ user }}
- - group: {{ group }}
- # this fails
- update repository {{ team }}/{{ repo_name }}:
- git.latest:
- - name: ssh://git@github.com:{{ team }}/{{ repo_name }}.git
- - user: {{ user }}
- - target: /opt/git/{{ repo_name }}
- - identity: {{ deployment_key_path }}
- - require:
- - pkg: git
- - ssh_known_hosts: github.com
- - file: {{ deployment_key_path }}
- # output: (note: repository is private, hence the not found)
- ----------
- ...
- [INFO ] Running state [ssh://git@github.com:<snip>/<snip>.git] at time 01:05:23.911302
- [INFO ] Executing state git.latest for ssh://git@github.com:<snip>/<snip>.git
- [INFO ] Checking remote revision for ssh://git@github.com:<snip>/<snip>.git
- [INFO ] Attempting git authentication using identity file /home/<snip>/.ssh/deployment_key_rsa
- [INFO ] Executing command ['git', 'ls-remote', 'ssh://git@github.com:<snip>/<snip>.git'] as user '<snip>' in directory '/home/<snip>'
- [ERROR ] Command ['git', 'ls-remote', 'ssh://git@github.com:<snip>/<snip>.git'] failed with return code: 128
- [ERROR ] stderr: ERROR: Repository not found.
- ID: update repository <snip>/<snip>
- Function: git.latest
- Name: ssh://git@github.com:<snip>/<snip>.git
- Result: False
- Comment: Failed to check remote refs: Unable to authenticate using identity file:
- ERROR: Repository not found.
- fatal: Could not read from remote repository.
- Please make sure you have the correct access rights
- and the repository exists.
- Started: 01:05:23.911302
- Duration: 941.62 ms
- Changes:
- ### salt version:
- Salt Version:
- Salt: 2015.8.8.2
- Dependency Versions:
- Jinja2: 2.8
- M2Crypto: Not Installed
- Mako: Not Installed
- PyYAML: 3.11
- PyZMQ: 14.4.0
- Python: 2.7.9 (default, Mar 1 2015, 12:57:24)
- RAET: Not Installed
- Tornado: 4.2.1
- ZMQ: 4.0.5
- cffi: 0.8.6
- cherrypy: Not Installed
- dateutil: 2.5.3
- gitdb: Not Installed
- gitpython: Not Installed
- ioflo: Not Installed
- libgit2: Not Installed
- libnacl: Not Installed
- msgpack-pure: Not Installed
- msgpack-python: 0.4.2
- mysql-python: 1.2.3
- pycparser: 2.10
- pycrypto: 2.6.1
- pygit2: Not Installed
- python-gnupg: 0.3.8
- smmap: Not Installed
- timelib: Not Installed
- System Versions:
- dist: debian 8.1
- machine: x86_64
- release: 3.16.0-4-amd64
- system: debian 8.1
Add Comment
Please, Sign In to add comment