Finalize ssh-ident installation & configuration.

This commit is contained in:
Glenn Y. Rolland 2015-12-31 11:20:42 +01:00
parent f810e043d6
commit adc4d19ad7
2 changed files with 39 additions and 3 deletions

View file

@ -1,8 +1,12 @@
--- ---
# defaults file for glenux.ssh-ident # defaults file for glenux.ssh-ident
sshident_users: []
# - alice
# - bob
sshident_matches: [] sshident_matches: []
# - user: # - user: johndoe
# rules: # rules:
# - regexp: "work-project-one" # - regexp: "work-project-one"
# key: work # key: work
@ -10,4 +14,5 @@ sshident_matches: []
# key: work # key: work
# - regexp: "personal" # - regexp: "personal"
# key: personal # key: personal
# # - user: ...
# rules: ...

View file

@ -7,7 +7,7 @@
install_recommends=no install_recommends=no
- name: Fetch ssh-ident sources - name: Fetch ssh-ident sources
register: ssh_ident_git register: sshident_git
git: git:
repo=https://github.com/ccontavalli/ssh-ident.git repo=https://github.com/ccontavalli/ssh-ident.git
dest=/usr/local/src/ssh-ident dest=/usr/local/src/ssh-ident
@ -20,3 +20,34 @@
dest=/usr/local/bin/ssh-ident dest=/usr/local/bin/ssh-ident
state=link state=link
# TODO: for each ssh-ident user, add links & bashrc thing
- name: Install for users
file:
path=~{{item}}/bin
state=directory
with_items: sshident_users
- file:
src=/usr/local/bin/ssh-ident
dest=~{{item}}/bin/ssh
state=link
with_items: sshident_users
- lineinfile:
dest=~{{item}}/.bashrc
regexp=^alias.scp=
line='alias scp="BINARY_SSH=scp /usr/local/bin/ssh-ident"'
become: true
become_user: "{{item}}"
with_items: sshident_users
- lineinfile:
dest=~{{item}}/.bashrc
regexp=^alias.rsync=
line='alias scp="BINARY_SSH=rsync /usr/local/bin/ssh-ident"'
become: true
become_user: "{{item}}"
with_items: sshident_users