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.

41 lines
2.0 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. include_tasks: "install_{{ helm_deployment_type }}.yml"
  6. - name: Helm | Lay Down Helm Manifests (RBAC)
  7. template:
  8. src: "{{item.file}}"
  9. dest: "{{kube_config_dir}}/{{item.file}}"
  10. with_items:
  11. - {name: tiller, file: tiller-sa.yml, type: sa}
  12. - {name: tiller, file: tiller-clusterrolebinding.yml, type: clusterrolebinding}
  13. register: manifests
  14. when: dns_mode != 'none' and inventory_hostname == groups['kube-master'][0] and rbac_enabled
  15. - name: Helm | Apply Helm Manifests (RBAC)
  16. kube:
  17. name: "{{item.item.name}}"
  18. namespace: "{{ system_namespace }}"
  19. kubectl: "{{bin_dir}}/kubectl"
  20. resource: "{{item.item.type}}"
  21. filename: "{{kube_config_dir}}/{{item.item.file}}"
  22. state: "latest"
  23. with_items: "{{ manifests.results }}"
  24. when: dns_mode != 'none' and inventory_hostname == groups['kube-master'][0] and rbac_enabled
  25. - name: Helm | Install/upgrade helm
  26. command: >
  27. {{ bin_dir }}/helm init --upgrade --tiller-image={{ tiller_image_repo }}:{{ tiller_image_tag }} --tiller-namespace={{ system_namespace }}
  28. {% if helm_skip_refresh %} --skip-refresh{% endif %}
  29. {% if helm_stable_repo_url is defined %} --stable-repo-url {{ helm_stable_repo_url }}{% endif %}
  30. {% if rbac_enabled %} --service-account=tiller{% endif %}
  31. {% if tiller_node_selectors is defined %} --node-selectors {{ tiller_node_selectors }}{% endif %}
  32. {% if tiller_override is defined %} --override {{ tiller_override }}{% endif %}
  33. when: (helm_container is defined and helm_container.changed) or (helm_task_result is defined and helm_task_result.changed)
  34. - name: Helm | Set up bash completion
  35. shell: "umask 022 && {{ bin_dir }}/helm completion bash >/etc/bash_completion.d/helm.sh"
  36. when: ((helm_container is defined and helm_container.changed) or (helm_task_result is defined and helm_task_result.changed)) and not ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]