# Multiple groups with rackspace and dynamic inventory

**URL:** <https://forum.ansible.com/t/multiple-groups-with-rackspace-and-dynamic-inventory/15484>\
**Category:** Ansible Project\
**Created:** [June 17, 2014, 12:57pm UTC](https://forum.ansible.com/t/multiple-groups-with-rackspace-and-dynamic-inventory/15484 "2014-06-17T12:57:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mehul\_Ved](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@Mehul\_Ved](https://forum.ansible.com/u/Mehul_Ved)\
**Post date:** [June 17, 2014, 12:57pm UTC](https://forum.ansible.com/t/multiple-groups-with-rackspace-and-dynamic-inventory/15484/1 "2014-06-17T12:57:13Z")

</div>

Hi,  
&nbsp;&nbsp;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.  
&nbsp;&nbsp;Is it possible to pass a list to group parameter? Or is there  
another way to achieve this?

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [June 17, 2014, 2:48pm UTC](https://forum.ansible.com/t/multiple-groups-with-rackspace-and-dynamic-inventory/15484/2 "2014-06-17T14:48:30Z")

</div>

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]

---

<div class="post-metadata">

**Author:** ![Mehul\_Ved](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@Mehul\_Ved](https://forum.ansible.com/u/Mehul_Ved)\
**Post date:** [July 10, 2014, 3:58pm UTC](https://forum.ansible.com/t/multiple-groups-with-rackspace-and-dynamic-inventory/15484/3 "2014-07-10T15:58:45Z")

</div>

Hi,  
&nbsp;&nbsp;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](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

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [July 11, 2014, 10:25pm UTC](https://forum.ansible.com/t/multiple-groups-with-rackspace-and-dynamic-inventory/15484/4 "2014-07-11T22:25:04Z")

</div>

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?
