From e6bf7b4b32d477352cf45b4b0abb6993d524f78a Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Wed, 18 Jun 2014 10:16:41 +0000 Subject: Add Ansible scripts --- ansible/roles/trove-setup/tasks/gitano-mason-setup.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 ansible/roles/trove-setup/tasks/gitano-mason-setup.yml (limited to 'ansible/roles/trove-setup/tasks/gitano-mason-setup.yml') diff --git a/ansible/roles/trove-setup/tasks/gitano-mason-setup.yml b/ansible/roles/trove-setup/tasks/gitano-mason-setup.yml new file mode 100644 index 0000000..8439078 --- /dev/null +++ b/ansible/roles/trove-setup/tasks/gitano-mason-setup.yml @@ -0,0 +1,16 @@ +# Depends on: +# - gitano-setup.yml +--- +- name: Check if mason has a sshkey configured in gitano (This task can fail) + shell: su git -c 'ssh git@localhost as mason sshkey' 2>&1 | grep WARNING + register: gitano_mason_key + changed_when: False + ignore_errors: True + +# If distbuild user doesn't have an sshkey configured +- file: path=/home/git/keys state=directory owner=git group=git + when: gitano_mason_key|success +- copy: src={{ MASON_SSH_PUBKEY }} dest=/home/git/keys/mason.key.pub mode=0644 + when: gitano_mason_key|success +- shell: su git -c 'ssh git@localhost as mason sshkey add trove < /home/git/keys/mason.key.pub' + when: gitano_mason_key|success -- cgit v1.2.1