Try to fix creation of ssh-bastion.conf
This commit is contained in:
parent
11380769cd
commit
7bf1e9708f
2 changed files with 6 additions and 3 deletions
|
@ -16,3 +16,9 @@
|
||||||
- name: create ssh bastion conf
|
- name: create ssh bastion conf
|
||||||
become: false
|
become: false
|
||||||
template: src=ssh-bastion.conf dest="{{ playbook_dir }}/ssh-bastion.conf"
|
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
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
{% if has_bastion %}
|
|
||||||
{% set vars={'hosts': ''} %}
|
{% set vars={'hosts': ''} %}
|
||||||
{% set user='' %}
|
|
||||||
|
|
||||||
{% for h in groups['all'] %}
|
{% for h in groups['all'] %}
|
||||||
{% if h != 'bastion' %}
|
{% if h != 'bastion' %}
|
||||||
|
@ -18,4 +16,3 @@ Host {{ bastion_ip }}
|
||||||
Host {{ vars['hosts'] }}
|
Host {{ vars['hosts'] }}
|
||||||
ProxyCommand ssh -W %h:%p {{ real_user }}@{{ bastion_ip }}
|
ProxyCommand ssh -W %h:%p {{ real_user }}@{{ bastion_ip }}
|
||||||
StrictHostKeyChecking no
|
StrictHostKeyChecking no
|
||||||
{% endif %}
|
|
Loading…
Reference in a new issue