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

support for custom data in vmss #51380

Merged
merged 12 commits into from
Jan 30, 2019
Merged

Conversation

zikalino
Copy link
Contributor

SUMMARY

Just adding support for custom data in VMSS machine scaleset

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

azure_rm_virtualmachine_scaleset

ADDITIONAL INFORMATION

@ansibot
Copy link
Contributor

ansibot commented Jan 28, 2019

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 azure cloud community_review In order to be merged, this PR must follow the community review workflow. feature This issue/PR relates to a feature request. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. labels Jan 28, 2019
@ansibot
Copy link
Contributor

ansibot commented Jan 28, 2019

The test ansible-test sanity --test pylint [explain] failed with 3 errors:

lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_scaleset.py:511:48: undefined-variable Undefined variable 'to_bytes'
lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_scaleset.py:647:0: trailing-whitespace Trailing whitespace
lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_scaleset.py:719:44: bad-whitespace No space allowed around keyword argument assignment                                 custom_data = self.custom_data                                             ^

The test ansible-test sanity --test pep8 [explain] failed with 3 errors:

lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_scaleset.py:647:1: W293 blank line contains whitespace
lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_scaleset.py:719:44: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_scaleset.py:719:46: E251 unexpected spaces around keyword / parameter equals

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_scaleset.py:0:0: E309 version_added for new option (custom_data) should be 2.8. Currently 0.0

click here for bot help

@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. labels Jan 28, 2019
@zikalino zikalino requested a review from yungezz January 28, 2019 13:57
@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 Jan 28, 2019
@@ -206,6 +206,11 @@
- A list of Availability Zones for your virtual machine scale set
type: list
version_added: "2.8"
custom_data:
description:
- Custom data for using cloud-init for your VM.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is a file name? or url? or file content?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's content, in rest api it's base64 encoded content.
so I follow the same rules as in vm (vm has the same option).
I think I will add entire description

@@ -498,6 +507,9 @@ def exec_module(self, **kwargs):
# Set default location
self.location = resource_group.location

if self.custom_data:
self.custom_data = to_native(base64.b64encode(to_bytes(self.custom_data)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from code, it's script content, but i think url or filename should be supported for long script.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's limited to 16384 bytes.
users can use Ansible lookups to read the content from file or uri.
i don't think we should make it more complicated here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sense

@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 Jan 29, 2019
@@ -498,6 +507,9 @@ def exec_module(self, **kwargs):
# Set default location
self.location = resource_group.location

if self.custom_data:
self.custom_data = to_native(base64.b64encode(to_bytes(self.custom_data)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sense

@zikalino zikalino closed this Jan 29, 2019
@zikalino
Copy link
Contributor Author

@mattclay seems like I have some weird problem here. resource group can't be found.....

@mattclay
Copy link
Member

@zikalino We were having issues running Azure tests earlier. I've restarted the failed tests.

@zikalino zikalino closed this Jan 29, 2019
@zikalino zikalino reopened this Jan 29, 2019
@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Jan 30, 2019
@ansibot ansibot added needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. and removed needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Jan 30, 2019
@zikalino zikalino merged commit f0f2337 into ansible:devel Jan 30, 2019
@zikalino zikalino deleted the vmss-custom-data branch January 30, 2019 04:09
@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 azure cloud community_review In order to be merged, this PR must follow the community review workflow. feature This issue/PR relates to a feature request. module This issue/PR relates to a module. support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants