- name: Install latest bash (Debian) when: ansible_os_family == "Debian" become: yes apt: name=bash state=latest update_cache=yes - name: Install latest bash (macOS) when: ansible_os_family == "Darwin" homebrew: name=bash state=latest - 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" - "~/.config/bash/completion.d" - 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