-
Notifications
You must be signed in to change notification settings - Fork 23.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cloudscale: new module cloudscale_server_group #54901
Conversation
As a maintainer of a module in the same namespace this new module has been submitted to, your vote counts for shipits. Please review this module and add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this. Most of my comments are only cosmetic or typo fixes. The only real issue I see is with duplicate names of server groups. See inline for the details.
type: str | ||
uuid: | ||
description: | ||
- UUID of the server. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/server/server group/
options: | ||
name: | ||
description: | ||
- Name of the server. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/server/server group/
DOCUMENTATION = ''' | ||
--- | ||
module: cloudscale_server_group | ||
short_description: Manager server groups on cloudscale.ch IaaS service |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Manage server groups on the cloudscale.ch IaaS service
- grp is not changed | ||
- grp.name == '{{ cloudscale_resource_prefix }}-grp' | ||
- grp.uuid | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should check that the same UUID as for the first call is returned. Otherwise it only checks that you can issue the same call twice but not that it does not create a new group.
- grp.name == '{{ cloudscale_resource_prefix }}-grp' | ||
- grp.uuid | ||
|
||
- name: Create server group indempotence |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/indempotence/idempotence/
cloudscale_server_group: | ||
name: '{{ cloudscale_resource_prefix }}-grp' | ||
register: grp | ||
- name: 'VERIFY: Create server group indempotence' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo see above
- grp.name == '{{ cloudscale_resource_prefix }}-grp2' | ||
- grp.uuid == server_group_uuid | ||
|
||
- name: Update server group indempotence |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/indempotence/idempotence/
else: | ||
name = self._info.get('name') | ||
if name is not None: | ||
server_groups = self._get('server-groups') or [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the or []
is needed here. If there are no server groups defined, the API already returns an empty list.
if server_group['name'] == name: | ||
self._info.update(server_group) | ||
self._info.update(dict(state='present')) | ||
break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The API currently allows multiple groups with the same name. Do we need some logic similar to the logic in cloudscale_server
to detect this? Otherwise this could lead to surprising results...
And tests for this case would be nice too.
ready_for_review |
shipit |
SUMMARY
new module cloudscale_server_group
ISSUE TYPE
COMPONENT NAME
cloudscale_server_group
ADDITIONAL INFORMATION