--- - name: Install bash-completion (Archlinux) become: true pacman: name: - bash-completion when: ansible_distribution == 'Archlinux' - name: Install bash-completion (Debian) become: true apt: name: - bash-completion when: ansible_distribution == 'Debian' - name: Copy rc files copy: src={{ item.src }} dest={{ item.dest }} backup=true with_items: - { src: 'inputrc', dest: '~/.inputrc' } - { src: 'bash_profile.ansible', dest: '~/.bash_profile.ansible' } - { src: 'bashrc.ansible', dest: '~/.bashrc.ansible' } - name: Source rc.ansible files lineinfile: path={{ item.path }} line={{ item.line }} create=true insertbefore=BOF with_items: - { path: '~/.bashrc', line: '. "$HOME"/.bashrc.ansible' } - { path: '~/.bash_profile', line: '. "$HOME"/.bash_profile.ansible' } - name: Clone bash-git-prompt git: repo: https://github.com/magicmonty/bash-git-prompt.git dest: ~/.bash-git-prompt clone: yes update: no