setup-cockpit/roles/bash/tasks/main.yml

35 lines
1.1 KiB
YAML

---
- name: Install bash-completion (Archlinux)
become: true
community.general.pacman:
name:
- bash-completion
when: ansible_facts['distribution'] == 'Archlinux'
- name: Install bash-completion (Debian)
become: true
ansible.builtin.apt:
name:
- bash-completion
when: ansible_facts['distribution'] == 'Debian'
- name: Copy rc files
ansible.builtin.copy: src={{ item.src }} dest={{ item.dest }} backup=true mode=0644
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
ansible.builtin.lineinfile: path={{ item.path }} line={{ item.line }} mode=0644 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
ansible.builtin.git:
repo: https://github.com/magicmonty/bash-git-prompt.git
dest: ~/.bash-git-prompt
clone: true
version: master
update: false