diff options
author | Oliver Smith <osmith@sysmocom.de> | 2022-11-28 13:27:43 +0100 |
---|---|---|
committer | Oliver Smith <osmith@sysmocom.de> | 2022-11-28 14:13:34 +0100 |
commit | 1a3ee201413f3d5113874eeb708a23b05ae1808c (patch) | |
tree | 7dea493999272b5add1d49cc2bb7243c6353b166 | |
parent | 9fbcd1c35b57c522f81bb0ad847103784399fd9b (diff) |
ansible/jenkins: add gerrit ssh key to known_hosts
Add the key to known hosts to prevent host key verification failed
errors when attempting to use the gerrit API from jenkins (to post
review comments) or when attempting to clone over ssh from gerrit (as
we do for some reason apparently).
Change-Id: I50981f201c5ca1425e30677b2578491f5111fc0c
-rw-r--r-- | ansible/roles/osmocom-jenkins-slave/tasks/main.yml | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ansible/roles/osmocom-jenkins-slave/tasks/main.yml b/ansible/roles/osmocom-jenkins-slave/tasks/main.yml index 2623201..e5ebbe1 100644 --- a/ansible/roles/osmocom-jenkins-slave/tasks/main.yml +++ b/ansible/roles/osmocom-jenkins-slave/tasks/main.yml @@ -22,11 +22,18 @@ shell: /bin/bash uid: 1000 -- name: setup jenkins ssh key +- name: setup jenkins ssh key (authorized_keys) authorized_key: user: "{{ jenkins_user }}" key: "{{ lookup('file', 'jenkins.osmocom.org.pub') }}" +- name: setup gerrit ssh key (known_hosts) + known_hosts: + name: '[gerrit.osmocom.org]:29418' + key: '[gerrit.osmocom.org]:29418 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDI4wZwtcGz2V98iZWWEtsA162PolLtgQTBjnC14ONzZGQkTh9bTPsoSxnM5TKOm4F2bzq7gb+Qrsj4ZECD19qztmD37kMP9jn7/2i1V8oLAy9ojyklXAdBVTliQteVI7ieDOyKCnGbszvFWXY2isoO1k7yJLv0QyL7F5AuZlxeHw==' + path: /etc/ssh/ssh_known_hosts + state: present + - name: install ttcn3 dependencies include_tasks: ttcn3-slave.yml when: ttcn3_slave and ansible_distribution == 'Debian' and ansible_distribution_version|int >= 9 and not (ansible_architecture == "armv7l" or ansible_architecture == "arm64") |