I managed to sort out, there is no parameter called "template_parameter"
- name: create rxgt-ps-mgmt-direct-connect-gateway stack
aws_direct_connect_gateway:
state: present
region: ""
aws_access_key: ""
aws_secret_key: ""
security_token: ""
name: "{{
rxgt_mgmt_account.account_config.rxgtmgmt.stacks['rxgt-ps-mgmt-direct-connect-gateway'].params.name
}}"
amazon_asn: "{{
rxgt_mgmt_account.account_config.rxgtmgmt.stacks['rxgt-ps-mgmt-direct-connect-gateway'].params.amazon_asn
}}"
register: created_aws_direct_connect_gateway
tags:
rxgt-ps-mgmt-dxgw-deploy
On Monday, October 22, 2018 at 6:38:03 PM UTC+1, Kishore Ponniah wrote:
>
> ok, I used the below
>
> template_parameters: "{{
> rxgt_mgmt_account.account_config.rxgtmgmt.stacks['rxgt-ps-mgmt-direct-connect-gateway'].params
>
> }}"
> tags: "{{ global_tags |
> combine(rxgt_mgmt_account.account_config.rxgtmgmt.stacks['rxgt-ps-mgmt-direct-connect-gateway'].override_tags,
>
> recursive=True) }}"
>
> TASK [create rxgt-ps-mgmt-direct-connect-gateway stack]
> ************************************************************************************************************
> fatal: [infrastructure]: FAILED! => {"msg": "|combine expects
> dictionaries, got Undefined"}
> to retry, use: --limit @/home/ec2-user/.ansible-retry/site.retry
>
> On Monday, October 22, 2018 at 5:06:42 PM UTC+1, Tony Chia wrote:
>>
>> It seems there is one level between account_config and stack.
>> Maybe try account_config.xxxxxx.stacks instead?
>>
>> On Monday, October 22, 2018 at 5:17:31 AM UTC-7, Kishore Ponniah wrote:
>>>
>>> Hi,
>>>
>>> I am trying to create a Direct connect Gateway in AWS account using
>>> ansible. I have the main playbook and an account config yaml template. When
>>> I run the playbook I am getting an error
>>>
>>> fatal: [infrastructure]: FAILED! => {"msg": "The task includes an option
>>> with an undefined variable. The error was: 'dict object' has no attribute
>>> 'stacks'\n\nThe error appears to have been in
>>> '/home/ec2-user/environment/aws-rxgt-mgmt-platform/ansible/rxgt-ps-rxgtmgmt-playbook.yaml':
>>>
>>> line 10, column 5, but may\nbe elsewhere in the file depending on the exact
>>> syntax problem.\n\nThe offending line appears to be:\n\n tasks:\n - name:
>>> create rxgt-ps-mgmt-direct-connect-gateway stack\n ^ here\n"}
>>>
>>> I have attached the code for reference and error. can someone please
>>> help?
>>>
>>>
>>> Thanks
>>>
>>
--
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/dcb6e609-2989-4d96-a598-3dbf2c49a8bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.