Last active
January 26, 2016 17:26
-
-
Save mrchrisadams/a617c62e6d2898298dd9 to your computer and use it in GitHub Desktop.
Getting pointers on updating a deploy role for ansible
This file contains 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
- name: add deploy key for deploy user, if there is one | |
copy: > | |
src={{ deploy_user_ssh_priv_key_path }} | |
dest=/home/{{ deploy_user_name }}/.ssh/deploy | |
mode=600 | |
owner={{ deploy_user_name}} | |
group={{ deploy_user_name }} | |
sudo: yes | |
when: deploy_user_ssh_priv_key_path |
This file contains 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
- name: check that a deploy_key exists | |
stat: > | |
path=deploy_user_ssh_priv_key_path | |
run_once: true | |
delegate_to: localhost | |
register: deploy_key_exists | |
- name: add deploy key for deploy user, if there is one | |
copy: | |
src: {{ deploy_user_ssh_priv_key_path }} | |
dest: /home/{{ deploy_user_name }}/.ssh/deploy | |
mode: 600 | |
owner: {{ deploy_user_name}} | |
group: {{ deploy_user_name }} | |
sudo: yes | |
when: deploy_key.exists |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment