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

resolved issue #142 #264

Merged
merged 29 commits into from
Oct 28, 2020
Merged

Conversation

ShwetaliBerad
Copy link
Contributor

SUMMARY

Fixes #142

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

azure_rm_subnet

ADDITIONAL INFORMATION

Subnet delegation enables you to designate a specific subnet for an Azure PaaS service of your choice that needs to be injected into your virtual network. Subnet delegation provides full control to the customer on managing the integration of Azure services into their virtual networks.
When you delegate a subnet to an Azure service, you allow that service to establish some basic network configuration rules for that subnet, which help the Azure service operate their instances in a stable manner. As a result, the Azure service may establish some pre or post deployment conditions, such as:

  1. deploy the service in a shared versus dedicated subnet.
  2. add to the service a set of Network Intent Policies post deployment that is required for the service to work properly.

Sample output:

TASK [Add subnet] ****************************************************************************************************************************
task path: /home/shwetali/Ansible/azure_subnet.yaml:21
changed: [localhost] => {
    "changed": true,
    "invocation": {
        "module_args": {
            "ad_user": null,
            "address_prefix": "10.0.1.0/24",
            "address_prefix_cidr": "10.0.1.0/24",
            "adfs_authority_url": null,
            "api_profile": "latest",
            "auth_source": null,
            "cert_validation_mode": null,
            "client_id": null,
            "cloud_environment": "AzureCloud",
            "delegations": [
                {
                    "name": "mydeleg",
                    "serviceName": "Microsoft.ContainerInstance/containerGroups"
                }
            ],
            "name": "test1",
            "password": null,
            "profile": null,
            "resource_group": "test1",
            "route_table": null,
            "secret": null,
            "security_group": null,
            "service_endpoints": null,
            "state": "present",
            "subscription_id": null,
            "tenant": null,
            "virtual_network": "test1",
            "virtual_network_name": "test1"
        }
    },
    "state": {
        "address_prefix": "10.0.1.0/24",
        "delegations": [
            {
                "actions": [
                    "Microsoft.Network/virtualNetworks/subnets/action"
                ],
                "name": "mydeleg",
                "serviceName": "Microsoft.ContainerInstance/containerGroups"
            }
        ],
        "id": "/subscriptions/<subscription_id>/resourceGroups/test1/providers/Microsoft.Network/virtualNetworks/test1/subnets/test1",
        "name": "test1",
        "network_security_group": {},
        "provisioning_state": "Succeeded",
        "route_table": {}
    }
}

@ShwetaliBerad
Copy link
Contributor Author

@Fred-sun can you please review this PR ?

plugins/modules/azure_rm_subnet.py Outdated Show resolved Hide resolved
plugins/modules/azure_rm_subnet.py Show resolved Hide resolved
plugins/modules/azure_rm_subnet.py Outdated Show resolved Hide resolved
plugins/modules/azure_rm_subnet.py Show resolved Hide resolved
plugins/modules/azure_rm_subnet.py Show resolved Hide resolved
plugins/modules/azure_rm_subnet.py Show resolved Hide resolved
plugins/modules/azure_rm_subnet.py Show resolved Hide resolved
@ShwetaliBerad
Copy link
Contributor Author

@Fred-sun @haiyuazhang updated arg_spec according to review comments , also please check comment for removal of line elements='dict'

@ShwetaliBerad
Copy link
Contributor Author

@Fred-sun Any feedback on this ? Please check above comments

@Fred-sun
Copy link
Collaborator

RROR: Found 12 pep8 issue(s) which need to be resolved:
ERROR: plugins/modules/azure_rm_subnet.py:267:161: E501: line too long (261 > 160 characters)
ERROR: plugins/modules/azure_rm_subnet.py:267:262: W291: trailing whitespace
ERROR: plugins/modules/azure_rm_subnet.py:268:1: E128: continuation line under-indented for visual indent
ERROR: plugins/modules/azure_rm_subnet.py:268:161: E501: line too long (256 > 160 characters)
ERROR: plugins/modules/azure_rm_subnet.py:268:257: W291: trailing whitespace
ERROR: plugins/modules/azure_rm_subnet.py:269:1: E128: continuation line under-indented for visual indent
ERROR: plugins/modules/azure_rm_subnet.py:269:161: E501: line too long (271 > 160 characters)
ERROR: plugins/modules/azure_rm_subnet.py:269:272: W291: trailing whitespace
ERROR: plugins/modules/azure_rm_subnet.py:270:1: E128: continuation line under-indented for visual indent
ERROR: plugins/modules/azure_rm_subnet.py:270:161: E501: line too long (271 > 160 characters)
ERROR: plugins/modules/azure_rm_subnet.py:270:272: W291: trailing whitespace
ERROR: plugins/modules/azure_rm_subnet.py:271:1: E128: continuation line under-indented for visual indent
RROR: plugins/modules/azure_rm_subnet.py:0:0: doc-choices-do-not-match-spec: Argument 'serviceName' in argument_spec found in delegations defines choices as (['Microsoft.Web/serverFarms', 'Microsoft.ContainerInstance/containerGroups', 'Microsoft.Netapp/volumes', 'Microsoft.HardwareSecurityModules/dedicatedHSMs', 'Microsoft.ServiceFabricMesh/networks', 'Microsoft.Logic/integrationServiceEnvironments', 'Microsoft.Batch/batchAccounts', 'Microsoft.Sql/managedInstances', 'Microsoft.Web/hostingEnvironments', 'Microsoft.BareMetal/CrayServers', 'Microsoft.BareMetal/MonitoringServers', 'Microsoft.Databricks/workspaces', 'Microsoft.BareMetal/AzureHostedService', 'Microsoft.BareMetal/AzureVMware', 'Microsoft.BareMetal/AzureHPC', 'Microsoft.BareMetal/AzurePaymentHSM', 'Microsoft.StreamAnalytics/streamingJobs', 'Microsoft.DBforPostgreSQL/serversv2', 'Microsoft.AzureCosmosDB/clusters', 'Microsoft.MachineLearningServices/workspaces', 'Microsoft.DBforPostgreSQL/singleServers', 'Microsoft.DBforPostgreSQL/flexibleServers', 'Microsoft.DBforMySQL/serversv2', 'Microsoft.DBforMySQL/flexibleServers', 'Microsoft.ApiManagement/service', 'Microsoft.Synapse/workspaces', 'Microsoft.PowerPlatform/vnetaccesslinks', 'Microsoft.Network/managedResolvers', 'Microsoft.Kusto/clusters']) but documentation defines choices as ([])
ERROR: plugins/modules/azure_rm_subnet.py:0:0: doc-elements-mismatch: Argument 'delegations' in argument_spec specifies elements as dict,but elements is not documented

