download kubeconfig
This commit is contained in:
parent
a30ab86b4f
commit
30d3b2bfee
@ -1,16 +0,0 @@
|
|||||||
- name: Get id of cluster
|
|
||||||
ansible.builtin.uri:
|
|
||||||
url: https://api.scaleway.com/k8s/v1/regions/fr-par/clusters
|
|
||||||
status_code: 200
|
|
||||||
return_content: yes
|
|
||||||
method: GET
|
|
||||||
headers:
|
|
||||||
X-Auth-Token: "{{ scw_secret_key }}"
|
|
||||||
register: output
|
|
||||||
|
|
||||||
- name: Display content GET scaleway
|
|
||||||
debug:
|
|
||||||
msg: "{{ item }}"
|
|
||||||
with_items: "{{ output.content |to_json }}"
|
|
||||||
|
|
||||||
# | from_json | community.general.json_query('clusters[*]')
|
|
21
scaleway-k8s/tasks/kubeconfig.yml
Normal file
21
scaleway-k8s/tasks/kubeconfig.yml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
- name: Get id of cluster
|
||||||
|
ansible.builtin.uri:
|
||||||
|
url: https://api.scaleway.com/k8s/v1/regions/fr-par/clusters
|
||||||
|
status_code: 200
|
||||||
|
return_content: yes
|
||||||
|
method: GET
|
||||||
|
headers:
|
||||||
|
X-Auth-Token: "{{ scw_secret_key }}"
|
||||||
|
register: output
|
||||||
|
|
||||||
|
- name: Download kubeconfig
|
||||||
|
ansible.builtin.uri:
|
||||||
|
url: "https://api.scaleway.com/k8s/v1/regions/fr-par/clusters/{{ item.id }}/kubeconfig?dl=1"
|
||||||
|
status_code: 200
|
||||||
|
dest: "{{ project_terraform }}/kubeconfig"
|
||||||
|
method: GET
|
||||||
|
headers:
|
||||||
|
X-Auth-Token: "{{ scw_secret_key }}"
|
||||||
|
when: item.name == "terraform-test"
|
||||||
|
with_items: "{{ (output.content |from_json).clusters }}"
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user