mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-28 09:39:12 +03:00
Use a variable for standardizing kubectl invocation (#8329)
* Add kubectl variable * Replace kubectl usage by kubectl variable in roles * Remove redundant --kubeconfig on kubectl usage * Replace unecessary shell usage with command
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
tags: vsphere-csi-driver
|
||||
|
||||
- name: vSphere CSI Driver | Generate a CSI secret manifest
|
||||
command: "{{ bin_dir }}/kubectl create secret generic vsphere-config-secret --from-file=csi-vsphere.conf={{ kube_config_dir }}/vsphere-csi-cloud-config -n kube-system --dry-run --save-config -o yaml"
|
||||
command: "{{ kubectl }} create secret generic vsphere-config-secret --from-file=csi-vsphere.conf={{ kube_config_dir }}/vsphere-csi-cloud-config -n kube-system --dry-run --save-config -o yaml"
|
||||
register: vsphere_csi_secret_manifest
|
||||
when: inventory_hostname == groups['kube_control_plane'][0]
|
||||
no_log: true
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
- name: vSphere CSI Driver | Apply a CSI secret manifest
|
||||
command:
|
||||
cmd: "{{ bin_dir }}/kubectl apply -f -"
|
||||
cmd: "{{ kubectl }} apply -f -"
|
||||
stdin: "{{ vsphere_csi_secret_manifest.stdout }}"
|
||||
when: inventory_hostname == groups['kube_control_plane'][0]
|
||||
no_log: true
|
||||
|
||||
Reference in New Issue
Block a user