I would like to access the string values used at runtime from the 
ansible-playbook -e argument. In this case the user passes in 
"public_subnet" which renders to the value subnet-12345678 from group_vars. 
I would like to take actions based on the string value "public_subnet"

playbook.yml

vpc_subnet_id: "{{ subnet }}"
assign_public_ip: "{% if subnet == public_subnet %}True{% endif %}"



group_vars/dev

public_subnet: subnet-12345678


command line
ansible-playbook -i inventory/local playbook.yml -v -e 
"subnet=public_subnet"


-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d4852b95-1e16-4a1c-a8c1-f24d1d4568c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to