Ssh shortcuts

This commit is contained in:
Bertrand Benjamin 2018-08-23 17:25:03 +02:00
parent 87bdfdcd23
commit b025c8a169
2 changed files with 65 additions and 0 deletions

51
files/sshconfig Executable file
View File

@ -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 *

View File

@ -76,3 +76,17 @@
owner: "{{ item.username }}" owner: "{{ item.username }}"
with_items: "{{ me }}" with_items: "{{ me }}"
when: not minimal 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 }}"