add variable project_id

This commit is contained in:
2022-10-20 16:51:12 +02:00
parent 4af016b0c4
commit 5e40ed2cc9
3 changed files with 50 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
- name: Get id of cluster
ansible.builtin.uri:
url: https://api.scaleway.com/k8s/v1/regions/fr-par/clusters
url: "https://api.scaleway.com/k8s/v1/regions/{{ region_k8s }}/clusters"
status_code: 200
return_content: yes
method: GET
@@ -10,12 +10,12 @@
- name: Download kubeconfig
ansible.builtin.uri:
url: "https://api.scaleway.com/k8s/v1/regions/fr-par/clusters/{{ item.id }}/kubeconfig?dl=1"
url: "https://api.scaleway.com/k8s/v1/regions/{{ region_k8s }}/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"
when: item.name == "{{ project_name }}"
with_items: "{{ (output.content |from_json).clusters }}"