Hi,
I have a problem with the Variable substitution in task name, like:
- name: VPC | Write public subnets id to ‘{{ vpc_name }}’_vpc_info.yml file
local_action: shell echo “{{ item.id }}” > ./vars/{{ item.resource_tags.Name }}.yml
with_items: vpc.subnets
But when I run this playbook, it gave me the result like this:
TASK: [VPC | Write public subnets id to ‘{{ vpc_name }}’_vpc_info.yml file] ***
changed: [localhost → 127.0.0.1] => (item={u’resource_tags’: {u’Name’: u’tendo_public_subnet’}, u’cidr’: u’172.25.10.0/24’, u’az’: u’ap-southeast-2a’, u’id’: u’subnet-947bbce3’})
changed: [localhost → 127.0.0.1] => (item={u’resource_tags’: {u’Name’: u’tendo_private_subnet’}, u’cidr’: u’172.25.20.0/24’, u’az’: u’ap-southeast-2b’, u’id’: u’subnet-5be23b3e’})
instead it should give result like this, which i expect:
TASK: [VPC | Write public subnets id to tendo_vpc_info.yml file] ***
changed: [localhost → 127.0.0.1] => (item={u’resource_tags’: {u’Name’: u’tendo_public_subnet’}, u’cidr’: u’172.25.10.0/24’, u’az’: u’ap-southeast-2a’, u’id’: u’subnet-947bbce3’})
changed: [localhost → 127.0.0.1] => (item={u’resource_tags’: {u’Name’: u’tendo_private_subnet’}, u’cidr’: u’172.25.20.0/24’, u’az’: u’ap-southeast-2b’, u’id’: u’subnet-5be23b3e’})
Can somebody point me that where I am making mistake? Thanks