2015-11-11 10:56:13 +01:00
|
|
|
---
|
2015-11-17 14:20:58 +01:00
|
|
|
- name: List installable sh scripts
|
2016-02-16 21:32:41 +01:00
|
|
|
become: false
|
|
|
|
local_action: shell ls -1 "{{role_path}}/files/bashrc.d/"*.sh
|
2015-11-17 14:20:58 +01:00
|
|
|
register: bash_scripts
|
2015-12-29 15:29:57 +01:00
|
|
|
failed_when:
|
|
|
|
bash_scripts.rc != 0
|
|
|
|
changed_when: False
|
2015-11-17 14:20:58 +01:00
|
|
|
|
2015-11-11 10:56:13 +01:00
|
|
|
# tasks file for roles/glenux.bash
|
2015-11-18 00:57:38 +01:00
|
|
|
- name: Install main configuration files for bash
|
2016-04-13 00:17:33 +02:00
|
|
|
copy: >
|
|
|
|
src="{{item[1]}}"
|
|
|
|
dest="~/.{{item[1]|basename}}"
|
2015-11-17 23:37:20 +01:00
|
|
|
mode=0644
|
2015-11-17 14:20:58 +01:00
|
|
|
become: true
|
2015-11-18 00:57:38 +01:00
|
|
|
become_user: "{{item[0]}}"
|
|
|
|
with_nested:
|
2016-04-13 00:17:33 +02:00
|
|
|
- "{{bash_users}}"
|
2015-11-18 00:57:38 +01:00
|
|
|
- ['bashrc', 'bash_profile', 'bash_aliases']
|
2015-11-17 12:07:59 +01:00
|
|
|
|
2015-11-17 14:42:31 +01:00
|
|
|
- name: Create bashrc.d directory
|
|
|
|
file: path=~/.bashrc.d state=directory
|
|
|
|
become: true
|
|
|
|
become_user: "{{item}}"
|
2016-04-13 00:17:33 +02:00
|
|
|
with_items: "{{bash_users}}"
|
2015-11-17 14:42:31 +01:00
|
|
|
|
2015-11-17 12:07:59 +01:00
|
|
|
- name: Install bashrc.d files
|
2015-11-17 14:39:41 +01:00
|
|
|
copy: "src={{item[1]}} dest=~/.bashrc.d/{{item[1]|basename}}"
|
2015-11-17 14:20:58 +01:00
|
|
|
become: true
|
|
|
|
become_user: "{{item[0]}}"
|
2015-11-17 12:07:59 +01:00
|
|
|
with_nested:
|
2016-04-13 00:17:33 +02:00
|
|
|
- "{{bash_users}}"
|
|
|
|
- "{{bash_scripts.stdout_lines}}"
|
2015-11-17 14:20:58 +01:00
|
|
|
|