skip error when fetching kubeconfig
This commit is contained in:
parent
3b99f443e4
commit
98436c12c1
@ -36,9 +36,6 @@ k8s_taint_servers: false
|
||||
# apply label role=agent to agent nodes
|
||||
k8s_label_agents: false
|
||||
|
||||
# fetch kubeconfig from the bootstrap node
|
||||
# k8s_get_kubeconf: always | never
|
||||
|
||||
# shared k8s api port
|
||||
k8s_api_port: 6443
|
||||
|
||||
|
@ -112,7 +112,7 @@
|
||||
- k8s_node_type == "bootstrap"
|
||||
tags:
|
||||
- k8s-get-kubeconf
|
||||
- "{{ k8s_get_kubeconf | d('always') }}"
|
||||
|
||||
- name: include secret block
|
||||
ansible.builtin.include_tasks: "shared/secrets.yml"
|
||||
when:
|
||||
|
@ -7,6 +7,7 @@
|
||||
block:
|
||||
|
||||
- name: fetch kubeconfig
|
||||
ignore_errors: yes
|
||||
ansible.builtin.fetch:
|
||||
src: "{{ k8s_config_path }}/{{ k8s_type }}.yaml"
|
||||
dest: "$HOME/.kube/config-{{ k8s_cluster_name }}.yaml"
|
||||
@ -16,6 +17,7 @@
|
||||
delegate_to: localhost
|
||||
connection: local
|
||||
become: false
|
||||
ignore_errors: yes
|
||||
ansible.builtin.shell: |
|
||||
yq e '.clusters[].name = "{{ k8s_cluster_name }}"' -i $HOME/.kube/config-{{ k8s_cluster_name }}.yaml
|
||||
yq e '.contexts[].name = "{{ k8s_cluster_context | d(k8s_cluster_name) }}"' -i $HOME/.kube/config-{{ k8s_cluster_name }}.yaml
|
||||
|
Loading…
Reference in New Issue
Block a user