This repository has been archived on 2024-05-11. You can view files and clone it, but cannot push or open issues or pull requests.
eae-am-deutschen-platz/playbook_create_ssh_config.yml

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