From 7b75563c9b1919c48f0b664cd8a7ec9343f9a659 Mon Sep 17 00:00:00 2001 From: Zim Kalinowski Date: Thu, 21 Mar 2019 02:12:17 +0800 Subject: [PATCH] Azure modules: more doc updates (#54077) * more doc updates * fixed sanity --- .../azure/azure_rm_applicationsecuritygroup.py | 5 +++-- .../cloud/azure/azure_rm_appserviceplan.py | 14 +++++++------- .../modules/cloud/azure/azure_rm_autoscale.py | 16 ++++++++++------ .../cloud/azure/azure_rm_autoscale_facts.py | 8 +++++--- .../modules/cloud/azure/azure_rm_cdnendpoint.py | 11 ++++++----- .../modules/cloud/azure/azure_rm_rediscache.py | 13 +++++++------ .../cloud/azure/azure_rm_rediscache_facts.py | 9 +++++---- 7 files changed, 43 insertions(+), 33 deletions(-) diff --git a/lib/ansible/modules/cloud/azure/azure_rm_applicationsecuritygroup.py b/lib/ansible/modules/cloud/azure/azure_rm_applicationsecuritygroup.py index a516d5e967..5ad7dec169 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_applicationsecuritygroup.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_applicationsecuritygroup.py @@ -55,7 +55,7 @@ EXAMPLES = ''' - name: Create application security group azure_rm_applicationsecuritygroup: resource_group: myResourceGroup - name: MyAsg + name: mySecurityGroup location: eastus tags: foo: bar @@ -67,7 +67,8 @@ id: - Resource id of the application security group. returned: always type: str - sample: /subscriptions//resourceGroups//providers/Microsoft.Network/applicationSecurityGroups/MyAsg + sample: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/applicationSecurityGroups/ + mySecurityGroup" ''' from ansible.module_utils.azure_rm_common import AzureRMModuleBase diff --git a/lib/ansible/modules/cloud/azure/azure_rm_appserviceplan.py b/lib/ansible/modules/cloud/azure/azure_rm_appserviceplan.py index 21e9b790c1..a427ad4500 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_appserviceplan.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_appserviceplan.py @@ -73,25 +73,25 @@ author: EXAMPLES = ''' - name: Create a windows app service plan azure_rm_appserviceplan: - name: "windowsplan1" resource_group: myResourceGroup - location: "eastus" + name: myAppPlan + location: eastus sku: S1 - name: Create a linux app service plan azure_rm_appserviceplan: resource_group: myResourceGroup - name: "linuxplan1" - location: "eastus" + name: myAppPlan + location: eastus sku: S1 is_linux: true number_of_workers: 1 - name: update sku of existing windows app service plan azure_rm_appserviceplan: - name: "windowsplan2" resource_group: myResourceGroup - location: "eastus" + name: myAppPlan + location: eastus sku: S2 ''' @@ -101,7 +101,7 @@ azure_appserviceplan: returned: always type: dict sample: { - "id": "/subscriptions//resourceGroups/ansiblewebapp1_plan/providers/Microsoft.Web/serverfarms/win_appplan11" + "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Web/serverfarms/myAppPlan" } ''' diff --git a/lib/ansible/modules/cloud/azure/azure_rm_autoscale.py b/lib/ansible/modules/cloud/azure/azure_rm_autoscale.py index dd07353b25..57b5e2cce2 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_autoscale.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_autoscale.py @@ -202,7 +202,7 @@ author: EXAMPLES = ''' - name: Create an auto scale azure_rm_autoscale: - target: "/subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/resourceGroups/foo/providers/Microsoft.Compute/virtualMachineScaleSets/vmss" + target: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" enabled: true profiles: - count: '1' @@ -222,7 +222,8 @@ EXAMPLES = ''' - name: Create an auto scale with compicated profile azure_rm_autoscale: - target: "/subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/resourceGroups/foo/providers/Microsoft.Compute/virtualMachineScaleSets/vmss" + target: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets + /myVmss" enabled: true profiles: - count: '1' @@ -234,7 +235,8 @@ EXAMPLES = ''' time_window: 10 direction: Increase metric_name: Percentage CPU - metric_resource_uri: "/subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/resourceGroups/foo/providers/Microsoft.Compute/virtualMachineScaleSets/vmss" + metric_resource_uri: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtua + lMachineScaleSets/vmss" value: '1' threshold: 70 cooldown: 5 @@ -273,7 +275,7 @@ state: sample: { "changed": false, "enabled": true, - "id": "/subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/resourceGroups/foo/providers/microsoft.insights/autoscalesettings/scale", + "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/microsoft.insights/autoscalesettings/scale", "location": "eastus", "name": "scale", "notifications": [ @@ -308,7 +310,8 @@ state: "cooldown": 5.0, "direction": "Increase", "metric_name": "Percentage CPU", - "metric_resource_uri": "/subscriptions/X/resourceGroups/foo/providers/Microsoft.Compute/virtualMachineScaleSets/vmss", + "metric_resource_uri": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsof + t.Compute/virtualMachineScaleSets/MyVmss", "operator": "GreaterThan", "statistic": "Average", "threshold": 70.0, @@ -321,7 +324,8 @@ state: ] } ], - "target": "/subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/resourceGroups/foo/providers/Microsoft.Compute/virtualMachineScaleSets/vmss" + "target": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScale + Sets/myVmss" } ''' # NOQA diff --git a/lib/ansible/modules/cloud/azure/azure_rm_autoscale_facts.py b/lib/ansible/modules/cloud/azure/azure_rm_autoscale_facts.py index abf4805c3b..1a59f2c443 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_autoscale_facts.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_autoscale_facts.py @@ -59,7 +59,7 @@ autoscales: type: list sample: [{ "enabled": true, - "id": "/subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/resourceGroups/foo/providers/microsoft.insights/autoscalesettings/scale", + "id": "/subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/resourceGroups/myResourceGroup/providers/microsoft.insights/autoscalesettings/scale", "location": "eastus", "name": "scale", "notifications": [ @@ -94,7 +94,8 @@ autoscales: "cooldown": 5.0, "direction": "Increase", "metric_name": "Percentage CPU", - "metric_resource_uri": "/subscriptions/XX/resourceGroups/foo/providers/Microsoft.Compute/virtualMachineScaleSets/vmss", + "metric_resource_uri": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsof + t.Compute/virtualMachineScaleSets/myVmss", "operator": "GreaterThan", "statistic": "Average", "threshold": 70.0, @@ -107,7 +108,8 @@ autoscales: ] } ], - "target": "/subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/resourceGroups/foo/providers/Microsoft.Compute/virtualMachineScaleSets/vmss" + "target": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScale + Sets/myVmss" }] ''' diff --git a/lib/ansible/modules/cloud/azure/azure_rm_cdnendpoint.py b/lib/ansible/modules/cloud/azure/azure_rm_cdnendpoint.py index e51612036e..0b572bd45e 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_cdnendpoint.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_cdnendpoint.py @@ -125,8 +125,8 @@ EXAMPLES = ''' - name: Create a Azure CDN endpoint azure_rm_cdnendpoint: resource_group: myResourceGroup - name: TestEndpoint - profile_name: TestProfile + profile_name: myProfile + name: myEndpoint origins: - name: TestOrig host_name: "www.example.com" @@ -137,8 +137,8 @@ EXAMPLES = ''' - name: Delete a Azure CDN endpoint azure_rm_cdnendpoint: resource_group: myResourceGroup - name: TestEndpoint - profile_name: TestProfile + profile_name: myProfile + name: myEndpoint state: absent ''' RETURN = ''' @@ -151,7 +151,8 @@ id: - Id of the CDN endpoint. returned: always type: str - sample: "/subscriptions//resourcegroups/xxx/providers/Microsoft.Cdn/profiles/xxx/endpoints/xxx" + sample: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/myResourceGroup/providers/Microsoft.Cdn/profiles/myProfile/endpoints/ + myEndpoint" host_name: description: - Host name of the CDN endpoint. diff --git a/lib/ansible/modules/cloud/azure/azure_rm_rediscache.py b/lib/ansible/modules/cloud/azure/azure_rm_rediscache.py index 0eb536d10e..e24c710591 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_rediscache.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_rediscache.py @@ -132,7 +132,7 @@ EXAMPLES = ''' - name: Create a redis cache azure_rm_rediscache: resource_group: myResourceGroup - name: myRedisCache + name: myRedis sku: name: basic size: C1 @@ -141,7 +141,7 @@ EXAMPLES = ''' - name: Scale up the redis cache azure_rm_rediscache: resource_group: myResourceGroup - name: myRedisCache + name: myRedis sku: name: standard size: C1 @@ -151,11 +151,12 @@ EXAMPLES = ''' - name: Create redis with subnet azure_rm_rediscache: resource_group: myResourceGroup - name: myRedisCache2 + name: myRedis sku: name: premium size: P1 - subnet: /subscriptions//resourceGroups/redistest1/providers/Microsoft.Network/virtualNetworks/testredisvnet1/subnets/subnet1 + subnet: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirt + ualNetwork/subnets/mySubnet" ''' @@ -165,14 +166,14 @@ id: returned: always type: str sample: { - "id": "/subscriptions//resourceGroups/rg/providers/Microsoft.Cache/Redis/redis1" + "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Cache/Redis/myRedis" } host_name: description: Host name of the redis cache. returned: state is present type: str sample: { - "host_name": "redis1.redis.cache.windows.net" + "host_name": "myredis.redis.cache.windows.net" } ''' diff --git a/lib/ansible/modules/cloud/azure/azure_rm_rediscache_facts.py b/lib/ansible/modules/cloud/azure/azure_rm_rediscache_facts.py index 089e87efd5..c16e16e75a 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_rediscache_facts.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_rediscache_facts.py @@ -75,19 +75,19 @@ rediscaches: - Name of a resource group where the Azure Redis Cache belongs to. returned: always type: str - sample: testGroup + sample: myResourceGroup name: description: - Name of the Azure Redis Cache. returned: always type: str - sample: testRedis + sample: myRedis id: description: - Id of the Azure Redis Cache. returned: always type: str - sample: /subscriptions//resourceGroups/myResourceGroup/providers/Microsoft.Cache/Redis/myRedis + sample: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Cache/Redis/myRedis provisioning_state: description: - Provisioning state of the redis cahe @@ -129,7 +129,8 @@ rediscaches: - The full resource ID of a subnet in a virtual network to deploy the Redis cache in. type: str sample: - - /subscriptions//resourceGroups/myResourceGroup/Microsoft.Network|ClassicNetwork/VirtualNetworks/vnet1/subnets/subnet1 + - "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/Microsoft.Network/VirtualNetworks/myVirtualNetwo + rk/subnets/mySubnet" configuration: description: - Dict of redis configuration.