Merge "Install kubectl on bridge"

This commit is contained in:
Zuul 2019-02-11 22:02:36 +00:00 committed by Gerrit Code Review
commit c820963613
7 changed files with 29 additions and 4 deletions

View File

@ -26,6 +26,7 @@
- hosts: bridge.openstack.org:!disabled
name: "Base: configure cloud credentials on bridge"
roles:
- install-kubectl
- configure-kubectl
tasks:
- include_role:

View File

@ -3,7 +3,6 @@
name:
- whoopsie
- popularity-contest
- snapd
- lxd
- lxd-client
state: absent

View File

@ -15,7 +15,6 @@
name:
- whoopsie
- popularity-contest
- snapd
- lxd
- lxd-client
state: absent

View File

@ -0,0 +1,5 @@
Install kubectl
**Role Variables**
* None

View File

@ -0,0 +1,16 @@
- name: Install snapd
package:
name: snapd
state: present
- name: Install kubectl
command: snap install kubectl --classic
# /snap/bin is often in the path, but not in a non-login shell, which
# makes it difficult to use via ansible. Add an extra symlink so we
# can always find it.
- name: Symlink snapd into /usr/local/bin
file:
src: /snap/bin/kubectl
dest: /usr/local/bin/kubectl
state: link

View File

@ -58,4 +58,4 @@ clouds:
openstackzuul_arm64ci_username: user
openstackzuul_arm64ci_password: password
openstackzuul_arm64ci_project_name: project
gitea_kube_key: gitea_k8s_key
gitea_kube_key: Z2l0ZWFfazhzX2tleQ==

View File

@ -71,4 +71,9 @@ def test_kube_config(host):
kubeconfig = host.file('/root/.kube/config')
assert kubeconfig.exists
assert b'gitea_k8s_key' in kubeconfig.content
assert b'Z2l0ZWFfazhzX2tleQ==' in kubeconfig.content
def test_kubectl(host):
kube = host.run('kubectl help')
assert kube.rc == 0