From adc4d19ad76c993d37a990199ae7f781a2e7f5c8 Mon Sep 17 00:00:00 2001 From: "Glenn Y. Rolland" Date: Thu, 31 Dec 2015 11:20:42 +0100 Subject: [PATCH] Finalize ssh-ident installation & configuration. --- defaults/main.yml | 9 +++++++-- tasks/main.yml | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 9cca7ca..7624245 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,8 +1,12 @@ --- # defaults file for glenux.ssh-ident +sshident_users: [] +# - alice +# - bob + sshident_matches: [] -# - user: +# - user: johndoe # rules: # - regexp: "work-project-one" # key: work @@ -10,4 +14,5 @@ sshident_matches: [] # key: work # - regexp: "personal" # key: personal -# +# - user: ... +# rules: ... diff --git a/tasks/main.yml b/tasks/main.yml index 19fd8b1..60ad520 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -7,7 +7,7 @@ install_recommends=no - name: Fetch ssh-ident sources - register: ssh_ident_git + register: sshident_git git: repo=https://github.com/ccontavalli/ssh-ident.git dest=/usr/local/src/ssh-ident @@ -20,3 +20,34 @@ dest=/usr/local/bin/ssh-ident 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 + +