2015-10-04 04:19:50 +08:00
|
|
|
---
|
2016-07-08 17:59:21 +08:00
|
|
|
- include: pre-upgrade.yml
|
2016-12-08 21:36:00 +08:00
|
|
|
tags: k8s-pre-upgrade
|
2015-12-17 06:49:01 +08:00
|
|
|
|
2017-09-16 05:28:15 +08:00
|
|
|
# upstream bug: https://github.com/kubernetes/kubeadm/issues/441
|
|
|
|
- name: Disable kube_basic_auth until kubeadm/441 is fixed
|
|
|
|
set_fact:
|
|
|
|
kube_basic_auth: false
|
|
|
|
when: kubeadm_enabled|bool|default(false)
|
|
|
|
|
2017-09-14 02:00:51 +08:00
|
|
|
- include: users-file.yml
|
|
|
|
when: kube_basic_auth|default(true)
|
|
|
|
|
2016-07-25 18:56:58 +08:00
|
|
|
- name: Copy kubectl from hyperkube container
|
2016-12-23 22:44:44 +08:00
|
|
|
command: "{{ docker_bin_dir }}/docker run --rm -v {{ bin_dir }}:/systembindir {{ hyperkube_image_repo }}:{{ hyperkube_image_tag }} /bin/cp /hyperkube /systembindir/kubectl"
|
2016-09-13 20:36:01 +08:00
|
|
|
register: kube_task_result
|
|
|
|
until: kube_task_result.rc == 0
|
|
|
|
retries: 4
|
2016-09-15 17:23:27 +08:00
|
|
|
delay: "{{ retry_stagger | random + 3 }}"
|
2016-01-22 23:37:07 +08:00
|
|
|
changed_when: false
|
2016-12-08 21:36:00 +08:00
|
|
|
tags: [hyperkube, kubectl, upgrade]
|
2015-12-11 18:52:20 +08:00
|
|
|
|
2017-01-18 01:36:58 +08:00
|
|
|
- name: Install kubectl bash completion
|
|
|
|
shell: "{{ bin_dir }}/kubectl completion bash >/etc/bash_completion.d/kubectl.sh"
|
2016-11-14 16:22:46 +08:00
|
|
|
when: ansible_os_family in ["Debian","RedHat"]
|
2016-12-08 21:36:00 +08:00
|
|
|
tags: kubectl
|
2016-11-14 16:22:46 +08:00
|
|
|
|
2017-01-18 01:36:58 +08:00
|
|
|
- name: Set kubectl bash completion file
|
|
|
|
file:
|
|
|
|
path: /etc/bash_completion.d/kubectl.sh
|
2016-11-14 16:22:46 +08:00
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0755
|
2017-01-18 01:36:58 +08:00
|
|
|
when: ansible_os_family in ["Debian","RedHat"]
|
2016-12-08 21:36:00 +08:00
|
|
|
tags: [kubectl, upgrade]
|
2016-11-14 16:22:46 +08:00
|
|
|
|
2017-09-14 02:00:51 +08:00
|
|
|
- task: Include kubeadm setup if enabled
|
|
|
|
include: kubeadm-setup.yml
|
|
|
|
when: kubeadm_enabled|bool|default(false)
|
2017-06-27 12:27:25 +08:00
|
|
|
|
2017-09-14 02:00:51 +08:00
|
|
|
- task: Include static pod setup if not using kubeadm
|
|
|
|
include: static-pod-setup.yml
|
|
|
|
when: not kubeadm_enabled|bool|default(false)
|