summaryrefslogtreecommitdiff
path: root/ansible/roles/trove-setup/tasks/gitano-lorry-setup.yml
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2014-06-18 10:16:41 +0000
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2014-07-14 15:02:10 +0000
commite6bf7b4b32d477352cf45b4b0abb6993d524f78a (patch)
tree1a640eb2acd18e903e85923bab3fcd7d3e40392e /ansible/roles/trove-setup/tasks/gitano-lorry-setup.yml
parent49ddac4e61b6dca7e4b794cf639b0a1b3d86db00 (diff)
downloadtrove-setup-e6bf7b4b32d477352cf45b4b0abb6993d524f78a.tar.gz
Add Ansible scripts
Diffstat (limited to 'ansible/roles/trove-setup/tasks/gitano-lorry-setup.yml')
-rw-r--r--ansible/roles/trove-setup/tasks/gitano-lorry-setup.yml18
1 files changed, 18 insertions, 0 deletions
diff --git a/ansible/roles/trove-setup/tasks/gitano-lorry-setup.yml b/ansible/roles/trove-setup/tasks/gitano-lorry-setup.yml
new file mode 100644
index 0000000..d52927a
--- /dev/null
+++ b/ansible/roles/trove-setup/tasks/gitano-lorry-setup.yml
@@ -0,0 +1,18 @@
+# Depends on:
+# - gitano-setup.yml
+---
+- name: Check if lorry has a sshkey configured in gitano (This task can fail)
+ shell: su git -c 'ssh git@localhost as lorry sshkey' 2>&1 | grep WARNING
+ register: gitano_lorry_key
+ changed_when: False
+ ignore_errors: True
+# If lorry user doesn't have an sshkey configured
+- name: Create /home/git/keys folder to store ssh keys
+ file: path=/home/git/keys state=directory owner=git group=git
+ when: gitano_lorry_key|success
+- name: Copy LORRY_SSH_PUBKEY to /home/git/keys/lorry.key.pub
+ copy: src={{ LORRY_SSH_PUBKEY }} dest=/home/git/keys/lorry.key.pub mode=0644
+ when: gitano_lorry_key|success
+- name: Add to the gitano lorry user the /home/git/keys/lorry.key.pub
+ shell: su git -c 'ssh git@localhost as lorry sshkey add trove < /home/git/keys/lorry.key.pub'
+ when: gitano_lorry_key|success