summaryrefslogtreecommitdiff
path: root/ansible/roles/trove-setup/tasks/known-hosts-setup.yml
blob: b3e268a98dbea4f77f024d431e871ce5fff3834d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Depends on:
# - check.yml
# Uses sshknownhosts module from:
#   https://github.com/bfmartin/ansible-sshknownhosts
---
- name: Add localhost to /etc/ssh/ssh_known_hosts
  sshknownhosts: host=localhost state=present

# We avoid trying to scan UPSTREAM_TROVE's host keys unless the user explicitly
# configured Lorry Controller to access it over SSH. It's possible that the
# Trove is behind a proxy that blocks SSH traffic, and if this step fails then
# the whole trove-setup.service will fail.
- name: Add {{ UPSTREAM_TROVE }} to /etc/ssh/ssh_known_hosts
  sshknownhosts: host={{ UPSTREAM_TROVE }} state=present
  when: UPSTREAM_TROVE_PROTOCOL == ssh