--- - name: Deploy | Check kubeconfig exists ansible.builtin.stat: path: "{{ gpu_kubeconfig }}" register: _kubeconfig_plugin - name: Deploy | Skip notice ansible.builtin.debug: msg: "Device plugin install skipped — kubeconfig not found at {{ gpu_kubeconfig }}." when: not _kubeconfig_plugin.stat.exists - name: Deploy | Apply NVIDIA device plugin manifest ansible.builtin.command: cmd: "kubectl apply -f {{ gpu_device_plugin_manifest_url }}" environment: KUBECONFIG: "{{ gpu_kubeconfig }}" PATH: "/usr/local/bin:/usr/bin:/bin" when: - _kubeconfig_plugin.stat.exists - groups['gpu_workers'] | default([]) | length > 0 register: _plugin_apply changed_when: "'configured' in _plugin_apply.stdout or 'created' in _plugin_apply.stdout"