Hi,
I have problem with the lookup module, I am given the file name as a variable, it takes it but didn’t replace the variable with it’s value. For example:
pub_subnet: “{{ lookup(‘file’, ‘./vars/{{ vpc_name }}_public_subnet.yml’) }}”
When I run the playbook, it should replace it with the variable name: tendo_public_subnet.yml
But it is giving me an error of:
TASK: [VPC | set the facts] ***************************************************
fatal: [localhost] => could not locate file in lookup: ./vars/{{ vpc_name }}_public_subnet.yml
FATAL: all hosts have already failed – aborting
Can somebody point me that where I am making a mistake.
Thanks