Hi,

I've searched as much as I can and tried loads of different options to get 
this to work, but I'm completely stuck.

>From an Ansible script, I'm creating Cloudformation stacks that consist of 
a network stack and a instance stack. 

Within the network stack I create a security group, then when creating the 
instance I look up the security group and grab the id, so I can pass it to 
the instance stack.

The problem I'm having is that the security group id needs to be in the 
format of type "List of String".

The security group id is: sg-c5bfa4bd so the parameter I pass should look 
like this: ["sg-c5bfa4bd"].

It's the quotes that I'm having problems with. 

This is the code that thought would work, with sg_group_id being passed to 
the cloudformation template as parameter:

- set_fact:  

  sg_group_id: '["{{ sg_group_ida }}"]'  

But when it hits AWS and I view the parameters, the double quotes get 
converted to single ['sg-c5bfa4bd'] .

If I set the fact to have two double quotes at the beginning: '[""{{ 
sg_group_ida }}"]' I get double quotes in the parameter on AWS and a double 
quote at the end: [""sg-c5bfa4bd"]

I asked on ServerFault and someone answered that I should do this:

- set_fact:

    sg_group_id: '{{ [sg_group_ida] }}'

to create a List, but that does seem to produce a List, but in AWS it still 
looks like: ['sg-c5bfa4bd']

So confused.

Thanks for any help.

David


-- 
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/2178d235-58d3-4984-bf54-7161a6696972%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to