Multiple groups with rackspace and dynamic inventory

133 views
Skip to first unread message

Mehul Ved

unread,
Jun 17, 2014, 8:57:35 AM6/17/14
to ansible...@googlegroups.com
Hi,
I am using rax module to create rackspace server and setting a group
using group parameter. Currently, I use it for determining if the
server belongs to web or db group. In addition, I also want to add
capability of determining if the server belongs to production or
development.
Is it possible to pass a list to group parameter? Or is there
another way to achieve this?

--
With Regards,
Mehul Ved

Matt Martz

unread,
Jun 17, 2014, 10:49:14 AM6/17/14
to ansible...@googlegroups.com
To define "secondary" or extra groups to a device, you need to use the "groups" meta key.  Note that this is plural and different from "group".

I really recommend using the current copy of the 'rax' module in ansible (devel), not what has been released with 1.6.x, as the current version it fixes issues related to metadata.  Additionally, make sure you are also using an up to date rax.py inventory plugin.

Example (trimmed to the important part):

- rax:
    [snip]
    meta:
      groups: production,something,somethingelse
    [snip]



--
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/CADTL0oYVgSazjA%3DECz9pjFfWru4zO7FG0xB0i0hC_c96Ux2s-Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
Matt Martz
ma...@sivel.net
http://sivel.net/

Mehul Ved

unread,
Jul 10, 2014, 11:59:09 AM7/10/14
to ansible...@googlegroups.com
On Tue, Jun 17, 2014 at 8:18 PM, Matt Martz <ma...@sivel.net> wrote:
> To define "secondary" or extra groups to a device, you need to use the
> "groups" meta key. Note that this is plural and different from "group".
>
> I really recommend using the current copy of the 'rax' module in ansible
> (devel), not what has been released with 1.6.x, as the current version it
> fixes issues related to metadata. Additionally, make sure you are also
> using an up to date rax.py inventory plugin.
>
> Example (trimmed to the important part):
>
> - rax:
> [snip]
> meta:
> groups: production,something,somethingelse
> [snip]

Hi,
Sorry for the late reply. This task got delayed in implementing. I
finally got started with it. I copied the latest files in the commit
https://github.com/ansible/ansible/commit/609fd2e993d617b1c5af50540c9664cc0ece261a#diff-ec0444fc44a45df6dac363d61054d860

I also copied over the latest rax.py and tried to create a new host as follows:

$ RAX_CREDS_FILE=.raxpub ansible-playbook -i inventory/rax.py
new-host.yml -vvvv -e "groups=freeswitch,production group=production
rax_name=fs" -vvvv

But, I end up with the following error message

failed: [localhost] => {"failed": true}
msg: Invalid metadata size: Metadata property value greater than 255 characters

Michael DeHaan

unread,
Jul 11, 2014, 6:25:09 PM7/11/14
to ansible...@googlegroups.com
It's unclear what module you are running in the ad-hoc above, as the default "-m" is usually the command module.

Did you perhaps change the default?



--
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.
Reply all
Reply to author
Forward
0 new messages