Skip to content

Instantly share code, notes, and snippets.

@fifthecho
Last active August 29, 2015 14:00
Show Gist options
  • Save fifthecho/fef7b18b2d1aaeac20af to your computer and use it in GitHub Desktop.
Save fifthecho/fef7b18b2d1aaeac20af to your computer and use it in GitHub Desktop.
def main():
module = AnsibleModule(
argument_spec=dict(
access_key=dict(),
secret_key=dict(),
api_url=dict(default='http://localhost:8080/client/api'),
key_name=dict(aliases=['keypair']),
security_groups=dict(default=None),
networks=dict(default=None),
wait=dict(default='yes', choices=['yes', 'no']),
wait_for=dict(default=30),
state=dict(default='present', choices=['absent', 'present']),
user_data=dict(),
template_id=dict(required=True),
size_id=dict(aliases=['flavor_id', 'service_offering_id'], required=True),
zone_id=dict(required=True),
),
)
connection = initialize_connection(module)
if module.params['state'] == 'present':
create_instances(connection, module)
ansible localhost -m cloudstack -a "keyname=jmoody_fifthecho security_groups=[129,324] zone_id=5 size_id=44 template_id=85d5a794-c3f4-49fd-afee-19132a850f79 state=present" -c local
localhost | FAILED >> {
"failed": true,
"msg": "this module requires key=value arguments (['<<INCLUDE_ANSIBLE_MODULE_ARGS>>'])"
}
@udondan
Copy link

udondan commented Jan 23, 2015

Having the same issue right now. Did you solve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment