[ANSIBLE] Drop shell completion code generation in 'kubectl' role 27/126327/1
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>
Fri, 17 Dec 2021 10:35:58 +0000 (11:35 +0100)
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>
Fri, 17 Dec 2021 10:35:58 +0000 (11:35 +0100)
Moved to a dedicated role

Change-Id: I9000403ff619a784c9a480d5de2eafe857c80d8f
Issue-ID: OOM-2902
Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
ansible/roles/kubectl/defaults/main.yml
ansible/roles/kubectl/molecule/default/tests/test_default.py
ansible/roles/kubectl/tasks/main.yml

index 5c2a4c6..b922fb5 100644 (file)
@@ -1,4 +1,2 @@
 ---
 kubectl_bin_dir: /usr/local/bin
-completion_dir: /etc/bash_completion.d
-completion_package: bash-completion
index 3f4c7c7..5d675fe 100644 (file)
@@ -1,15 +1,3 @@
-import os
-
-import testinfra.utils.ansible_runner
-
-testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
-    os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
-
-
 def test_kubectl(host):
     assert host.file('/usr/local/bin/kubectl').exists
     assert host.run('kubectl').rc != 127
-
-
-def test_kubectl_bash_completion(host):
-    assert host.file('/etc/bash_completion.d/kubectl').exists
index 03b9f9b..7c77c3c 100644 (file)
@@ -5,25 +5,3 @@
     dest: "{{ kubectl_bin_dir }}/kubectl"
     remote_src: true
     mode: 0755
-
-- name: Install completion for the bash shell
-  package:
-    name: "{{ completion_package }}"
-    state: present
-
-- name: Generate shell autocompletion code for kubectl
-  command: kubectl completion bash
-  register: kubectl_completion
-  changed_when: false
-
-- name: Ensure bash completion dir exists
-  file:
-    path: "{{ completion_dir }}"
-    state: directory
-    mode: 0755
-
-- name: Install bash autocompletion code for kubectl
-  copy:
-    content: "{{ kubectl_completion.stdout }}"
-    dest: "{{ completion_dir }}/kubectl"
-    mode: 0644