Add provisioning for bashrc* files.
This commit is contained in:
parent
0609db4265
commit
27bcd77840
2 changed files with 31 additions and 12 deletions
12
files/bashrc
Normal file
12
files/bashrc
Normal 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
|
||||
|
||||
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue