Skip to content

Commit

Permalink
Fixed sanity errors in the module (#1296)
Browse files Browse the repository at this point in the history
* Fix sanity error

* Fix sanity fail

* Modify the remaining errors

* Modify the remaining errors -- 02

* new change for sanity fail

* last change

* fix sanity error

* Fix sanity fail

* new change for sanity fail

* new change

* last change

* new change for test fail

* new change for azure_rm_galleryimageversion.py

* Modify azure_rm_appgate.py' rule_type choices

* Enable azure_rm_iothub test case

* Add required to some module

* Modify azure_rm_rediscache.py

* Add choices to azure_rm_trafficmanagerprofile.py'protocols

* Modify azure_rm_virtualmachinescalesetinstance.py

* Modify azure_rm_devtestlabvirtualmachine.py

* New change for some modules

* Delete unexpected spaces

* fix closing bracket errors
  • Loading branch information
Fred-sun authored Nov 1, 2023
1 parent c5dedcd commit 17460b0
Show file tree
Hide file tree
Showing 142 changed files with 2,023 additions and 1,141 deletions.
7 changes: 3 additions & 4 deletions plugins/modules/azure_rm_adpassword.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

from __future__ import absolute_import, division, print_function
import datetime

__metaclass__ = type

Expand Down Expand Up @@ -66,7 +65,6 @@
extends_documentation_fragment:
- azure.azcollection.azure
- azure.azcollection.azure_tags
author:
haiyuan_zhang (@haiyuazhang)
Expand All @@ -90,7 +88,7 @@
- Default value is one year after current time.
type: str
returned: always
sample: 2021-06-28T06:00:32.637070+00:00
sample: "2021-06-28T06:00:32.637070+00:00"
key_id:
description:
- The password key ID
Expand All @@ -103,12 +101,13 @@
- Default value is current time.
type: str
returned: always
sample: 2020-06-28T06:00:32.637070+00:00
sample: "2020-06-28T06:00:32.637070+00:00"
'''

from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase
import uuid
import datetime

try:
from azure.graphrbac.models import GraphErrorException
Expand Down
8 changes: 4 additions & 4 deletions plugins/modules/azure_rm_adpassword_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@
description:
- Date or datemtime after which credentials expire.
- Default value is one year after current time.
type: datetime
type: str
returned: always
sample: 2021-06-18T06:51:25.508304+00:00
sample: "2021-06-18T06:51:25.508304+00:00"
key_id:
description:
- The password key ID.
Expand All @@ -98,9 +98,9 @@
description:
- Date or datetime at which credentials become valid.
- Default value is current time
type: datetime
type: str
returned: always
sample: 2020-06-18T06:51:25.508304+00:00
sample: "2020-06-18T06:51:25.508304+00:00"
'''

Expand Down
1 change: 0 additions & 1 deletion plugins/modules/azure_rm_adserviceprincipal.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
extends_documentation_fragment:
- azure.azcollection.azure
- azure.azcollection.azure_tags
author:
haiyuan_zhang (@haiyuazhang)
Expand Down
84 changes: 75 additions & 9 deletions plugins/modules/azure_rm_aks.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,59 +21,74 @@
description:
- Name of a resource group where the managed Azure Container Services (AKS) exists or will be created.
required: true
type: str
name:
description:
- Name of the managed Azure Container Services (AKS) instance.
required: true
type: str
state:
description:
- Assert the state of the AKS. Use C(present) to create or update an AKS and C(absent) to delete it.
default: present
type: str
choices:
- absent
- present
location:
description:
- Valid azure location. Defaults to location of the resource group.
type: str
dns_prefix:
description:
- DNS prefix specified when creating the managed cluster.
type: str
kubernetes_version:
description:
- Version of Kubernetes specified when creating the managed cluster.
type: str
linux_profile:
description:
- The Linux profile suboptions.
- Optional, provide if you need an ssh access to the cluster nodes.
type: dict
suboptions:
admin_username:
description:
- The Admin Username for the cluster.
required: true
type: str
ssh_key:
description:
- The Public SSH Key used to access the cluster.
required: true
type: str
agent_pool_profiles:
description:
- The agent pool profile suboptions.
type: list
elements: dict
suboptions:
name:
description:
- Unique name of the agent pool profile in the context of the subscription and resource group.
required: true
type: str
count:
description:
- Number of agents (VMs) to host docker containers.
- Allowed values must be in the range of C(1) to C(100) (inclusive).
required: true
type: int
vm_size:
description:
- The VM Size of each of the Agent Pool VM's (e.g. C(Standard_F1) / C(Standard_D2v2)).
required: true
type: str
os_disk_size_gb:
description:
- Size of the OS disk.
type: int
enable_auto_scaling:
description:
- To enable auto-scaling.
Expand Down Expand Up @@ -130,17 +145,43 @@
- 1
- 2
- 3
os_type:
description:
- The operating system type.
type: str
choices:
- Linux
- Windows
storage_profiles:
description:
- Storage profile specifies what kind of storage used.
type: str
choices:
- StorageAccount
- ManagedDisks
ports:
description:
- List of the agent pool's port.
type: list
elements: int
dns_prefix:
description:
- DNS prefix specified when creating the managed cluster.
type: str
service_principal:
description:
- The service principal suboptions. If not provided - use system-assigned managed identity.
type: dict
suboptions:
client_id:
description:
- The ID for the Service Principal.
type: str
required: true
client_secret:
description:
- The secret password associated with the service principal.
type: str
enable_rbac:
description:
- Enable RBAC.
Expand All @@ -150,6 +191,7 @@
network_profile:
description:
- Profile of network configuration.
type: dict
suboptions:
network_plugin:
description:
Expand All @@ -158,12 +200,13 @@
- With C(kubenet), nodes get an IP address from the Azure virtual network subnet.
- AKS features such as Virtual Nodes or network policies aren't supported with C(kubenet).
- C(azure) enables Azure Container Networking Interface(CNI), every pod gets an IP address from the subnet and can be accessed directly.
default: kubenet
type: str
choices:
- azure
- kubenet
network_policy:
description: Network policy used for building Kubernetes network.
type: str
choices:
- azure
- calico
Expand All @@ -172,39 +215,42 @@
- A CIDR notation IP range from which to assign pod IPs when I(network_plugin=kubenet) is used.
- It should be a large address space that isn't in use elsewhere in your network environment.
- This address range must be large enough to accommodate the number of nodes that you expect to scale up to.
default: "10.244.0.0/16"
type: str
service_cidr:
description:
- A CIDR notation IP range from which to assign service cluster IPs.
- It must not overlap with any Subnet IP ranges.
- It should be the *.10 address of your service IP address range.
default: "10.0.0.0/16"
type: str
dns_service_ip:
description:
- An IP address assigned to the Kubernetes DNS service.
- It must be within the Kubernetes service address range specified in serviceCidr.
default: "10.0.0.10"
type: str
docker_bridge_cidr:
description:
- A CIDR notation IP range assigned to the Docker bridge network.
- It must not overlap with any Subnet IP ranges or the Kubernetes service address range.
default: "172.17.0.1/16"
type: str
load_balancer_sku:
description:
- The load balancer sku for the managed cluster.
type: str
choices:
- standard
- basic
outbound_type:
description:
- How outbound traffic will be configured for a cluster.
type: str
default: loadBalancer
choices:
- loadBalancer
- userDefinedRouting
api_server_access_profile:
description:
- Profile of API Access configuration.
type: dict
suboptions:
authorized_ip_ranges:
description:
Expand All @@ -220,17 +266,22 @@
aad_profile:
description:
- Profile of Azure Active Directory configuration.
type: dict
suboptions:
client_app_id:
description: The client AAD application ID.
type: str
server_app_id:
description: The server AAD application ID.
type: str
server_app_secret:
description: The server AAD application secret.
type: str
tenant_id:
description:
- The AAD tenant ID to use for authentication.
- If not specified, will use the tenant of the deployment subscription.
type: str
managed:
description:
- Whether to enable manged AAD.
Expand All @@ -252,39 +303,54 @@
description:
- The HTTP application routing solution makes it easy to access applications that are deployed to your cluster.
type: dict
aliases:
- httpApplicationRouting
suboptions:
enabled:
description:
- Whether the solution enabled.
type: bool
default: true
monitoring:
description:
- It gives you performance visibility by collecting memory and processor metrics from controllers, nodes,
and containers that are available in Kubernetes through the Metrics API.
type: dict
aliases:
- omsagent
suboptions:
enabled:
description:
- Whether the solution enabled.
type: bool
default: true
log_analytics_workspace_resource_id:
description:
- Where to store the container metrics.
type: str
required: true
aliases:
- logAnalyticsWorkspaceResourceID
virtual_node:
description:
- With virtual nodes, you have quick provisioning of pods, and only pay per second for their execution time.
- You don't need to wait for Kubernetes cluster autoscaler to deploy VM compute nodes to run the additional pods.
type: dict
aliases:
- aciConnector
suboptions:
enabled:
description:
- Whether the solution enabled.
type: bool
default: true
subnet_resource_id:
description:
- Subnet associated to the cluster.
type: str
required: true
aliases:
- SubnetName
node_resource_group:
description:
- Name of the resource group containing agent pool nodes.
Expand Down Expand Up @@ -611,8 +677,8 @@ def create_addon_profiles_spec():
availability_zones=dict(type='list', elements='int', choices=[1, 2, 3]),
os_type=dict(type='str', choices=['Linux', 'Windows']),
orchestrator_version=dict(type='str', required=False),
type=dict(type='str', choice=['VirtualMachineScaleSets', 'AvailabilitySet']),
mode=dict(type='str', choice=['System', 'User']),
type=dict(type='str', choices=['VirtualMachineScaleSets', 'AvailabilitySet']),
mode=dict(type='str', choices=['System', 'User']),
enable_auto_scaling=dict(type='bool'),
max_count=dict(type='int'),
node_labels=dict(type='dict'),
Expand All @@ -623,12 +689,12 @@ def create_addon_profiles_spec():

network_profile_spec = dict(
network_plugin=dict(type='str', choices=['azure', 'kubenet']),
network_policy=dict(type='str'),
network_policy=dict(type='str', choices=['azure', 'calico']),
pod_cidr=dict(type='str'),
service_cidr=dict(type='str'),
dns_service_ip=dict(type='str'),
docker_bridge_cidr=dict(type='str'),
load_balancer_sku=dict(type='str'),
load_balancer_sku=dict(type='str', choices=['standard', 'basic']),
outbound_type=dict(type='str', default='loadBalancer', choices=['userDefinedRouting', 'loadBalancer'])
)

Expand Down
3 changes: 3 additions & 0 deletions plugins/modules/azure_rm_aks_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@
name:
description:
- Limit results to a specific resource group.
type: str
resource_group:
description:
- The resource group to search for the desired Azure Kubernetes Service
type: str
tags:
description:
- Limit results by providing a list of tags. Format tags as 'key' or 'key:value'.
Expand All @@ -35,6 +37,7 @@
description:
- Show kubeconfig of the AKS cluster.
- Note the operation will cost more network overhead, not recommended when listing AKS.
type: str
choices:
- user
- admin
Expand Down
2 changes: 2 additions & 0 deletions plugins/modules/azure_rm_aksversion_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
description:
- Get the versions available for creating a managed Kubernetes cluster.
required: true
type: str
version:
description:
- Get the upgrade versions available for a managed Kubernetes cluster version.
type: str
extends_documentation_fragment:
- azure.azcollection.azure
Expand Down
Loading

0 comments on commit 17460b0

Please sign in to comment.