mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-13 17:24:51 -03:30
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:
@@ -19,7 +19,7 @@
|
||||
|
||||
- name: Calico | Get kubelet hostname
|
||||
shell: >-
|
||||
set -o pipefail && {{ bin_dir }}/kubectl get node -o custom-columns='NAME:.metadata.name,INTERNAL-IP:.status.addresses[?(@.type=="InternalIP")].address'
|
||||
set -o pipefail && {{ kubectl }} get node -o custom-columns='NAME:.metadata.name,INTERNAL-IP:.status.addresses[?(@.type=="InternalIP")].address'
|
||||
| egrep "{{ ansible_all_ipv4_addresses | join('$|') }}$" | cut -d" " -f1
|
||||
args:
|
||||
executable: /bin/bash
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
- name: Calico | Check if typha-server exists
|
||||
command: "{{ bin_dir }}/kubectl -n kube-system get secret typha-server"
|
||||
command: "{{ kubectl }} -n kube-system get secret typha-server"
|
||||
register: typha_server_secret
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
- name: Calico | Create typha tls secrets
|
||||
command: >-
|
||||
{{ bin_dir }}/kubectl -n kube-system
|
||||
{{ kubectl }} -n kube-system
|
||||
create secret tls {{ item.name }}
|
||||
--cert {{ item.cert }}
|
||||
--key {{ item.key }}
|
||||
|
||||
Reference in New Issue
Block a user