- - blockinfile:
- dest: /etc/ssh/ssh_config
- marker: '# ANSIBLE SSH CONFIG {mark}'
- block: |-
- {% for host in ssh_config_hosts %}
- {% set host_config = ssh_config_hosts[host] %}
- Host {{host}}
- {% if host_config.hostname is defined %}
- HostName {{host_config.hostname}}
- {% endif %}
- {% endfor %}
- become: yes
|