Skip to content
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

Merged
merged 3 commits into from
Apr 10, 2019
Merged

cloudscale: new module cloudscale_server_group #54901

merged 3 commits into from
Apr 10, 2019

Conversation

resmo
Copy link
Contributor

@resmo resmo commented Apr 5, 2019

SUMMARY

new module cloudscale_server_group

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

cloudscale_server_group

ADDITIONAL INFORMATION

@ansibot
Copy link
Contributor

ansibot commented Apr 5, 2019

@gaudenz

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 shipit if you would like to see it merged.

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Apr 5, 2019

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 cloud community_review In order to be merged, this PR must follow the community review workflow. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. new_module This PR includes a new module. new_plugin This PR includes a new plugin. support:community This issue/PR relates to code supported by the Ansible community. test This PR relates to tests. labels Apr 5, 2019
Copy link
Contributor

@gaudenz gaudenz left a 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.
Copy link
Contributor

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.
Copy link
Contributor

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
Copy link
Contributor

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

Copy link
Contributor

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
Copy link
Contributor

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'
Copy link
Contributor

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
Copy link
Contributor

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 []
Copy link
Contributor

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
Copy link
Contributor

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.

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. needs_triage Needs a first human triage before being processed. labels Apr 9, 2019
@resmo
Copy link
Contributor Author

resmo commented Apr 10, 2019

ready_for_review

@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Apr 10, 2019
@gaudenz
Copy link
Contributor

gaudenz commented Apr 10, 2019

shipit

@resmo resmo merged commit 166a33e into ansible:devel Apr 10, 2019
@resmo resmo deleted the feature/cloudscale_server_group branch April 10, 2019 16:51
@ansible ansible locked and limited conversation to collaborators Jul 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 cloud community_review In order to be merged, this PR must follow the community review workflow. module This issue/PR relates to a module. new_module This PR includes a new module. new_plugin This PR includes a new plugin. support:community This issue/PR relates to code supported by the Ansible community. test This PR relates to tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants