Use rax module to create a server with extra_create_args / build_config

Hello,

I’d like to be able to create servers at Rackspace which are free from any packages other than the ones installed by default as part of a Debian installation. In response to the support ticket I raised, I was pointed to this article in Rackspace’s documentation: http://www.rackspace.com/knowledge_center/article/post-build-options-for-servers.

The section “Build options for configuration management software (Chef, Puppet, Ansible, Salt)” in that article suggests to achieve the above, I need to provide additional information via the build_config parameter:

--meta build_config=core

I assumed that using the rax module, I could use the extra_create_args attribute to supply this information. I’ve tested that, and I haven’t been able to get it working. I’ve copied my code below, I’d like to know whether I’m not using the module correctly, or if I’ve discovered a problem in the implementation (the docs suggest extra_create_args has only recently been added):

Per that article, it looks like you need to add metadata and not options to extra_create_args. extra_create_args are passed to the novaclient create method.

Something like:

  • name: 1 GB General Purpose v1
    local_action:
    module: rax

[snip]
meta:
build_config: “core,monitoring”

Matt is correct with his comment.

As long as you set the var in the meta section of the call to the Rax module it will be set in the request to the Cloud Servers API to create the instance.

Thanks both - I had thought of using the meta attribute instead but hadn’t got round to testing it. Good to know that’s where I should be heading.