Hello All,

I have a situation where i am trying to remove key: value from json output. 
but i am not getting expected result. Please help me what I am doing wrong 
here?

 "get_ec2_id.instances[0].tags": {
    "Name": "test-db-system-2",
    "aws:cloudformation:logical-id": "DBInstance",
    "aws:cloudformation:stack-id": 
"arn:aws:cloudformation:us-east-1:123456789012:stack/test-db-system-2/0115v0a0-5d44-17e8-a024-503ama4a5qd1",
    "aws:cloudformation:stack-name": "test-db-system-2",
    "dbsystem:stack": "test-db-system-2",
    "dbsystem:type": "db"
}


I am trying to remove the all "aws:cloudformation" tags  using below filter:

"{{ get_ec2_id.instances[0].tags | reject('search','aws:') }}"


I am getting the below result:

ok: [10.52.8.101] => {
"instances_tags": [
    "dbsystem:type",
    "dbsystem:stack",
    "Name"
]
    }


but I am expected below result :

 "instances_tags": [
    "dbsystem:stack": "test-db-system-2",
    "dbsystem:type": "db"
    "Name" : "test-db-system-2",
]
  }


Help me to solve the issue.

-- 
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/f58ee0d4-4108-4e7d-88ec-5d7f581aee7d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to