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

Azure rm subscription info #280

Merged
merged 20 commits into from
Oct 13, 2020

Conversation

paultaiton
Copy link
Contributor

@paultaiton paultaiton commented Oct 5, 2020

Create module for azure_rm_subscription_info

SUMMARY

There does not exist an easy way to fetch Azure Subscription information from within Ansible. This PR creates a new azure_rm_subscription_info module that allows for querying of subscriptions based on id, name, or to fetch a list of all subscriptions.

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

azure_rm_subscription_info

ADDITIONAL INFORMATION

This new module being strictly informational is straightforward. However I had to add some conditional logic in azure_rm_common to suppress the passing of "subscription_id" to the SubscriptionClient instantiation. I tried to do it in a client agnostic manner, but I'm not aware of any others that also require it.

I have included some simplistic integration tests, however one of the files, 'aliases', I am unfamiliar with and will need some assistance with to validate that the contents that I copied from another is sufficient.

Copy link
Collaborator

@Fred-sun Fred-sun left a comment

Choose a reason for hiding this comment

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

Please add the next two lines to the tests/sanity/ignore-2.10.txt file

plugins/modules/azure_rm_subscription_info.py validate-modules:required_if-requirements-unknown
plugins/modules/azure_rm_subscription_info.py validate-modules:required_if-unknown-key

plugins/module_utils/azure_rm_common.py Outdated Show resolved Hide resolved
plugins/modules/azure_rm_subscription_info.py Show resolved Hide resolved
plugins/modules/azure_rm_subscription_info.py Outdated Show resolved Hide resolved
plugins/modules/azure_rm_subscription_info.py Outdated Show resolved Hide resolved
plugins/modules/azure_rm_subscription_info.py Outdated Show resolved Hide resolved
plugins/modules/azure_rm_subscription_info.py Show resolved Hide resolved
plugins/modules/azure_rm_subscription_info.py Outdated Show resolved Hide resolved
plugins/modules/azure_rm_subscription_info.py Show resolved Hide resolved
plugins/modules/azure_rm_subscription_info.py Outdated Show resolved Hide resolved
plugins/modules/azure_rm_subscription_info.py Outdated Show resolved Hide resolved
@Fred-sun
Copy link
Collaborator

Fred-sun commented Oct 7, 2020

Please modify pr-pipelines.yml file , add 'azure_rm_subscription'.

@paultaiton
Copy link
Contributor Author

Please modify pr-pipelines.yml file , add 'azure_rm_subscription'.

I have added this entry.

@paultaiton
Copy link
Contributor Author

@Fred-sun
Appreciate your review. I believe I have implemented all suggestions.

Thanks.

Copy link
Collaborator

@Fred-sun Fred-sun left a comment

Choose a reason for hiding this comment

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

Delete the spaces after 201, 202,203 and 204 lines!
Delete the space before 201,202,203 and 204 lines!

tests/sanity/ignore-2.10.txt Show resolved Hide resolved
plugins/modules/azure_rm_subscription_info.py Outdated Show resolved Hide resolved
@Fred-sun Fred-sun added medium_priority Medium priority new_module_pr Add new modules work in In trying to solve, or in working with contributors labels Oct 9, 2020
@paultaiton
Copy link
Contributor Author

Delete the spaces after 201, 202,203 and 204 lines!
Delete the space before 201,202,203 and 204 lines!

I do not fully understanding this request. I've removed the wrapping parenthesis since they are no longer necessary, and formatted it to what I think you want, but I'm not sure to what specific thing you're referring.

@Fred-sun
Copy link
Collaborator

Fred-sun commented Oct 9, 2020

Delete the spaces after 201, 202,203 and 204 lines!
Delete the space before 201,202,203 and 204 lines!

I do not fully understanding this request. I've removed the wrapping parenthesis since they are no longer necessary, and formatted it to what I think you want, but I'm not sure to what specific thing you're referring.

In order to comply with the python code pep8 specification! Thank you!

@Fred-sun
Copy link
Collaborator

Fred-sun commented Oct 9, 2020

Add the following three lines to tests/sanity/ignore-2.11.txt

plugins/modules/azure_rm_subscription_info.py validate-modules:required_if-requirements-unknown
plugins/modules/azure_rm_subscription_info.py validate-modules:required_if-unknown-key
plugins/modules/azure_rm_subscription_info.py validate-modules:doc-elements-mismatch

@paultaiton
Copy link
Contributor Author

@Fred-sun

Add the following three lines to tests/sanity/ignore-2.11.txt

This has been done.

@Fred-sun Fred-sun added ready_for_review The PR has been modified and can be reviewed and merged and removed work in In trying to solve, or in working with contributors labels Oct 12, 2020
@haiyuazhang haiyuazhang merged commit 060839b into ansible-collections:dev Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium_priority Medium priority new_module_pr Add new modules ready_for_review The PR has been modified and can be reviewed and merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants