summaryrefslogtreecommitdiff
path: root/ansible/roles/trove-setup/tasks/gitano-mason-setup.yml
blob: 8439078a4dc64db7252375ff469469a7374b336b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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