Install kubectl on bridge
With a snap package. Because apparently that's how that's done. Change-Id: I0462cc062c2706509215158bca99e7a2ad58675a
This commit is contained in:
parent
2766ec2595
commit
94d404a535
@ -19,6 +19,7 @@
|
||||
- hosts: bridge.openstack.org:!disabled
|
||||
name: "Base: configure cloud credentials on bridge"
|
||||
roles:
|
||||
- install-kubectl
|
||||
- configure-kubectl
|
||||
tasks:
|
||||
- include_role:
|
||||
|
@ -3,7 +3,6 @@
|
||||
name:
|
||||
- whoopsie
|
||||
- popularity-contest
|
||||
- snapd
|
||||
- lxd
|
||||
- lxd-client
|
||||
state: absent
|
||||
|
@ -15,7 +15,6 @@
|
||||
name:
|
||||
- whoopsie
|
||||
- popularity-contest
|
||||
- snapd
|
||||
- lxd
|
||||
- lxd-client
|
||||
state: absent
|
||||
|
5
playbooks/roles/install-kubectl/README.rst
Normal file
5
playbooks/roles/install-kubectl/README.rst
Normal file
@ -0,0 +1,5 @@
|
||||
Install kubectl
|
||||
|
||||
**Role Variables**
|
||||
|
||||
* None
|
16
playbooks/roles/install-kubectl/tasks/main.yaml
Normal file
16
playbooks/roles/install-kubectl/tasks/main.yaml
Normal 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
|
@ -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==
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user