diff --git a/files/bashrc b/files/bashrc new file mode 100644 index 0000000..c604b28 --- /dev/null +++ b/files/bashrc @@ -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 + + diff --git a/tasks/main.yml b/tasks/main.yml index 2da2f58..c7cf1fc 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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 + copy: + 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 +