|
|
@ -31,10 +31,10 @@ options:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Name of the project.
|
|
|
|
- Name of the project.
|
|
|
|
required: true
|
|
|
|
required: true
|
|
|
|
displaytext:
|
|
|
|
display_text:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Displaytext of the project.
|
|
|
|
- Display text of the project.
|
|
|
|
- If not specified, C(name) will be used as displaytext.
|
|
|
|
- If not specified, C(name) will be used as C(display_text).
|
|
|
|
required: false
|
|
|
|
required: false
|
|
|
|
default: null
|
|
|
|
default: null
|
|
|
|
state:
|
|
|
|
state:
|
|
|
@ -71,7 +71,7 @@ EXAMPLES = '''
|
|
|
|
- local_action:
|
|
|
|
- local_action:
|
|
|
|
module: cs_project
|
|
|
|
module: cs_project
|
|
|
|
name: web
|
|
|
|
name: web
|
|
|
|
displaytext: my web project
|
|
|
|
display_text: my web project
|
|
|
|
|
|
|
|
|
|
|
|
# Suspend an existing project
|
|
|
|
# Suspend an existing project
|
|
|
|
- local_action:
|
|
|
|
- local_action:
|
|
|
@ -104,7 +104,7 @@ name:
|
|
|
|
returned: success
|
|
|
|
returned: success
|
|
|
|
type: string
|
|
|
|
type: string
|
|
|
|
sample: web project
|
|
|
|
sample: web project
|
|
|
|
displaytext:
|
|
|
|
display_text:
|
|
|
|
description: Display text of the project.
|
|
|
|
description: Display text of the project.
|
|
|
|
returned: success
|
|
|
|
returned: success
|
|
|
|
type: string
|
|
|
|
type: string
|
|
|
@ -173,7 +173,7 @@ class AnsibleCloudStackProject(AnsibleCloudStack):
|
|
|
|
def update_project(self, project):
|
|
|
|
def update_project(self, project):
|
|
|
|
args = {}
|
|
|
|
args = {}
|
|
|
|
args['id'] = project['id']
|
|
|
|
args['id'] = project['id']
|
|
|
|
args['displaytext'] = self.get_or_fallback('displaytext', 'name')
|
|
|
|
args['displaytext'] = self.get_or_fallback('display_text', 'name')
|
|
|
|
|
|
|
|
|
|
|
|
if self._has_changed(args, project):
|
|
|
|
if self._has_changed(args, project):
|
|
|
|
self.result['changed'] = True
|
|
|
|
self.result['changed'] = True
|
|
|
@ -194,7 +194,7 @@ class AnsibleCloudStackProject(AnsibleCloudStack):
|
|
|
|
|
|
|
|
|
|
|
|
args = {}
|
|
|
|
args = {}
|
|
|
|
args['name'] = self.module.params.get('name')
|
|
|
|
args['name'] = self.module.params.get('name')
|
|
|
|
args['displaytext'] = self.get_or_fallback('displaytext', 'name')
|
|
|
|
args['displaytext'] = self.get_or_fallback('display_text', 'name')
|
|
|
|
args['account'] = self.get_account('name')
|
|
|
|
args['account'] = self.get_account('name')
|
|
|
|
args['domainid'] = self.get_domain('id')
|
|
|
|
args['domainid'] = self.get_domain('id')
|
|
|
|
|
|
|
|
|
|
|
@ -262,7 +262,7 @@ def main():
|
|
|
|
module = AnsibleModule(
|
|
|
|
module = AnsibleModule(
|
|
|
|
argument_spec = dict(
|
|
|
|
argument_spec = dict(
|
|
|
|
name = dict(required=True),
|
|
|
|
name = dict(required=True),
|
|
|
|
displaytext = dict(default=None),
|
|
|
|
display_text = dict(default=None),
|
|
|
|
state = dict(choices=['present', 'absent', 'active', 'suspended' ], default='present'),
|
|
|
|
state = dict(choices=['present', 'absent', 'active', 'suspended' ], default='present'),
|
|
|
|
domain = dict(default=None),
|
|
|
|
domain = dict(default=None),
|
|
|
|
account = dict(default=None),
|
|
|
|
account = dict(default=None),
|
|
|
|