Last active
August 29, 2015 14:15
-
-
Save keeth/0c9b9b628041c63ea381 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {{ pillar['git_deploy_keys'][repo][type] }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% for repo in pillar.get('git_deploy_keys', {}) %} | |
| {% for type in ['private'] %} | |
| git-deploy-key-{{ repo }}-{{ type }}-pem: | |
| file.managed: | |
| - name: /root/.ssh/id_rsa_{{ repo }}.{{ type }} | |
| - source: salt://files/git_deploy_key.pem | |
| - template: jinja | |
| - user: root | |
| - group: root | |
| - mode: 600 | |
| - defaults: | |
| repo: {{ repo }} | |
| type: {{ type }} | |
| {% endfor %} | |
| {% endfor %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git_deploy_keys: | |
| cms: | |
| private: | | |
| -----BEGIN RSA PRIVATE KEY----- | |
| -----END RSA PRIVATE KEY----- | |
| salt: | |
| private: | | |
| -----BEGIN RSA PRIVATE KEY----- | |
| -----END RSA PRIVATE KEY----- | |
| secrets: | |
| private: | | |
| -----BEGIN RSA PRIVATE KEY----- | |
| -----END RSA PRIVATE KEY----- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ssh: | |
| aliases: | |
| github-salt: | |
| HostName: github.com | |
| User: git | |
| IdentityFile: /root/.ssh/id_rsa_salt.private | |
| github-cms: | |
| HostName: github.com | |
| User: git | |
| IdentityFile: /root/.ssh/id_rsa_cms.private | |
| github-secrets: | |
| HostName: github.com | |
| User: git | |
| IdentityFile: /root/.ssh/id_rsa_secrets.private |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {%- set hosts = salt['pillar.get']('ssh:aliases') -%} | |
| {%- if hosts %} | |
| {%- for host, options in hosts.items() %} | |
| Host {{ host }} | |
| {%- for k, v in options.items() %} | |
| {{ k }} {{ v }} | |
| {%- endfor %} | |
| {% endfor %} | |
| {%- endif -%} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ssh_config: | |
| file.managed: | |
| - name: /root/.ssh/config | |
| - source: salt://files/ssh_config.jinja | |
| - template: jinja | |
| - user: root | |
| - group: root | |
| - mode: 600 | |
| github.com: | |
| ssh_known_hosts: | |
| - present | |
| - user: root | |
| - fingerprint: 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment