From b025c8a1690911a25fe1d41bc6771f4ad2e31b47 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Thu, 23 Aug 2018 17:25:03 +0200 Subject: [PATCH] Ssh shortcuts --- files/sshconfig | 51 ++++++++++++++++++++++++++++++++++++++++++++++ tasks/dotfiles.yml | 14 +++++++++++++ 2 files changed, 65 insertions(+) create mode 100755 files/sshconfig diff --git a/files/sshconfig b/files/sshconfig new file mode 100755 index 0000000..160c564 --- /dev/null +++ b/files/sshconfig @@ -0,0 +1,51 @@ +# ---------------------------------------- +# Fichier de configuration de ssh du point de vu utilisateur +# ---------------------------------------- + +# ---------------------------------------- +# Connection à Kimsufi +Host kimsufi + HostName ns3096799.ip-94-23-52.eu + User lafrite + ForwardAgent yes + PubkeyAcceptedKeyTypes * + identityfile ~/.ssh/id_dsa_kim + +Host Embrevade + HostName 5.196.95.88 + User waha + Port 22 + ForwardAgent yes + PubkeyAcceptedKeyTypes * + identityfile ~/.ssh/id_ed25519_embrevade + IdentitiesOnly yes + +Host git_opytex + HostName git.opytex.org + User git + Port 2222 + identityfile ~/.ssh/id_rsa_git + IdentitiesOnly yes + +Host github + HostName github.com + User git + ForwardAgent yes + PubkeyAcceptedKeyTypes * + identityfile ~/.ssh/id_dsa_noPass + +Host Songe + HostName songe + User waha + Port 22 + ForwardAgent yes + PubkeyAcceptedKeyTypes * + identityfile ~/.ssh/id_ed25519_home + IdentitiesOnly yes + +Host Choux + HostName Choux + User lafrite + ForwardAgent yes + identityfile ~/.ssh/id_ed25519_home + PubkeyAcceptedKeyTypes * diff --git a/tasks/dotfiles.yml b/tasks/dotfiles.yml index 36010ad..d6a8236 100644 --- a/tasks/dotfiles.yml +++ b/tasks/dotfiles.yml @@ -76,3 +76,17 @@ owner: "{{ item.username }}" with_items: "{{ me }}" when: not minimal + +- name: Creates .ssh + file: + path: /home/{{ item.username }}/.ssh/ + state: directory + with_items: "{{ me }}" + +- name: Copy ssh user config + template: + src: files/sshconfig + dest: /home/{{ item.username }}/.ssh/config + owner: "{{ item.username }}" + with_items: "{{ me }}" +