# elasticache module doesn't work

**URL:** <https://forum.ansible.com/t/elasticache-module-doesnt-work/18406>\
**Category:** Ansible Project\
**Created:** [June 4, 2015, 3:22pm UTC](https://forum.ansible.com/t/elasticache-module-doesnt-work/18406 "2015-06-04T15:22:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giovanni\_Albero](https://avatars.discourse-cdn.com/v4/letter/g/9de0a6/32.png) [@Giovanni\_Albero](https://forum.ansible.com/u/Giovanni_Albero)\
**Post date:** [June 4, 2015, 3:22pm UTC](https://forum.ansible.com/t/elasticache-module-doesnt-work/18406/1 "2015-06-04T15:22:00Z")

</div>

Hi,  
I’ve tried to create an instance of elasticache, and when I’ve executed the script ansible has returned this

> failed: [localhost] =\> {“failed”: true}  
> msg: Use of cache security groups is not permitted in this API version for your account.  
> FATAL: all hosts have already failed – aborting

The last script that I’ve executed is

> - name: Create ElastiCache  
> elasticache:  
> name: “test-please-delete”  
> state: present  
> engine: memcached  
> cache\_engine\_version: 1.4.14  
> node\_type: cache.m1.small  
> num\_nodes: 1  
> cache\_port: 11211
> 
> # cache\_security\_groups: cicciopasticcio
> 
> security\_group\_ids: [“{{sg\_memcached}}”]  
> region: eu-west-1

I’ve tried several combination of this script (also the example of ansible documentation).  
I’ve the ansible 1.9.1 and run on Mac OSX.

Thank you

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [June 4, 2015, 3:39pm UTC](https://forum.ansible.com/t/elasticache-module-doesnt-work/18406/2 "2015-06-04T15:39:26Z")

</div>

This does not seem to be a code issue, you are trying to use a feature that is not available to the AWS account you are using.

---

<div class="post-metadata">

**Author:** ![Giovanni\_Albero](https://avatars.discourse-cdn.com/v4/letter/g/9de0a6/32.png) [@Giovanni\_Albero](https://forum.ansible.com/u/Giovanni_Albero)\
**Post date:** [June 4, 2015, 3:59pm UTC](https://forum.ansible.com/t/elasticache-module-doesnt-work/18406/3 "2015-06-04T15:59:55Z")

</div>

Using the same credentials with “cache\_subnet\_group” and a branch of “ansible 2.0” everithing work fine.

This mean that it’s a code issue and not from our AWS account.

do you have some more infos to solve the problem with the actual stable version (1.9.1) ?

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [June 4, 2015, 4:04pm UTC](https://forum.ansible.com/t/elasticache-module-doesnt-work/18406/4 "2015-06-04T16:04:02Z")

</div>

only info I had was the error message:

> msg: Use of cache security groups is not permitted in this API version for your account.  
> FATAL: all hosts have already failed – aborting

but that seems to be wrong from what you are saying, probably a bug in the module that has since then been fixed, I’ll look at the history later to confirm

---

<div class="post-metadata">

**Author:** ![Giovanni\_Albero](https://avatars.discourse-cdn.com/v4/letter/g/9de0a6/32.png) [@Giovanni\_Albero](https://forum.ansible.com/u/Giovanni_Albero)\
**Post date:** [June 4, 2015, 4:07pm UTC](https://forum.ansible.com/t/elasticache-module-doesnt-work/18406/5 "2015-06-04T16:07:11Z")

</div>

Thank you so much, I’ll attend which confirm.

---

<div class="post-metadata">

**Author:** ![benno\_joy](https://avatars.discourse-cdn.com/v4/letter/b/73ab20/32.png) [@benno\_joy](https://forum.ansible.com/u/benno_joy)\
**Post date:** [June 4, 2015, 4:46pm UTC](https://forum.ansible.com/t/elasticache-module-doesnt-work/18406/6 "2015-06-04T16:46:31Z")

</div>

i think this commit 64a2077787904f144f77839660071f35f25d181f fixes your issue, where the code is changed to connect to the exact region for the vpc connection. earlier the vpc connection woudl be to region where your account might not have rights to vpc’s  
for now i think you can create a directory “library” in the same level as your playbook and place the latest module code there [https://github.com/ansible/ansible-modules-core/blob/devel/cloud/amazon/elasticache.py](https://github.com/ansible/ansible-modules-core/blob/devel/cloud/amazon/elasticache.py) and that should fix you up till 2.0 is released.

---

<div class="post-metadata">

**Author:** ![Giovanni\_Albero](https://avatars.discourse-cdn.com/v4/letter/g/9de0a6/32.png) [@Giovanni\_Albero](https://forum.ansible.com/u/Giovanni_Albero)\
**Post date:** [June 5, 2015, 9:20am UTC](https://forum.ansible.com/t/elasticache-module-doesnt-work/18406/7 "2015-06-05T09:20:23Z")

</div>

Great! It works! Thank you so much for the support 🙂

A last question, when will the new version come out?

Thanks!
