2016-09-08 02:02:06 +08:00
|
|
|
---
|
2017-04-21 10:51:27 +08:00
|
|
|
- name: Helm | Make sure HELM_HOME directory exists
|
|
|
|
file: path={{ helm_home_dir }} state=directory
|
|
|
|
|
2017-03-17 19:56:25 +08:00
|
|
|
- name: Helm | Set up helm launcher
|
|
|
|
template:
|
|
|
|
src: helm-container.j2
|
|
|
|
dest: "{{ bin_dir }}/helm"
|
|
|
|
owner: root
|
|
|
|
mode: 0755
|
|
|
|
register: helm_container
|
|
|
|
|
2017-06-27 12:27:25 +08:00
|
|
|
- name: Helm | Lay Down Helm Manifests (RBAC)
|
|
|
|
template:
|
|
|
|
src: "{{item.file}}"
|
|
|
|
dest: "{{kube_config_dir}}/{{item.file}}"
|
|
|
|
with_items:
|
|
|
|
- {name: tiller, file: tiller-sa.yml, type: sa}
|
|
|
|
- {name: tiller, file: tiller-clusterrolebinding.yml, type: clusterrolebinding}
|
|
|
|
register: manifests
|
|
|
|
when: dns_mode != 'none' and inventory_hostname == groups['kube-master'][0] and rbac_enabled
|
|
|
|
|
|
|
|
- name: Helm | Apply Helm Manifests (RBAC)
|
|
|
|
kube:
|
|
|
|
name: "{{item.item.name}}"
|
|
|
|
namespace: "{{ system_namespace }}"
|
|
|
|
kubectl: "{{bin_dir}}/kubectl"
|
|
|
|
resource: "{{item.item.type}}"
|
|
|
|
filename: "{{kube_config_dir}}/{{item.item.file}}"
|
2017-09-05 13:23:12 +08:00
|
|
|
state: "latest"
|
2017-06-27 12:27:25 +08:00
|
|
|
with_items: "{{ manifests.results }}"
|
|
|
|
when: dns_mode != 'none' and inventory_hostname == groups['kube-master'][0] and rbac_enabled
|
|
|
|
|
2017-03-17 19:56:25 +08:00
|
|
|
- name: Helm | Install/upgrade helm
|
2017-05-08 15:27:06 +08:00
|
|
|
command: "{{ bin_dir }}/helm init --upgrade --tiller-image={{ tiller_image_repo }}:{{ tiller_image_tag }}"
|
2017-03-17 19:56:25 +08:00
|
|
|
when: helm_container.changed
|
|
|
|
|
2017-06-27 12:27:25 +08:00
|
|
|
- name: Helm | Patch tiller deployment for RBAC
|
|
|
|
command: kubectl patch deployment tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}' -n {{ system_namespace }}
|
|
|
|
when: rbac_enabled
|
|
|
|
|
2017-03-17 19:56:25 +08:00
|
|
|
- name: Helm | Set up bash completion
|
2017-06-19 14:33:50 +08:00
|
|
|
shell: "umask 022 && {{ bin_dir }}/helm completion bash >/etc/bash_completion.d/helm.sh"
|
2017-04-11 00:07:15 +08:00
|
|
|
when: ( helm_container.changed and not ansible_os_family in ["CoreOS", "Container Linux by CoreOS"] )
|