@Fred-sun Fred-sun added work in In trying to solve, or in working with contributors medium_priority Medium priority labels Sep 30, 2020
@ShwetaliBerad
Copy link
Contributor Author

@Fred-sun updated test as per the review comments

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.

Add a line to the following file: plugins/modules/azure_rm_subnet.py Validate -modules:doc-elements-mismatch

tests/sanity/ignore-2.10.txt
tests/sanity/ignore-2.11.txt

plugins/modules/azure_rm_subnet.py Show resolved Hide resolved
@ShwetaliBerad
Copy link
Contributor Author

ShwetaliBerad commented Oct 13, 2020

Add a line to the following file: plugins/modules/azure_rm_subnet.py Validate -modules:doc-elements-mismatch

tests/sanity/ignore-2.10.txt
tests/sanity/ignore-2.11.txt

Done

@ShwetaliBerad
Copy link
Contributor Author

@Fred-sun Please check updated PR commits

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.

308,309,310,311,312,313,314,315,316 --- continuation line under-indented for visual indent!

tests/integration/targets/azure_rm_subnet/tasks/main.yml Outdated Show resolved Hide resolved
plugins/modules/azure_rm_subnet.py Outdated Show resolved Hide resolved
ShwetaliBerad and others added 3 commits October 16, 2020 11:28
Co-authored-by: Fred-sun <37327967+Fred-sun@users.noreply.github.com>
Co-authored-by: Fred-sun <37327967+Fred-sun@users.noreply.github.com>
@ShwetaliBerad
Copy link
Contributor Author

@Fred-sun made changes as suggested. Any more change required at lines 308,309,310,311,312,313,314,315,316 in plugins/modules/azure_rm_subnet.py ?

@ShwetaliBerad
Copy link
Contributor Author

@Fred-sun could you please review changes ?

@Fred-sun
Copy link
Collaborator

@Fred-sun could you please review changes ?

ERROR: plugins/modules/azure_rm_subnet.py:308:17: E128: continuation line under-indented for visual indent
ERROR: plugins/modules/azure_rm_subnet.py:309:17: E128: continuation line under-indented for visual indent
ERROR: plugins/modules/azure_rm_subnet.py:310:17: E128: continuation line under-indented for visual indent
ERROR: plugins/modules/azure_rm_subnet.py:311:17: E128: continuation line under-indented for visual indent
ERROR: plugins/modules/azure_rm_subnet.py:312:17: E128: continuation line under-indented for visual indent
ERROR: plugins/modules/azure_rm_subnet.py:313:17: E128: continuation line under-indented for visual indent
ERROR: plugins/modules/azure_rm_subnet.py:314:17: E128: continuation line under-indented for visual indent
ERROR: plugins/modules/azure_rm_subnet.py:315:17: E128: continuation line under-indented for visual indent
ERROR: plugins/modules/azure_rm_subnet.py:316:17: E128: continuation line under-indented for visual indent

@ShwetaliBerad
Copy link
Contributor Author

@Fred-sun can you review now ?

ShwetaliBerad and others added 3 commits October 26, 2020 12:06
Co-authored-by: Fred-sun <37327967+Fred-sun@users.noreply.github.com>
Co-authored-by: Fred-sun <37327967+Fred-sun@users.noreply.github.com>
@ShwetaliBerad
Copy link
Contributor Author

@Fred-sun : made changes as suggested ..kindly check

@Fred-sun
Copy link
Collaborator

@ShwetaliBerad Test pass, I will push for merge!

@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 26, 2020
@ShwetaliBerad
Copy link
Contributor Author

@Fred-sun Thanks!

@haiyuazhang haiyuazhang merged commit 8d7fc53 into ansible-collections:dev Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium_priority Medium priority 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.

Add Delegations to azure_rm_subnet module
3 participants