{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1089","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1089/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1089/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1089/events","html_url":"https://github.com/ansible/ansible-modules-core/issues/1089","id":66474339,"number":1089,"title":"Ability to create or specify Cache Subnet Group in ElastiCache module","user":{"login":"tiyberius","id":1237044,"avatar_url":"https://avatars.githubusercontent.com/u/1237044?v=3","gravatar_id":"","url":"https://api.github.com/users/tiyberius","html_url":"https://github.com/tiyberius","followers_url":"https://api.github.com/users/tiyberius/followers","following_url":"https://api.github.com/users/tiyberius/following{/other_user}","gists_url":"https://api.github.com/users/tiyberius/gists{/gist_id}","starred_url":"https://api.github.com/users/tiyberius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiyberius/subscriptions","organizations_url":"https://api.github.com/users/tiyberius/orgs","repos_url":"https://api.github.com/users/tiyberius/repos","events_url":"https://api.github.com/users/tiyberius/events{/privacy}","received_events_url":"https://api.github.com/users/tiyberius/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/feature_idea","name":"feature_idea","color":"006b75"},{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/P3","name":"P3","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-05T19:42:24Z","updated_at":"2015-05-22T05:33:28Z","closed_at":null,"body":"##### Issue Type:\r\n\r\nBug Report\r\n\r\n##### Ansible Version:\r\n\r\n$ ansible --version\r\nansible 1.9.0.1\r\n\r\n##### Environment:\r\n\r\nMac OS 10.10.2\r\n\r\n##### Summary:\r\n\r\nI'm trying to create a VPC, a security group, and an ElastiCache cluster. The cluster should be created in the VPC and when it is created, should be assigned to a VPC security group.\r\n\r\n##### Steps To Reproduce:\r\n\r\nAfter #1088 is resolved, run the following playbook\r\n\r\n```---\r\n- name: Demonstrate Ansible ElastiCache bug\r\n  hosts: localhost\r\n  connection: local\r\n  gather_facts: False\r\n  tasks:\r\n\r\n  - name: Create a VPC\r\n    local_action:\r\n      module: ec2_vpc\r\n      state: present\r\n      cidr_block: 10.0.0.0/16\r\n      resource_tags:\r\n        Name: Test VPC please delete\r\n      subnets:\r\n      - cidr: 10.0.1.0/24\r\n        az: us-east-1a\r\n      - cidr: 10.0.2.0/24\r\n        az: us-east-1c\r\n      route_tables:\r\n        - subnets:\r\n          - 10.0.1.0/24\r\n          routes:\r\n            - dest: 0.0.0.0/0\r\n              gw: igw\r\n      internet_gateway: True\r\n      region: us-east-1\r\n      wait: true\r\n    register: our_vpc\r\n    until: vpc\r\n    retries: 2\r\n    delay: 5\r\n\r\n  - name: Create the security group for Redis in ElastiCache\r\n    local_action:\r\n      module: ec2_group\r\n      name: Redis Security Group\r\n      description: Created for demonstration of elasticache module bug\r\n      vpc_id: \"{{ our_vpc.vpc_id }}\"\r\n      region: us-east-1\r\n      rules: []\r\n    ignore_errors: yes\r\n    register: redis_security_group\r\n\r\n  - name: Create a Redis cluster in ElastiCache\r\n    elasticache:\r\n      name: redis-cluster\r\n      state: present\r\n      engine: redis\r\n      cache_engine_version: 2.8.6\r\n      node_type: cache.r3.large\r\n      num_nodes: 1\r\n      security_group_ids: \"{{ redis_security_group.group_id }}\"\r\n      region: us-east-1\r\n      zone: us-east-1a\r\n```\r\n\r\n##### Expected Results:\r\n\r\nI expected a Redis ElastiCache cluster inside a VPC that is assigned to a security group.\r\n\r\n##### Actual Results:\r\n\r\n```\r\nPLAY [Demonstrate Ansible ElastiCache bug] ************************************\r\n\r\nTASK: [Create a VPC] **********************************************************\r\nchanged: [localhost -> 127.0.0.1]\r\n\r\nTASK: [Create the security group for Redis in ElastiCache] ********************\r\nok: [localhost -> 127.0.0.1]\r\n\r\nTASK: [Create a Redis cluster in ElastiCache] *********************************\r\nfailed: [localhost] => {\"failed\": true}\r\nmsg: {\"Error\":{\"Code\":\"InvalidParameterCombination\",\"Message\":\"Subnet group [default] belongs to a different VPC [vpc-********] than [vpc-********]\",\"Type\":\"Sender\"},\"RequestId\":\"7b220059-dbca-11e4-8618-edd76ff04598\"}\r\n\r\nFATAL: all hosts have already failed -- aborting\r\n\r\nPLAY RECAP ********************************************************************\r\n           to retry, use: --limit @/Users/twork/elasticache_bug.retry\r\n\r\nlocalhost                  : ok=2    changed=1    unreachable=0    failed=1\r\n```"},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/comments/104515755","html_url":"https://github.com/ansible/ansible-modules-core/issues/1089#issuecomment-104515755","issue_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1089","id":104515755,"user":{"login":"bennojoy","id":315687,"avatar_url":"https://avatars.githubusercontent.com/u/315687?v=3","gravatar_id":"","url":"https://api.github.com/users/bennojoy","html_url":"https://github.com/bennojoy","followers_url":"https://api.github.com/users/bennojoy/followers","following_url":"https://api.github.com/users/bennojoy/following{/other_user}","gists_url":"https://api.github.com/users/bennojoy/gists{/gist_id}","starred_url":"https://api.github.com/users/bennojoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bennojoy/subscriptions","organizations_url":"https://api.github.com/users/bennojoy/orgs","repos_url":"https://api.github.com/users/bennojoy/repos","events_url":"https://api.github.com/users/bennojoy/events{/privacy}","received_events_url":"https://api.github.com/users/bennojoy/received_events","type":"User","site_admin":false},"created_at":"2015-05-22T05:33:28Z","updated_at":"2015-05-22T05:33:28Z","body":"@tiyberius probably what you need would be to try this PR https://github.com/ansible/ansible-modules-core/pull/1137 to create a cache_subnet_group with the subnet_ids of the vpc that you created above and then pass that subnet group name to ' cache_subnet_group' parameter and things should work fine, can you please give it a try.."}}