summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-02-11 22:02:36 +0000
committerGerrit Code Review <review@openstack.org>2019-02-11 22:02:36 +0000
commitc820963613187705d4bb8d7c9e08d370c865c38f (patch)
treec1d3ff13bb70aa590aaa794550c2f8b0478c63fa
parent7cf12d7741541a0f15ab4d44531677061b91649c (diff)
parent94d404a53537a0127d05f7ee73eb314126eea940 (diff)
Merge "Install kubectl on bridge"
-rw-r--r--playbooks/base.yaml1
-rw-r--r--playbooks/roles/base-server/tasks/Debian.yaml1
-rw-r--r--playbooks/roles/base-server/tasks/Ubuntu.xenial.aarch64.yaml1
-rw-r--r--playbooks/roles/install-kubectl/README.rst5
-rw-r--r--playbooks/roles/install-kubectl/tasks/main.yaml16
-rw-r--r--playbooks/zuul/templates/host_vars/bridge.openstack.org.yaml.j22
-rw-r--r--testinfra/test_bridge.py7
7 files changed, 29 insertions, 4 deletions
diff --git a/playbooks/base.yaml b/playbooks/base.yaml
index 0be64f6..57fd4fb 100644
--- a/playbooks/base.yaml
+++ b/playbooks/base.yaml
@@ -26,6 +26,7 @@
26- hosts: bridge.openstack.org:!disabled 26- hosts: bridge.openstack.org:!disabled
27 name: "Base: configure cloud credentials on bridge" 27 name: "Base: configure cloud credentials on bridge"
28 roles: 28 roles:
29 - install-kubectl
29 - configure-kubectl 30 - configure-kubectl
30 tasks: 31 tasks:
31 - include_role: 32 - include_role:
diff --git a/playbooks/roles/base-server/tasks/Debian.yaml b/playbooks/roles/base-server/tasks/Debian.yaml
index 2ef7053..8857e42 100644
--- a/playbooks/roles/base-server/tasks/Debian.yaml
+++ b/playbooks/roles/base-server/tasks/Debian.yaml
@@ -3,7 +3,6 @@
3 name: 3 name:
4 - whoopsie 4 - whoopsie
5 - popularity-contest 5 - popularity-contest
6 - snapd
7 - lxd 6 - lxd
8 - lxd-client 7 - lxd-client
9 state: absent 8 state: absent
diff --git a/playbooks/roles/base-server/tasks/Ubuntu.xenial.aarch64.yaml b/playbooks/roles/base-server/tasks/Ubuntu.xenial.aarch64.yaml
index 51569ed..dbccb4c 100644
--- a/playbooks/roles/base-server/tasks/Ubuntu.xenial.aarch64.yaml
+++ b/playbooks/roles/base-server/tasks/Ubuntu.xenial.aarch64.yaml
@@ -15,7 +15,6 @@
15 name: 15 name:
16 - whoopsie 16 - whoopsie
17 - popularity-contest 17 - popularity-contest
18 - snapd
19 - lxd 18 - lxd
20 - lxd-client 19 - lxd-client
21 state: absent 20 state: absent
diff --git a/playbooks/roles/install-kubectl/README.rst b/playbooks/roles/install-kubectl/README.rst
new file mode 100644
index 0000000..09bb4b2
--- /dev/null
+++ b/playbooks/roles/install-kubectl/README.rst
@@ -0,0 +1,5 @@
1Install kubectl
2
3**Role Variables**
4
5* None
diff --git a/playbooks/roles/install-kubectl/tasks/main.yaml b/playbooks/roles/install-kubectl/tasks/main.yaml
new file mode 100644
index 0000000..b308a00
--- /dev/null
+++ b/playbooks/roles/install-kubectl/tasks/main.yaml
@@ -0,0 +1,16 @@
1- name: Install snapd
2 package:
3 name: snapd
4 state: present
5
6- name: Install kubectl
7 command: snap install kubectl --classic
8
9# /snap/bin is often in the path, but not in a non-login shell, which
10# makes it difficult to use via ansible. Add an extra symlink so we
11# can always find it.
12- name: Symlink snapd into /usr/local/bin
13 file:
14 src: /snap/bin/kubectl
15 dest: /usr/local/bin/kubectl
16 state: link
diff --git a/playbooks/zuul/templates/host_vars/bridge.openstack.org.yaml.j2 b/playbooks/zuul/templates/host_vars/bridge.openstack.org.yaml.j2
index e0ab731..d464f38 100644
--- a/playbooks/zuul/templates/host_vars/bridge.openstack.org.yaml.j2
+++ b/playbooks/zuul/templates/host_vars/bridge.openstack.org.yaml.j2
@@ -58,4 +58,4 @@ clouds:
58 openstackzuul_arm64ci_username: user 58 openstackzuul_arm64ci_username: user
59 openstackzuul_arm64ci_password: password 59 openstackzuul_arm64ci_password: password
60 openstackzuul_arm64ci_project_name: project 60 openstackzuul_arm64ci_project_name: project
61gitea_kube_key: gitea_k8s_key 61gitea_kube_key: Z2l0ZWFfazhzX2tleQ==
diff --git a/testinfra/test_bridge.py b/testinfra/test_bridge.py
index d901a68..64e27fc 100644
--- a/testinfra/test_bridge.py
+++ b/testinfra/test_bridge.py
@@ -71,4 +71,9 @@ def test_kube_config(host):
71 kubeconfig = host.file('/root/.kube/config') 71 kubeconfig = host.file('/root/.kube/config')
72 assert kubeconfig.exists 72 assert kubeconfig.exists
73 73
74 assert b'gitea_k8s_key' in kubeconfig.content 74 assert b'Z2l0ZWFfazhzX2tleQ==' in kubeconfig.content
75
76
77def test_kubectl(host):
78 kube = host.run('kubectl help')
79 assert kube.rc == 0