24 lines
538 B
YAML
24 lines
538 B
YAML
|
---
|
||
|
- name: generate ssh_config
|
||
|
hosts: localhost
|
||
|
connection: local
|
||
|
gather_facts: no
|
||
|
tasks:
|
||
|
- name: generate ssh_config file
|
||
|
copy:
|
||
|
content: |
|
||
|
{% for host in hostvars %}
|
||
|
Host {{ host }}
|
||
|
User root
|
||
|
Hostname {{ hostvars[host]["ip"] }}
|
||
|
|
||
|
{% endfor %}
|
||
|
dest: ~/.ssh/ffl_eae_adp_config
|
||
|
mode: 0600
|
||
|
|
||
|
- name: include custom ssh_config
|
||
|
lineinfile:
|
||
|
path: ~/.ssh/config
|
||
|
line: "Include ~/.ssh/ffl_eae_adp_config"
|
||
|
create: yes
|