ansible-role--ssh-ident/tasks/main.yml

54 lines
1.2 KiB
YAML
Raw Normal View History

2015-11-17 07:39:37 +00:00
---
# tasks file for glenux.ssh-ident
2015-11-17 09:29:34 +00:00
- name: Install devscripts
apt:
pkg=devscripts
state=present
install_recommends=no
- name: Fetch ssh-ident sources
register: sshident_git
2015-11-17 09:29:34 +00: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
# TODO: for each ssh-ident user, add links & bashrc thing
- name: Install for users
2016-04-12 22:05:04 +00:00
file: >
path="~{{item}}/bin"
state=directory
2016-04-12 22:05:04 +00:00
with_items: "{{sshident_users}}"
- file:
src=/usr/local/bin/ssh-ident
2016-04-12 22:05:04 +00:00
dest="~{{item}}/bin/ssh"
state=link
2016-04-12 22:05:04 +00:00
with_items: "{{sshident_users}}"
2016-04-12 22:05:04 +00:00
- lineinfile: >
dest="~{{item}}/.bashrc"
regexp=^alias.scp=
line='alias scp="BINARY_SSH=scp /usr/local/bin/ssh-ident"'
become: true
become_user: "{{item}}"
2016-04-12 22:05:04 +00:00
with_items: "{{sshident_users}}"
- lineinfile:
2016-04-12 22:05:04 +00:00
dest="~{{item}}/.bashrc"
regexp=^alias.rsync=
line='alias scp="BINARY_SSH=rsync /usr/local/bin/ssh-ident"'
become: true
become_user: "{{item}}"
2016-04-12 22:05:04 +00:00
with_items: "{{sshident_users}}"