c12s-kubespray/roles/kubernetes/client/tasks/main.yml
Andreas Krüger ddffdb63bf Remove non-kubeadm deployment (#3811)
* Remove non-kubeadm deployment

* More cleanup

* More cleanup

* More cleanup

* More cleanup

* Fix gitlab

* Try stop gce first before absent to make the delete process work

* More cleanup

* Fix bug with checking if kubeadm has already run

* Fix bug with checking if kubeadm has already run

* More fixes

* Fix test

* fix

* Fix gitlab checkout untill kubespray 2.8 is on quay

* Fixed

* Add upgrade path from non-kubeadm to kubeadm. Revert ssl path

* Readd secret checking

* Do gitlab checks from v2.7.0 test upgrade path to 2.8.0

* fix typo

* Fix CI jobs to kubeadm again. Fix broken hyperkube path

* Fix gitlab

* Fix rotate tokens

* More fixes

* More fixes

* Fix tokens
2018-12-06 02:33:38 -08:00

56 lines
1.5 KiB
YAML

---
- name: Set external kube-apiserver endpoint
set_fact:
external_apiserver_endpoint: >-
{%- if loadbalancer_apiserver is defined and loadbalancer_apiserver.port is defined -%}
https://{{ apiserver_loadbalancer_domain_name }}:{{ loadbalancer_apiserver.port|default(kube_apiserver_port) }}
{%- else -%}
https://{{ kube_apiserver_access_address }}:{{ kube_apiserver_port }}
{%- endif -%}
tags:
- facts
- name: Create kube config dir
file:
path: "/root/.kube"
mode: "0700"
state: directory
- name: Copy admin kubeconfig to root user home
copy:
src: "{{ kube_config_dir }}/admin.conf"
dest: "/root/.kube/config"
remote_src: yes
mode: "0600"
backup: yes
- name: Copy admin kubeconfig to ansible host
fetch:
src: "{{ kube_config_dir }}/admin.conf"
dest: "{{ artifacts_dir }}/admin.conf"
flat: yes
validate_checksum: no
run_once: yes
when: kubeconfig_localhost|default(false)
- name: Copy kubectl binary to ansible host
fetch:
src: "{{ bin_dir }}/kubectl"
dest: "{{ artifacts_dir }}/kubectl"
flat: yes
validate_checksum: no
become: no
run_once: yes
when: kubectl_localhost|default(false)
- name: create helper script kubectl.sh on ansible host
copy:
content: |
#!/bin/bash
kubectl --kubeconfig=${BASH_SOURCE%/*}/admin.conf $@
dest: "{{ artifacts_dir }}/kubectl.sh"
mode: 0755
become: no
run_once: yes
delegate_to: localhost
when: kubectl_localhost|default(false) and kubeconfig_localhost|default(false)