toansible: Use lineinfile for bash rc files

This commit is contained in:
Tunui Franken 2022-02-25 09:24:25 +01:00
parent 3b2a441320
commit 55237f8a58
3 changed files with 9 additions and 3 deletions

View file

@ -13,12 +13,18 @@
- bash-completion
when: ansible_distribution == 'Debian'
- name: Copy files
- name: Copy rc files
copy: src={{ item.src }} dest={{ item.dest }} backup=true
with_items:
- { src: 'inputrc', dest: '~/.inputrc' }
- { src: 'bash_profile', dest: '~/.bash_profile' }
- { src: 'bashrc', dest: '~/.bashrc' }
- { 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: