Rename install-kubernetes to ensure-kubernetes for consistency

The old role will be kept and include ensure-kubernetes for backwards compatability.

Change-Id: Ic0c18a833f4a07e123f8313673bd9c864d7d2919
This commit is contained in:
vass 2020-04-01 18:52:34 +02:00 committed by Mohammed Naser
parent c80b593fb6
commit fcf3202ba4
16 changed files with 76 additions and 71 deletions

View File

@ -6,6 +6,7 @@ Container Roles
.. zuul:autorole:: collect-container-logs
.. zuul:autorole:: deploy-openshift
.. zuul:autorole:: ensure-docker
.. zuul:autorole:: ensure-kubernetes
.. zuul:autorole:: install-docker
.. zuul:autorole:: install-kubernetes
.. zuul:autorole:: install-openshift

View File

@ -1,5 +1,5 @@
- hosts: all
roles:
- role: clear-firewall
- role: install-kubernetes
- role: ensure-kubernetes
- role: ensure-helm

View File

@ -0,0 +1,25 @@
An ansible role to install kubernetes.
**Role Variables**
.. zuul:rolevar:: install_kubernetes_with_cluster
:default: True
If true, installs a Minikube cluster.
.. zuul:rolevar:: minikube_version
:default: latest
The version of Minikube to install.
.. zuul:rolevar:: minikube_dns_resolvers
:default: []
List of dns resolvers to configure in k8s. Use this to override the
resolvers that are found by default.
.. zuul:rolevar:: kubernetes_runtime
:default: docker
Which kubernetes runtime to use; values are ``docker`` or
``cri-o``.

View File

@ -0,0 +1,24 @@
- name: Install apt key
become: yes
apt_key:
url: "https://packages.cloud.google.com/apt/doc/apt-key.gpg"
state: present
- name: Add kubernetes repo
become: yes
apt_repository:
repo: deb http://apt.kubernetes.io/ kubernetes-xenial main
state: present
- name: Install kubernetes packages and dependencies
become: yes
apt:
name:
- conntrack
- kubectl
- liblz4-tool
update_cache: yes
- name: Run cluster tasks
include_tasks: minikube.yaml
when: install_kubernetes_with_cluster

View File

@ -1,25 +1 @@
An ansible role to install kubernetes.
**Role Variables**
.. zuul:rolevar:: install_kubernetes_with_cluster
:default: True
If true, installs a Minikube cluster.
.. zuul:rolevar:: minikube_version
:default: latest
The version of Minikube to install.
.. zuul:rolevar:: minikube_dns_resolvers
:default: []
List of dns resolvers to configure in k8s. Use this to override the
resolvers that are found by default.
.. zuul:rolevar:: kubernetes_runtime
:default: docker
Which kubernetes runtime to use; values are ``docker`` or
``cri-o``.
.. warning:: Deprecated, use ensure-kubernetes instead.

View File

@ -1,24 +1,3 @@
- name: Install apt key
become: yes
apt_key:
url: "https://packages.cloud.google.com/apt/doc/apt-key.gpg"
state: present
- name: Add kubernetes repo
become: yes
apt_repository:
repo: deb http://apt.kubernetes.io/ kubernetes-xenial main
state: present
- name: Install kubernetes packages and dependencies
become: yes
apt:
name:
- conntrack
- kubectl
- liblz4-tool
update_cache: yes
- name: Run cluster tasks
include_tasks: minikube.yaml
when: install_kubernetes_with_cluster
- name: Include ensure-kubernetes
include_role:
name: ensure-kubernetes

View File

@ -1,7 +1,7 @@
- hosts: all
roles:
- role: clear-firewall
- role: install-kubernetes
- role: ensure-kubernetes
vars:
minikube_dns_resolvers:
- '1.1.1.1'

View File

@ -1,7 +1,7 @@
- hosts: all
roles:
- role: clear-firewall
- role: install-kubernetes
- role: ensure-kubernetes
docker_use_buildset_registry: true
tasks:
- name: Wait for cluster to come up

View File

@ -139,7 +139,7 @@
- roles/pull-from-intermediate-registry/.*
- roles/push-to-intermediate-registry/.*
- roles/ensure-docker/.*
- roles/install-kubernetes/.*
- roles/ensure-kubernetes/.*
- roles/build-docker-image/.*
- roles/run-buildset-registry/.*
- roles/use-buildset-registry/.*
@ -162,7 +162,7 @@
- roles/pull-from-intermediate-registry/.*
- roles/push-to-intermediate-registry/.*
- roles/ensure-docker/.*
- roles/install-kubernetes/.*
- roles/ensure-kubernetes/.*
- roles/build-docker-image/.*
- roles/run-buildset-registry/.*
- roles/use-buildset-registry/.*
@ -186,7 +186,7 @@
- roles/pull-from-intermediate-registry/.*
- roles/push-to-intermediate-registry/.*
- roles/ensure-docker/.*
- roles/install-kubernetes/.*
- roles/ensure-kubernetes/.*
- roles/build-docker-image/.*
- roles/run-buildset-registry/.*
- roles/use-buildset-registry/.*
@ -226,34 +226,34 @@
label: centos-7
- job:
name: zuul-jobs-test-install-kubernetes-docker
name: zuul-jobs-test-ensure-kubernetes-docker
description: |
Test the install-kubernetes role with docker
Test the ensure-kubernetes role with docker
This job tests changes to the install-kubernetes roles. It
This job tests changes to the ensure-kubernetes roles. It
is not meant to be used directly but rather run on changes to
roles in the zuul-jobs repo.
files:
- roles/ensure-docker/.*
- roles/install-kubernetes/.*
- test-playbooks/install-kubernetes/.*
run: test-playbooks/install-kubernetes/docker.yaml
post-run: test-playbooks/install-kubernetes/post.yaml
- roles/ensure-kubernetes/.*
- test-playbooks/ensure-kubernetes/.*
run: test-playbooks/ensure-kubernetes/docker.yaml
post-run: test-playbooks/ensure-kubernetes/post.yaml
- job:
name: zuul-jobs-test-install-kubernetes-crio
name: zuul-jobs-test-ensure-kubernetes-crio
description: |
Test the install-kubernetes role with crio-o
Test the ensure-kubernetes role with crio-o
This job tests changes to the install-kubernetes roles. It
This job tests changes to the ensure-kubernetes roles. It
is not meant to be used directly but rather run on changes to
roles in the zuul-jobs repo.
files:
- roles/ensure-docker/.*
- roles/install-kubernetes/.*
- test-playbooks/install-kubernetes/.*
run: test-playbooks/install-kubernetes/crio.yaml
post-run: test-playbooks/install-kubernetes/post.yaml
- roles/ensure-kubernetes/.*
- test-playbooks/ensure-kubernetes/.*
run: test-playbooks/ensure-kubernetes/crio.yaml
post-run: test-playbooks/ensure-kubernetes/post.yaml
- job:
name: zuul-jobs-test-install-podman
@ -288,8 +288,8 @@
- zuul-jobs-test-registry-buildset-registry-k8s-docker
- zuul-jobs-test-registry-buildset-registry-k8s-crio
- zuul-jobs-test-registry-buildset-registry-openshift-docker
- zuul-jobs-test-install-kubernetes-docker
- zuul-jobs-test-install-kubernetes-crio
- zuul-jobs-test-ensure-kubernetes-docker
- zuul-jobs-test-ensure-kubernetes-crio
- zuul-jobs-test-install-podman
gate:
jobs: *id001