Hello All,
First, I really appreciate Ansible. Unfortunately, I'm having trouble
using resource_tags with the ec2_vpc module. In the 1.9.4, installed with
yum, the resource_tags are working well with subnets and the vpc but not
for route tables. When I execute the following playbook in 1.9.4
everything is created perfectly except there's no resource tags on the
route tables as specified below.
---
- hosts: localhost
vars:
region: us-west-2
vpc_name: Integration Environment VPC
environment_name: Integration
tools_cidr: 172.31.0.0/20
apptier1_cidr: 172.31.32.0/20
apptier2_cidr: 172.31.48.0/20
dmz1_cidr: 172.31.64.0/20
dmz2_cidr: 172.31.80.0/20
db1_cidr: 172.31.96.0/20
db2_cidr: 172.31.112.0/20
dmz1_id: nat-0e2cb00629ddcdfae
dmz2_id: nat-066c49781597d10a3
connection: local
gather_facts: False
tasks:
- name: "Create the {{ environment_name }} environment VPC"
ec2_vpc:
state: present
cidr_block: 172.31.0.0/16
internet_gateway: yes
resource_tags: '{ "Name": "{{ vpc_name }}", "Environment": "{{
environment_name }}" }'
region: "{{ region }}"
subnets:
- cidr: "{{ tools_cidr }}"
az: us-west-2a
resource_tags: '{ "Name": "Tools Subnet", "Environment": "{{
environment_name }}" }'
- cidr: "{{ apptier1_cidr }}"
az: us-west-2a
resource_tags: '{ "Name": "Application Tier Subnet 1",
"Environment": "{{ environment_name }}" }'
- cidr: "{{ apptier2_cidr }}"
az: us-west-2b
resource_tags: '{ "Name": "Application Tier Subnet 2",
"Environment": "{{ environment_name }}" }'
- cidr: "{{ dmz1_cidr }}"
az: us-west-2a
resource_tags: '{ "Name": "DMZ Subnet 1", "Environment": "{{
environment_name }}" }'
- cidr: "{{ dmz2_cidr }}"
az: us-west-2b
resource_tags: '{ "Name": "DMZ Subnet 2", "Environment": "{{
environment_name }}" }'
- cidr: "{{ db1_cidr }}"
az: us-west-2a
resource_tags: '{ "Name": "DB Subnet 1", "Environment": "{{
environment_name }}" }'
- cidr: "{{ db2_cidr }}"
az: us-west-2b
resource_tags: '{ "Name": "DB Subnet 2", "Environment": "{{
environment_name }}" }'
route_tables:
- subnets:
- "{{ tools_cidr }}"
- "{{ dmz1_cidr }}"
- "{{ dmz2_cidr }}"
- "{{ db1_cidr }}"
- "{{ db2_cidr }}"
routes:
- dest: 0.0.0.0/0
gw: igw
resource_tags: '{ "Name": "Default Internal Route",
"Environment": "{{ environment_name }}" }'
- subnets:
- "{{ apptier1_cidr }}"
routes:
- dest: 0.0.0.0/0
gw: "{{ dmz1_id }}"
resource_tags: '{ "Name": "DMZ1 Route", "Environment": "{{
environment_name }}" }'
- subnets:
- "{{ apptier2_cidr }}"
routes:
- dest: 0.0.0.0/0
gw: "{{ dmz2_id }}"
resource_tags: '{ "Name": "DMZ2 Route", "Environment": "{{
environment_name }}" }'
I attempted to upgrade to the latest - version 2.1.0 - in the hopes that
this might be a bug or missing feature that was solved recently. This same
playbook cannot even execute, and fails with the message below:
/root/ansible/bin/ansible-playbook --private-key ~/.ssh/test.pub
/root/infrastructure/ansible/environment_playbooks/01_create_vpc_subnets_and_routes.yml
PLAY
***************************************************************************
TASK [Create the Integration environment VPC]
**********************************
fatal: [127.0.0.1]: FAILED! => {"changed": false, "failed": true, "msg":
"unsupported parameter for module: resource_tags"}
NO MORE HOSTS LEFT
*************************************************************
PLAY RECAP
*********************************************************************
127.0.0.1 : ok=0 changed=0 unreachable=0 failed=1
Does anyone know if I'm doing something wrong or how I might get this to
work in some version of Ansible?
Thank you,
Chris Carver
--
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/10f0649f-74f7-4ab6-91a6-f84231661042%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.