diff --git a/defaults/main.yml b/defaults/main.yml index 34e9fd2..223b8be 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -120,3 +120,8 @@ hosts_entries: [] hosts_file_snippets: [] system_ipV6_disable: true + +system_ssh_custom_host: +# - host: +# user: +# keyfile: diff --git a/tasks/ssh.yml b/tasks/ssh.yml index 8a90100..2bb6aac 100644 --- a/tasks/ssh.yml +++ b/tasks/ssh.yml @@ -1,6 +1,6 @@ - name: copy ssh config for user become: true - copy: + template: dest: /home/{{ item }}/.ssh/ src: "ssh/config" force: true diff --git a/files/ssh/config b/templates/ssh/config.j2 similarity index 90% rename from files/ssh/config rename to templates/ssh/config.j2 index 4e6113d..be4639b 100644 --- a/files/ssh/config +++ b/templates/ssh/config.j2 @@ -48,3 +48,9 @@ Hostname git.ducamps.win User git IdentityFile ~/.ssh/id_gitea +{% for host in system_ssh_custom_host %} +Host {{ host.host }} + Hostname: {{ host.host }} + User {{ host.user }} + IdentityFile {{ host.keyfile }} +{% endfor %}