diff options
| author | Ahmed Abdelhalim <[email protected]> | 2026-01-31 16:49:33 +0100 |
|---|---|---|
| committer | Ahmed Abdelhalim <[email protected]> | 2026-01-31 16:49:33 +0100 |
| commit | beb210e741099036a8bbbefd4c57b62f9f01ebe5 (patch) | |
| tree | 799dc9c53a6ff969163fa848cba91963b01d0b7d | |
| parent | af6b1ed0f92d43da84f1341ed0f0cc6743ceb19e (diff) | |
Add bash-completion to bash role setup
| -rw-r--r-- | roles/bash/tasks/main.yml | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/roles/bash/tasks/main.yml b/roles/bash/tasks/main.yml index 4af7dc40..816972ce 100644 --- a/roles/bash/tasks/main.yml +++ b/roles/bash/tasks/main.yml @@ -17,3 +17,21 @@ - "{{ ansible_facts['env']['HOME'] }}/.bashrc" - "{{ ansible_facts['env']['HOME'] }}/.bash_profile" - "{{ ansible_facts['env']['HOME'] }}/.profile" + +- name: "Ensure bash-completion is installed" + become: true + ansible.builtin.package: + name: "bash-completion" + state: "present" + +- name: "Add bash-completion to shell profile" + ansible.builtin.blockinfile: + path: "{{ ansible_facts['env']['HOME'] }}/.bashrc" + state: "present" + prepend_newline: true + append_newline: true + marker: "# ==== {mark} ANSIBLE BASH-COMPLETION CONFIG" + block: | + if [ -f "/usr/share/bash-completion/bash_completion" ]; then + source "/usr/share/bash-completion/bash_completion" + fi |
