From daa2416bde9a533e9e4ed383727293184902ca90 Mon Sep 17 00:00:00 2001 From: Jon Calalang Date: Wed, 12 Jun 2024 07:11:53 -0700 Subject: [PATCH] var and file lookup --- distributed-cloud/terraform/infrastructure/provider.tf | 2 +- nginx/ansible/configuration/roles/nginx/tasks/main.yaml | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/distributed-cloud/terraform/infrastructure/provider.tf b/distributed-cloud/terraform/infrastructure/provider.tf index 60132196..fa2d0f5c 100644 --- a/distributed-cloud/terraform/infrastructure/provider.tf +++ b/distributed-cloud/terraform/infrastructure/provider.tf @@ -29,6 +29,6 @@ provider "random" { # Configuration options } provider "volterra" { - api_p12_file = "../../../certs/f5-sa.console.ves.volterra.io.api-creds.p12" + api_p12_file = "../../../certs/f5-sa.api-creds.p12" url = "https://f5-sa.console.ves.volterra.io/api" } \ No newline at end of file diff --git a/nginx/ansible/configuration/roles/nginx/tasks/main.yaml b/nginx/ansible/configuration/roles/nginx/tasks/main.yaml index 35d4a753..93a16889 100644 --- a/nginx/ansible/configuration/roles/nginx/tasks/main.yaml +++ b/nginx/ansible/configuration/roles/nginx/tasks/main.yaml @@ -25,7 +25,7 @@ - name: Create or update NGINX One {{ nginx-one-f5xc-tenant }} azure-instances Group Declaration delegate_to: localhost uri: - body: "{{ lookup('file','{{ item }}') }}" + body: "{{ lookup('ansible.builtin.file','../config/azure-instances/nginx.json') }}" body_format: json headers: Authorization: "{{ nginx-one-f5xc-api-token }}" @@ -37,8 +37,6 @@ retries: 30 delay: 5 until: "(result.status == 200) or (result.status == 202)" - with_nested: - - "{ azure_instances }" - with_fileglob: - - "../config/azure-instances/nginx.json" + with_items: + - azure_instances when: state == "present"