Skip to content

Commit

Permalink
nit: Correct the used SSH key in ansible inventory
Browse files Browse the repository at this point in the history
We were missing the right ssh key configuration in the generated ansible
inventory, leading to "some" issues.

We also ensure ansible won't complain about the remote host keys. A
better solution might come later, once we're over the deep network
refactoring
  • Loading branch information
cjeanner committed May 28, 2024
1 parent 801d347 commit b3e7d04
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions roles/libvirt_manager/templates/inventory.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
{{ host.nic.host }}:
ansible_host: {{ (host.stdout.split())[3] | ansible.utils.ipaddr('address') }}
ansible_user: {{ admin_user }}
{% if vm_type is match('^crc.*') %}
ansible_ssh_common_args: '-o StrictHostKeyChecking=no'
{% if vm_type is match('^crc.*') %}
ansible_ssh_private_key_file: ~/.ssh/crc_key
{% endif %}
{% if vm_type is match('^ocp.*') %}
{% elif vm_type is match('^ocp.*') %}
ansible_ssh_private_key_file: ~/.ssh/devscripts_key
{% endif %}
{% else %}
ansible_ssh_private_key_file: ~/.ssh/id_cifw
{% endif %}
{% endfor %}

0 comments on commit b3e7d04

Please sign in to comment.