diff --git a/library/cloud/nova_compute b/library/cloud/nova_compute index df612c80bb8..55f9e5dccb9 100644 --- a/library/cloud/nova_compute +++ b/library/cloud/nova_compute @@ -107,6 +107,11 @@ options: - The amount of time the module should wait for the VM to get into active state required: false default: 180 + user_data: + description: + - Opaque blob of data which is made available to the instance + required: false + default: None requirements: ["novaclient"] ''' @@ -157,6 +162,8 @@ def _create_server(module, nova): 'meta' : module.params['meta'], 'key_name': module.params['key_name'], 'security_groups': module.params['security_groups'].split(','), + #userdata is unhyphenated in novaclient, but hyphenated here for consistency with the ec2 module: + 'userdata': module.params['user_data'], } if not module.params['key_name']: del bootkwargs['key_name'] @@ -232,7 +239,8 @@ def main(): meta = dict(default=None), wait = dict(default='yes', choices=['yes', 'no']), wait_for = dict(default=180), - state = dict(default='present', choices=['absent', 'present']) + state = dict(default='present', choices=['absent', 'present']), + user_data = dict(default=None) ), )