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 + +