Try to fix creation of ssh-bastion.conf

This commit is contained in:
Alexander Block 2016-12-21 11:16:30 +01:00
parent 11380769cd
commit 7bf1e9708f
2 changed files with 6 additions and 3 deletions

View file

@ -16,3 +16,9 @@
- name: create ssh bastion conf
become: false
template: src=ssh-bastion.conf dest="{{ playbook_dir }}/ssh-bastion.conf"
when: has_bastion
- name: create empty bastion conf in case no bastion is used
become: false
copy: content="" dest="{{ playbook_dir }}/ssh-bastion.conf"
when: not has_bastion

View file

@ -1,6 +1,4 @@
{% if has_bastion %}
{% set vars={'hosts': ''} %}
{% set user='' %}
{% for h in groups['all'] %}
{% if h != 'bastion' %}
@ -18,4 +16,3 @@ Host {{ bastion_ip }}
Host {{ vars['hosts'] }}
ProxyCommand ssh -W %h:%p {{ real_user }}@{{ bastion_ip }}
StrictHostKeyChecking no
{% endif %}