dotfiles/roles/bash/tasks/main.yml
Fernando Schauenburg 23c7a7a616 feat(bash): use bash-completion package
This package will pick up completions installed by other packages and
will source any local completions from:

    ~/.local/share/bash-completion/completions
2020-12-08 13:32:01 +01:00

53 lines
1.1 KiB
YAML

- name: Install latest bash (Debian)
when: ansible_os_family == "Debian"
become: yes
apt:
name: "{{ item }}"
state: latest
update_cache: yes
loop:
- bash
- bash-completion
- name: Install latest bash (macOS)
when: ansible_os_family == "Darwin"
homebrew:
name: "{{ item }}"
state: latest
loop:
- bash
- bash-completion
- name: Remove pre-installed bash configurations which could cause conflicts
file:
state: absent
path: "~/.{{ item }}"
loop:
- bash_logout
- profile
- name: Create the bash cache and config directories
file:
path: "{{ item }}"
state: directory
loop:
- "~/.cache/bash"
- "~/.config/bash"
- "~/.local/share/bash-completion/completions"
- name: Deploy bash profile
file:
src: "{{ role_path }}/files/profile"
dest: ~/.config/bash/profile
state: link
force: yes
- name: Make sure bash will find our profile
file:
src: ~/.config/bash/profile
dest: "~/.{{ item }}"
state: link
force: yes
loop:
- bashrc
- bash_profile