summaryrefslogtreecommitdiffstats
path: root/ansible/roles/bash-completion/tasks/main.yml
blob: ef402e51f207862d0f5dacfa9794ba01ac20c1f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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