Add provisioning for bashrc* files.

This commit is contained in:
Glenn Y. Rolland 2015-11-17 14:20:58 +01:00
parent 0609db4265
commit 27bcd77840
2 changed files with 31 additions and 12 deletions

12
files/bashrc Normal file
View file

@ -0,0 +1,12 @@
##
## BASH RC - every new shell
## 
if [ -d "$HOME/.bashrc.d" ]; then
for script in $(find "$HOME/.bashrc.d/" -name '*.sh' |sort -n) ; do
# echo "Loading `basename \"$script\"`..." # >&2
. $script
done
fi

View file

@ -1,17 +1,24 @@
---
- name: List installable sh scripts
command: ls -1 bashrc.d/*.sh
register: bash_scripts
# tasks file for roles/glenux.bash
- name: Install bashrc
fileglob:
- bashrc.d/*.sh
- name: Install bashrc.d files
copy:
"src={{item}}"
"dest=~/.bashrc.d/{{item|basename}}"
with_nested:
- bash_users
- bash_files
src=bashrc
dest=~/.bashrc
become: true
become_user: "{{item}}"
with_items: bash_users
- name: Install bashrc.d files
copy: >
"src={{item}}"
"dest=~/.bashrc.d/{{item[1]|basename}}"
become: true
become_user: "{{item[0]}}"
with_nested:
- bash_users
- bash_scripts.stdout_lines