tripleo-quickstart/roles/tripleo-inventory/templates/ssh_config.j2

67 lines
1.9 KiB
Django/Jinja

Host *
IdentitiesOnly yes
{% if hostvars[groups['virthost'][0]].ansible_private_key_file is defined %}
Host virthost
Hostname {{ hostvars[groups['virthost'][0]].ansible_host }}
IdentityFile {{ hostvars[groups['virthost'][0]].ansible_private_key_file }}
User {{ ssh_user }}
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
{% else %}
Host virthost
Hostname {{ hostvars['localhost'].ansible_default_ipv4.address }}
IdentityFile {{ local_working_dir }}/id_rsa_virt_power
User {{ ssh_user }}
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
{% endif %}
Host undercloud-root
{% if undercloud_type == 'virtual' %}
ProxyCommand {{ undercloud_ssh_proxy_command }}
{% else %}
Hostname {{ undercloud_ip }}
{% endif %}
IdentityFile {{ hostvars['undercloud'].ansible_private_key_file }}
User root
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
Host undercloud
{% if undercloud_type == 'virtual' %}
ProxyCommand {{ undercloud_ssh_proxy_command }}
{% else %}
Hostname {{ undercloud_ip }}
{% endif %}
IdentityFile {{ hostvars['undercloud'].ansible_private_key_file }}
User {{ undercloud_user }}
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
{% if deploy_supplemental_node %}
Host supplemental
ProxyCommand {{ supplemental_ssh_proxy_command }}
IdentityFile {{ local_working_dir }}/id_rsa_supplemental
User {{ supplemental_user }}
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
{% endif %}
{% if groups["overcloud"] is defined %}
{% for host in groups["overcloud"] %}
Host {{ host }}
ProxyCommand ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o ConnectTimeout=60 -F {{ local_working_dir }}/ssh.config.ansible undercloud -W {{ hostvars[host].ansible_fqdn }}:22
IdentityFile {{ hostvars[host].ansible_private_key_file }}
User heat-admin
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
{% endfor %}
{% endif %}