2015-11-17 08:39:37 +01:00
|
|
|
---
|
|
|
|
# tasks file for glenux.ssh-ident
|
2015-11-17 10:29:34 +01:00
|
|
|
- name: Install devscripts
|
|
|
|
apt:
|
|
|
|
pkg=devscripts
|
|
|
|
state=present
|
|
|
|
install_recommends=no
|
|
|
|
|
|
|
|
- name: Fetch ssh-ident sources
|
2015-12-31 11:20:42 +01:00
|
|
|
register: sshident_git
|
2015-11-17 10:29:34 +01:00
|
|
|
git:
|
|
|
|
repo=https://github.com/ccontavalli/ssh-ident.git
|
|
|
|
dest=/usr/local/src/ssh-ident
|
|
|
|
update=yes
|
|
|
|
accept_hostkey=yes
|
|
|
|
|
|
|
|
- name: Install ssh-ident globally
|
|
|
|
file:
|
|
|
|
src=/usr/local/src/ssh-ident/ssh-ident
|
|
|
|
dest=/usr/local/bin/ssh-ident
|
|
|
|
state=link
|
|
|
|
|
2015-12-31 11:20:42 +01:00
|
|
|
# TODO: for each ssh-ident user, add links & bashrc thing
|
|
|
|
- name: Install for users
|
2016-04-13 00:05:04 +02:00
|
|
|
file: >
|
|
|
|
path="~{{item}}/bin"
|
2015-12-31 11:20:42 +01:00
|
|
|
state=directory
|
2016-04-13 00:05:04 +02:00
|
|
|
with_items: "{{sshident_users}}"
|
2015-12-31 11:20:42 +01:00
|
|
|
|
|
|
|
- file:
|
|
|
|
src=/usr/local/bin/ssh-ident
|
2016-04-13 00:05:04 +02:00
|
|
|
dest="~{{item}}/bin/ssh"
|
2015-12-31 11:20:42 +01:00
|
|
|
state=link
|
2016-04-13 00:05:04 +02:00
|
|
|
with_items: "{{sshident_users}}"
|
2015-12-31 11:20:42 +01:00
|
|
|
|
2016-04-13 00:05:04 +02:00
|
|
|
- lineinfile: >
|
|
|
|
dest="~{{item}}/.bashrc"
|
2015-12-31 11:20:42 +01:00
|
|
|
regexp=^alias.scp=
|
|
|
|
line='alias scp="BINARY_SSH=scp /usr/local/bin/ssh-ident"'
|
|
|
|
become: true
|
|
|
|
become_user: "{{item}}"
|
2016-04-13 00:05:04 +02:00
|
|
|
with_items: "{{sshident_users}}"
|
2015-12-31 11:20:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
- lineinfile:
|
2016-04-13 00:05:04 +02:00
|
|
|
dest="~{{item}}/.bashrc"
|
2015-12-31 11:20:42 +01:00
|
|
|
regexp=^alias.rsync=
|
|
|
|
line='alias scp="BINARY_SSH=rsync /usr/local/bin/ssh-ident"'
|
|
|
|
become: true
|
|
|
|
become_user: "{{item}}"
|
2016-04-13 00:05:04 +02:00
|
|
|
with_items: "{{sshident_users}}"
|
2015-12-31 11:20:42 +01:00
|
|
|
|
|
|
|
|