-
Notifications
You must be signed in to change notification settings - Fork 48
/
upgrade.yaml
39 lines (33 loc) · 965 Bytes
/
upgrade.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
---
- name: Create inventory dinamically
hosts: localhost
pre_tasks:
- name: Set variables
set_fact:
state: present
roles:
- openstack-master
- name: Upgrade K8S
hosts: master
become: true
tasks:
- name: upgrade kubeadm binary manually
get_url:
url: https://dl.k8s.io/release/{{ kubernetes_version }}/bin/linux/amd64/kubeadm
dest: /usr/bin/kubeadm
mode: 755
force: yes
# TODO: implement a check that we really upgraded kubeadm
# - name: Check kubeadm version
# shell: kubeadm version
# register: kubeadminversion
#
# - name: Fail
# fail:
# msg: wrong version
# when: kubeadminversion.stdout | search( "{{ kubernetes_version }}" )
# TODO: is running this command really needed or is just informative ?
# - name:
# shell: kubeadm upgrade plan
- name: Run kubeadm upgrade
shell: sudo kubeadm upgrade apply {{ kubernetes_version }} -y