I have one ec2 instance(*instance_A)*, and I have to create one more new 
ec2 instance(*instance_B*) using instance_A ec2_fact.

to get facts of ec2 I am using the *ec2_instance_facts* module.on 
*instance_A* have multiple security groups which I want to add on 
*instance_B* on creation time.

I am not able to figure it out how to add all security group of instance_A 
to instance_B

Can you help me with this problem?

here is ec2_facts result.


"public_dns_name": "ec2-10.ab-cd-ef.compute.amazonaws.com",
            "public_ip_address": "18.XX.XX.XX",
            "root_device_name": "/dev/sda1",
            "root_device_type": "ebs",
            "security_groups": [
                {
                    "group_id": "sg-4e3bb823",
                    "group_name": "ws-services"
                },
                {
                    "group_id": "sg-4e3bb824",
                    "group_name": "dbs-services"
                },
                {
                    "group_id": "sg-4e3bb825",
                    "group_name": "dbs-services"
                },
                {
                    "group_id": "sg-1834b775",
                    "group_name": "dcs-services"
                },
                {
                    "group_id": "sg-4e3bb823",
                    "group_name": "app-services"
                },
                {
                    "group_id": "sg-4e3bb823",
                    "group_name": "prod-services"
                }
            ],
            "source_dest_check": true,
            "state": {
                "code": 16,
                "name": "running"
            },
            "state_transition_reason": "",

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/83a2b1b3-f3f5-4cc6-b4a8-d99380d900a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to