summaryrefslogtreecommitdiffstats
path: root/ansible/roles/bash-completion/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/roles/bash-completion/tasks/main.yml')
-rw-r--r--ansible/roles/bash-completion/tasks/main.yml22
1 files changed, 22 insertions, 0 deletions
diff --git a/ansible/roles/bash-completion/tasks/main.yml b/ansible/roles/bash-completion/tasks/main.yml
new file mode 100644
index 00000000..ef402e51
--- /dev/null
+++ b/ansible/roles/bash-completion/tasks/main.yml
@@ -0,0 +1,22 @@
+---
+- name: Install completion for the bash shell
+ package:
+ name: "{{ completion_package }}"
+ state: present
+
+- name: Ensure bash completion dir exists
+ file:
+ path: "{{ completion_dir }}"
+ state: directory
+ mode: 0755
+
+- name: Generate shell autocompletion code for {{ completion_bin }}
+ command: "{{ completion_bin }} completion bash"
+ register: bash_completion
+ changed_when: false
+
+- name: Install bash autocompletion code for {{ completion_bin }}
+ copy:
+ content: "{{ bash_completion.stdout }}"
+ dest: "{{ completion_dir }}/{{ completion_bin }}"
+ mode: 0644