37 lines
1.4 KiB
YAML
37 lines
1.4 KiB
YAML
---
|
|
- name: Helm | Add NVIDIA device plugin chart repository
|
|
ansible.builtin.command: helm repo add nvdp https://nvidia.github.io/k8s-device-plugin
|
|
environment:
|
|
KUBECONFIG: "{{ nvidia_device_plugin_kubeconfig }}"
|
|
PATH: "/usr/local/bin:/usr/bin:/bin"
|
|
register: _helm_repo_add
|
|
changed_when: "'already exists' not in _helm_repo_add.stdout"
|
|
failed_when: _helm_repo_add.rc != 0 and 'already exists' not in _helm_repo_add.stdout
|
|
|
|
- name: Helm | Update chart repositories
|
|
ansible.builtin.command: helm repo update
|
|
environment:
|
|
KUBECONFIG: "{{ nvidia_device_plugin_kubeconfig }}"
|
|
PATH: "/usr/local/bin:/usr/bin:/bin"
|
|
changed_when: false
|
|
|
|
- name: NVIDIA Device Plugin | Render values
|
|
ansible.builtin.template:
|
|
src: values.yml.j2
|
|
dest: /tmp/nvidia-device-plugin-values.yml
|
|
mode: "0600"
|
|
|
|
- name: NVIDIA Device Plugin | Install or upgrade
|
|
ansible.builtin.command: >
|
|
helm upgrade --install nvidia-device-plugin nvdp/nvidia-device-plugin
|
|
--namespace {{ nvidia_device_plugin_namespace }}
|
|
--version {{ nvidia_device_plugin_chart_version }}
|
|
--values /tmp/nvidia-device-plugin-values.yml
|
|
--timeout 15m0s
|
|
--wait
|
|
environment:
|
|
KUBECONFIG: "{{ nvidia_device_plugin_kubeconfig }}"
|
|
PATH: "/usr/local/bin:/usr/bin:/bin"
|
|
register: _helm_install
|
|
changed_when: "'STATUS: deployed' in _helm_install.stdout or 'has been upgraded' in _helm_install.stdout"
|