You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.8 KiB

  1. ---
  2. - name: Helm | Make sure HELM_HOME directory exists
  3. file: path={{ helm_home_dir }} state=directory
  4. - name: Helm | Set up helm launcher
  5. template:
  6. src: helm-container.j2
  7. dest: "{{ bin_dir }}/helm"
  8. owner: root
  9. mode: 0755
  10. register: helm_container
  11. - name: Helm | Lay Down Helm Manifests (RBAC)
  12. template:
  13. src: "{{item.file}}"
  14. dest: "{{kube_config_dir}}/{{item.file}}"
  15. with_items:
  16. - {name: tiller, file: tiller-sa.yml, type: sa}
  17. - {name: tiller, file: tiller-clusterrolebinding.yml, type: clusterrolebinding}
  18. register: manifests
  19. when: dns_mode != 'none' and inventory_hostname == groups['kube-master'][0] and rbac_enabled
  20. - name: Helm | Apply Helm Manifests (RBAC)
  21. kube:
  22. name: "{{item.item.name}}"
  23. namespace: "{{ system_namespace }}"
  24. kubectl: "{{bin_dir}}/kubectl"
  25. resource: "{{item.item.type}}"
  26. filename: "{{kube_config_dir}}/{{item.item.file}}"
  27. state: "{{item.changed | ternary('latest','present') }}"
  28. with_items: "{{ manifests.results }}"
  29. failed_when: manifests|failed and "Error from server (AlreadyExists)" not in manifests.msg
  30. when: dns_mode != 'none' and inventory_hostname == groups['kube-master'][0] and rbac_enabled
  31. - name: Helm | Install/upgrade helm
  32. command: "{{ bin_dir }}/helm init --upgrade --tiller-image={{ tiller_image_repo }}:{{ tiller_image_tag }}"
  33. when: helm_container.changed
  34. - name: Helm | Patch tiller deployment for RBAC
  35. command: kubectl patch deployment tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}' -n {{ system_namespace }}
  36. when: rbac_enabled
  37. - name: Helm | Set up bash completion
  38. shell: "umask 022 && {{ bin_dir }}/helm completion bash >/etc/bash_completion.d/helm.sh"
  39. when: ( helm_container.changed and not ansible_os_family in ["CoreOS", "Container Linux by CoreOS"] )