enumerate elasticache/redis instances

57 views
Skip to first unread message

Damjan Georgievski

unread,
Jun 2, 2014, 9:45:19 AM6/2/14
to ansible...@googlegroups.com
When deploying an app (on ec2) I need to setup a file with all the redis instances the app will use.

But I can't find a way to enumerate all redis instances that I have on AWS elasticache.

Michael Peters

unread,
Jun 2, 2014, 11:43:07 AM6/2/14
to ansible...@googlegroups.com
If you have a redis group of servers you can do something like:

{% for host in groups['redis'] %}
{{ hostvars[host].ansible_default_ipv4.address }}
{% endfor %}

Which will print the IP address of that host in the template file.
> --
> 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-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/1931e82d-23f1-4ff6-8129-c7472798887e%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Damjan Georgievski

unread,
Jun 2, 2014, 2:09:27 PM6/2/14
to ansible...@googlegroups.com


On Monday, June 2, 2014 5:43:07 PM UTC+2, Michael Peters wrote:
If you have a redis group of servers you can do something like:

{% for host in groups['redis'] %}
  {{ hostvars[host].ansible_default_ipv4.address }}
{% endfor %}

I'm using the 'ec2.py' inventory script and it doesn't report or group the elasticache instances.

--
damjan

Michael DeHaan

unread,
Jun 6, 2014, 8:15:10 AM6/6/14
to ansible...@googlegroups.com
While there are probably other suggestions people would offer up, I'd probably consider tagging your redis machines "redis", that way it will automatically make a group of them, and they will be easier to manage.






--
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-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.

Damjan Georgievski

unread,
Jun 18, 2014, 8:00:45 PM6/18/14
to ansible...@googlegroups.com


On Friday, June 6, 2014 2:15:10 PM UTC+2, Michael DeHaan wrote:
While there are probably other suggestions people would offer up, I'd probably consider tagging your redis machines "redis", that way it will automatically make a group of them, and they will be easier to manage.

These are not "redis machines", it's about instances of the ElastiCache service.
Unlike the RDS instances,  ElastiCache instances don't show up in the inventory.
Reply all
Reply to author
Forward
0 new messages