Fabian Peter Hammerle %!s(int64=8) %!d(string=hai) anos
pai
achega
9808aaaffd
Modificáronse 2 ficheiros con 13 adicións e 0 borrados
  1. 1 0
      defaults/main.yml
  2. 12 0
      tasks/main.yml

+ 1 - 0
defaults/main.yml

@@ -0,0 +1 @@
+ssh_config_hosts: []

+ 12 - 0
tasks/main.yml

@@ -0,0 +1,12 @@
+- 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