|
|
|
@ -17,7 +17,7 @@ DOCUMENTATION = '''
|
|
|
|
|
---
|
|
|
|
|
module: azure_rm_rediscache
|
|
|
|
|
version_added: "2.8"
|
|
|
|
|
short_description: Manage Azure Cache for Redis instance.
|
|
|
|
|
short_description: Manage Azure Cache for Redis instance
|
|
|
|
|
description:
|
|
|
|
|
- Create, update and delete instance of Azure Cache for Redis.
|
|
|
|
|
|
|
|
|
@ -34,10 +34,12 @@ options:
|
|
|
|
|
description:
|
|
|
|
|
- Resource location. If not set, location from the resource group will be used as default.
|
|
|
|
|
sku:
|
|
|
|
|
description: Sku info of Azure Cache for Redis.
|
|
|
|
|
description:
|
|
|
|
|
- SKU info of Azure Cache for Redis.
|
|
|
|
|
suboptions:
|
|
|
|
|
name:
|
|
|
|
|
description: Type of Azure Cache for Redis to deploy
|
|
|
|
|
description:
|
|
|
|
|
- Type of Azure Cache for Redis to deploy.
|
|
|
|
|
choices:
|
|
|
|
|
- basic
|
|
|
|
|
- standard
|
|
|
|
@ -46,8 +48,8 @@ options:
|
|
|
|
|
size:
|
|
|
|
|
description:
|
|
|
|
|
- Size of Azure Cache for Redis to deploy.
|
|
|
|
|
- When I(sku) is C(basic) or C(standard), allowed values are C0, C1, C2, C3, C4, C5, C6.
|
|
|
|
|
- When I(sku) is C(premium), allowed values are P1, P2, P3, P4.
|
|
|
|
|
- When I(sku=basic) or I(sku=standard), allowed values are C(C0), C(C1), C(C2), C(C3), C(C4), C(C5), C(C6).
|
|
|
|
|
- When I(sku=premium), allowed values are C(P1), C(P2), C(P3), C(P4).
|
|
|
|
|
- Please see U(https://docs.microsoft.com/en-us/rest/api/redis/redis/create#sku) for allowed values.
|
|
|
|
|
choices:
|
|
|
|
|
- C0
|
|
|
|
@ -64,7 +66,7 @@ options:
|
|
|
|
|
required: True
|
|
|
|
|
enable_non_ssl_port:
|
|
|
|
|
description:
|
|
|
|
|
- When true, the non-ssl redis server port 6379 will be enabled.
|
|
|
|
|
- When set I(enable_non_ssl_port=true), the non-ssl Redis server port 6379 will be enabled.
|
|
|
|
|
type: bool
|
|
|
|
|
default: false
|
|
|
|
|
maxfragmentationmemory_reserved:
|
|
|
|
@ -92,7 +94,7 @@ options:
|
|
|
|
|
- Please see U(https://docs.microsoft.com/en-us/azure/redis-cache/cache-configure#advanced-settings) for more detail.
|
|
|
|
|
shard_count:
|
|
|
|
|
description:
|
|
|
|
|
- The number of shards to be created when I(sku) is C(premium).
|
|
|
|
|
- The number of shards to be created when I(sku=premium).
|
|
|
|
|
type: int
|
|
|
|
|
static_ip:
|
|
|
|
|
description:
|
|
|
|
@ -100,23 +102,27 @@ options:
|
|
|
|
|
subnet:
|
|
|
|
|
description:
|
|
|
|
|
- Subnet in a virtual network to deploy the Azure Cache for Redis in.
|
|
|
|
|
- "It can be resource id of subnet, eg.
|
|
|
|
|
/subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1"
|
|
|
|
|
- It can be a dictionary where contains C(name), C(virtual_network_name) and C(resource_group).
|
|
|
|
|
- C(name). Name of the subnet.
|
|
|
|
|
- C(resource_group). Resource group name of the subnet.
|
|
|
|
|
- C(virtual_network_name). Name of virtual network to which this subnet belongs.
|
|
|
|
|
- It can be resource id of subnet, for example
|
|
|
|
|
/subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1.
|
|
|
|
|
- It can be a dictionary where contains I(name), I(virtual_network_name) and I(resource_group).
|
|
|
|
|
- I(name). Name of the subnet.
|
|
|
|
|
- I(resource_group). Resource group name of the subnet.
|
|
|
|
|
- I(virtual_network_name). Name of virtual network to which this subnet belongs.
|
|
|
|
|
tenant_settings:
|
|
|
|
|
description:
|
|
|
|
|
- Dict of tenant settings.
|
|
|
|
|
type: dict
|
|
|
|
|
reboot:
|
|
|
|
|
description: Reboot specified Redis node(s). There can be potential data loss.
|
|
|
|
|
description:
|
|
|
|
|
- Reboot specified Redis node(s). There can be potential data loss.
|
|
|
|
|
suboptions:
|
|
|
|
|
shard_id:
|
|
|
|
|
description: If clustering is enabled, the id of the shard to be rebooted.
|
|
|
|
|
description:
|
|
|
|
|
- If clustering is enabled, the id of the shard to be rebooted.
|
|
|
|
|
type: int
|
|
|
|
|
reboot_type:
|
|
|
|
|
description: Which Redis node(s) to reboot.
|
|
|
|
|
description:
|
|
|
|
|
- Which Redis node(s) to reboot.
|
|
|
|
|
choices:
|
|
|
|
|
- primary
|
|
|
|
|
- secondary
|
|
|
|
@ -127,7 +133,8 @@ options:
|
|
|
|
|
- Regenerate Redis cache's access keys.
|
|
|
|
|
suboptions:
|
|
|
|
|
key_type:
|
|
|
|
|
description: The Redis key to regenerate.
|
|
|
|
|
description:
|
|
|
|
|
- The Redis key to regenerate.
|
|
|
|
|
choices:
|
|
|
|
|
- primary
|
|
|
|
|
- secondary
|
|
|
|
@ -135,7 +142,7 @@ options:
|
|
|
|
|
description:
|
|
|
|
|
- Wait till the Azure Cache for Redis instance provisioning_state is Succeeded.
|
|
|
|
|
- It takes several minutes for Azure Cache for Redis to be provisioned ready for use after creating/updating/rebooting.
|
|
|
|
|
- Set this option to true to wait for provisioning_state. Set to false if you don't care about provisioning_state.
|
|
|
|
|
- Set this option to C(true) to wait for provisioning_state. Set to C(false) if you don't care about provisioning_state.
|
|
|
|
|
- Poll wait timeout is 60 minutes.
|
|
|
|
|
type: bool
|
|
|
|
|
default: True
|
|
|
|
@ -153,7 +160,7 @@ extends_documentation_fragment:
|
|
|
|
|
- azure_tags
|
|
|
|
|
|
|
|
|
|
author:
|
|
|
|
|
- "Yunge Zhu(@yungezz)"
|
|
|
|
|
- Yunge Zhu(@yungezz)
|
|
|
|
|
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
@ -197,19 +204,17 @@ EXAMPLES = '''
|
|
|
|
|
|
|
|
|
|
RETURN = '''
|
|
|
|
|
id:
|
|
|
|
|
description: Id of the Azure Cache for Redis.
|
|
|
|
|
description:
|
|
|
|
|
- Id of the Azure Cache for Redis.
|
|
|
|
|
returned: always
|
|
|
|
|
type: str
|
|
|
|
|
sample: {
|
|
|
|
|
"id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Cache/Redis/myRedis"
|
|
|
|
|
}
|
|
|
|
|
sample: "/subscriptions/xxxxxxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Cache/Redis/myRedis"
|
|
|
|
|
host_name:
|
|
|
|
|
description: Host name of the Azure Cache for Redis.
|
|
|
|
|
returned: state is present
|
|
|
|
|
description:
|
|
|
|
|
- Host name of the Azure Cache for Redis.
|
|
|
|
|
returned: when I(state=present)
|
|
|
|
|
type: str
|
|
|
|
|
sample: {
|
|
|
|
|
"host_name": "myredis.redis.cache.windows.net"
|
|
|
|
|
}
|
|
|
|
|
sample: "myredis.redis.cache.windows.net"
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
import time
|
|
|
|
|