several fixes:
- removed actions feature as this should be global and not per module - removed default fields from return docs - moved tags docs to shared fragments - removed unused imports
This commit is contained in:
parent
0fcc2d8973
commit
cf1b391201
9 changed files with 21 additions and 131 deletions
|
@ -136,20 +136,9 @@ options:
|
||||||
type: list
|
type: list
|
||||||
required: false
|
required: false
|
||||||
default: null
|
default: null
|
||||||
tags:
|
|
||||||
description:
|
|
||||||
- "Dictionary of string:string pairs to assign as metadata to the object. Metadata tags on the object
|
|
||||||
will be updated with any provided values. To remove tags use the purge_tags option."
|
|
||||||
required: false
|
|
||||||
purge_tags:
|
|
||||||
description:
|
|
||||||
- Use to remove tags from an object. Any tags not found in the tags parameter will be removed from
|
|
||||||
the object's metadata.
|
|
||||||
default: false
|
|
||||||
required: false
|
|
||||||
|
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- azure
|
- azure
|
||||||
|
- azure_tags
|
||||||
|
|
||||||
author:
|
author:
|
||||||
- "Chris Houseknecht (@chouseknecht)"
|
- "Chris Houseknecht (@chouseknecht)"
|
||||||
|
@ -238,10 +227,8 @@ from ansible.module_utils.azure_rm_common import *
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from msrestazure.azure_exceptions import CloudError
|
from msrestazure.azure_exceptions import CloudError
|
||||||
from azure.common import AzureMissingResourceHttpError
|
|
||||||
from azure.mgmt.network.models import NetworkInterface, NetworkInterfaceIPConfiguration, Subnet, \
|
from azure.mgmt.network.models import NetworkInterface, NetworkInterfaceIPConfiguration, Subnet, \
|
||||||
PublicIPAddress, NetworkSecurityGroup
|
PublicIPAddress, NetworkSecurityGroup
|
||||||
from azure.mgmt.network.models.network_management_client_enums import IPAllocationMethod
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
# This is handled in azure_rm_common
|
# This is handled in azure_rm_common
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -71,21 +71,10 @@ options:
|
||||||
- Valid azure location. Defaults to location of the resource group.
|
- Valid azure location. Defaults to location of the resource group.
|
||||||
default: resource_group location
|
default: resource_group location
|
||||||
required: false
|
required: false
|
||||||
tags:
|
|
||||||
description:
|
|
||||||
- "Dictionary of string:string pairs to assign as metadata to the object. Metadata tags on the object
|
|
||||||
will be updated with any provided values. To remove tags use the purge_tags option."
|
|
||||||
required: false
|
|
||||||
default: null
|
|
||||||
purge_tags:
|
|
||||||
description:
|
|
||||||
- Use to remove tags from an object. Any tags not found in the tags parameter will be removed from
|
|
||||||
the object's metadata.
|
|
||||||
required: false
|
|
||||||
default: false
|
|
||||||
|
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- azure
|
- azure
|
||||||
|
- azure_tags
|
||||||
|
|
||||||
author:
|
author:
|
||||||
- "Chris Houseknecht (@chouseknecht)"
|
- "Chris Houseknecht (@chouseknecht)"
|
||||||
|
@ -108,11 +97,6 @@ EXAMPLES = '''
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
changed:
|
|
||||||
description: Whether or not the object was changed.
|
|
||||||
returned: always
|
|
||||||
type: bool
|
|
||||||
sample: True
|
|
||||||
state:
|
state:
|
||||||
description: Facts about the current state of the object.
|
description: Facts about the current state of the object.
|
||||||
returned: always
|
returned: always
|
||||||
|
@ -136,9 +120,7 @@ from ansible.module_utils.azure_rm_common import *
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from msrestazure.azure_exceptions import CloudError
|
from msrestazure.azure_exceptions import CloudError
|
||||||
from azure.common import AzureMissingResourceHttpError
|
|
||||||
from azure.mgmt.network.models import PublicIPAddress, PublicIPAddressDnsSettings
|
from azure.mgmt.network.models import PublicIPAddress, PublicIPAddressDnsSettings
|
||||||
from azure.mgmt.network.models.network_management_client_enums import IPAllocationMethod
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
# This is handled in azure_rm_common
|
# This is handled in azure_rm_common
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -53,21 +53,9 @@ options:
|
||||||
- absent
|
- absent
|
||||||
- present
|
- present
|
||||||
required: false
|
required: false
|
||||||
tags:
|
|
||||||
description:
|
|
||||||
- "Dictionary of string:string pairs to assign as metadata to the object. Metadata tags on the object
|
|
||||||
will be updated with any provided values. To remove tags use the purge_tags option."
|
|
||||||
required: false
|
|
||||||
default: null
|
|
||||||
purge_tags:
|
|
||||||
description:
|
|
||||||
- Use to remove tags from an object. Any tags not found in the tags parameter will be removed from
|
|
||||||
the object's metadata.
|
|
||||||
default: false
|
|
||||||
required: false
|
|
||||||
|
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- azure
|
- azure
|
||||||
|
- azure_tags
|
||||||
|
|
||||||
author:
|
author:
|
||||||
- "Chris Houseknecht (@chouseknecht)"
|
- "Chris Houseknecht (@chouseknecht)"
|
||||||
|
@ -116,7 +104,6 @@ from ansible.module_utils.azure_rm_common import *
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from msrestazure.azure_exceptions import CloudError
|
from msrestazure.azure_exceptions import CloudError
|
||||||
from azure.common import AzureMissingResourceHttpError
|
|
||||||
from azure.mgmt.resource.resources.models import ResourceGroup
|
from azure.mgmt.resource.resources.models import ResourceGroup
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -118,21 +118,10 @@ options:
|
||||||
choices:
|
choices:
|
||||||
- absent
|
- absent
|
||||||
- present
|
- present
|
||||||
tags:
|
|
||||||
description:
|
|
||||||
- "Dictionary of string:string pairs to assign as metadata to the object. Metadata tags on the object
|
|
||||||
will be updated with any provided values. To remove tags use the purge_tags option."
|
|
||||||
required: false
|
|
||||||
default: null
|
|
||||||
purge_tags:
|
|
||||||
description:
|
|
||||||
- Use to remove tags from an object. Any tags not found in the tags parameter will be removed from
|
|
||||||
the object's metadata.
|
|
||||||
default: false
|
|
||||||
required: false
|
|
||||||
|
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- azure
|
- azure
|
||||||
|
- azure_tags
|
||||||
|
|
||||||
author:
|
author:
|
||||||
- "Chris Houseknecht (@chouseknecht)"
|
- "Chris Houseknecht (@chouseknecht)"
|
||||||
|
@ -340,8 +329,8 @@ from ansible.module_utils.azure_rm_common import *
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from msrestazure.azure_exceptions import CloudError
|
from msrestazure.azure_exceptions import CloudError
|
||||||
from azure.common import AzureMissingResourceHttpError, AzureHttpError
|
from azure.common import AzureHttpError
|
||||||
from azure.mgmt.network.models import NetworkSecurityGroup, SecurityRule, Subnet, NetworkInterface
|
from azure.mgmt.network.models import NetworkSecurityGroup, SecurityRule
|
||||||
from azure.mgmt.network.models.network_management_client_enums import (SecurityRuleAccess,
|
from azure.mgmt.network.models.network_management_client_enums import (SecurityRuleAccess,
|
||||||
SecurityRuleDirection,
|
SecurityRuleDirection,
|
||||||
SecurityRuleProtocol)
|
SecurityRuleProtocol)
|
||||||
|
|
|
@ -74,21 +74,10 @@ options:
|
||||||
- Can be added to an existing storage account. Will be ignored during storage account creation.
|
- Can be added to an existing storage account. Will be ignored during storage account creation.
|
||||||
required: false
|
required: false
|
||||||
default: null
|
default: null
|
||||||
tags:
|
|
||||||
description:
|
|
||||||
- "Dictionary of string:string pairs to assign as metadata to the object. Metadata tags on the object
|
|
||||||
will be updated with any provided values. To remove tags use the purge_tags option."
|
|
||||||
required: false
|
|
||||||
default: null
|
|
||||||
purge_tags:
|
|
||||||
description:
|
|
||||||
- Use to remove tags from an object. Any tags not found in the tags parameter will be removed from
|
|
||||||
the object's metadata.
|
|
||||||
default: false
|
|
||||||
required: false
|
|
||||||
|
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- azure
|
- azure
|
||||||
|
- azure_tags
|
||||||
|
|
||||||
author:
|
author:
|
||||||
- "Chris Houseknecht (@chouseknecht)"
|
- "Chris Houseknecht (@chouseknecht)"
|
||||||
|
@ -155,10 +144,9 @@ try:
|
||||||
from azure.storage.cloudstorageaccount import CloudStorageAccount
|
from azure.storage.cloudstorageaccount import CloudStorageAccount
|
||||||
from azure.common import AzureMissingResourceHttpError, AzureHttpError
|
from azure.common import AzureMissingResourceHttpError, AzureHttpError
|
||||||
from azure.mgmt.storage.models import AccountType,\
|
from azure.mgmt.storage.models import AccountType,\
|
||||||
AccountStatus, \
|
|
||||||
ProvisioningState, \
|
ProvisioningState, \
|
||||||
StorageAccountUpdateParameters,\
|
StorageAccountUpdateParameters,\
|
||||||
CustomDomain, StorageAccountCreateParameters, KeyName
|
CustomDomain, StorageAccountCreateParameters
|
||||||
except ImportError:
|
except ImportError:
|
||||||
# This is handled in azure_rm_common
|
# This is handled in azure_rm_common
|
||||||
pass
|
pass
|
||||||
|
@ -449,7 +437,7 @@ class AzureRMStorageAccount(AzureRMModuleBase):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
AzureRMStorageAccount()
|
AzureRMStorageAccount()
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -126,21 +126,10 @@ options:
|
||||||
choices:
|
choices:
|
||||||
- container
|
- container
|
||||||
- blob
|
- blob
|
||||||
tags:
|
|
||||||
description:
|
|
||||||
- "Dictionary of string:string pairs to assign as metadata to the object. Metadata tags on the object
|
|
||||||
will be updated with any provided values. To remove tags use the purge_tags option."
|
|
||||||
required: false
|
|
||||||
default: null
|
|
||||||
purge_tags:
|
|
||||||
description:
|
|
||||||
- Use to remove tags from an object. Any tags not found in the tags parameter will be removed from
|
|
||||||
the object's metadata.
|
|
||||||
required: false
|
|
||||||
default: false
|
|
||||||
|
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- azure
|
- azure
|
||||||
|
- azure_tags
|
||||||
|
|
||||||
author:
|
author:
|
||||||
- "Chris Houseknecht (@chouseknecht)"
|
- "Chris Houseknecht (@chouseknecht)"
|
||||||
|
@ -176,13 +165,6 @@ EXAMPLES = '''
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
actions:
|
|
||||||
description: List of descriptive actions taken by the module.
|
|
||||||
returned: always
|
|
||||||
type: list
|
|
||||||
sample: [
|
|
||||||
"updated blob foo:graylog.png content settings."
|
|
||||||
]
|
|
||||||
blob:
|
blob:
|
||||||
description: Facts about the current state of the blob.
|
description: Facts about the current state of the blob.
|
||||||
returned: when a blob is operated on
|
returned: when a blob is operated on
|
||||||
|
@ -214,8 +196,6 @@ container:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
import datetime
|
|
||||||
import hashlib
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from ansible.module_utils.basic import *
|
from ansible.module_utils.basic import *
|
||||||
|
@ -224,7 +204,6 @@ from ansible.module_utils.azure_rm_common import *
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from azure.storage.blob.models import ContentSettings
|
from azure.storage.blob.models import ContentSettings
|
||||||
from azure.storage.cloudstorageaccount import CloudStorageAccount
|
|
||||||
from azure.common import AzureMissingResourceHttpError, AzureHttpError
|
from azure.common import AzureMissingResourceHttpError, AzureHttpError
|
||||||
except ImportError:
|
except ImportError:
|
||||||
# This is handled in azure_rm_common
|
# This is handled in azure_rm_common
|
||||||
|
@ -347,6 +326,8 @@ class AzureRMStorageBlob(AzureRMModuleBase):
|
||||||
# Delete blob
|
# Delete blob
|
||||||
self.delete_blob()
|
self.delete_blob()
|
||||||
|
|
||||||
|
# until we sort out how we want to do this globally
|
||||||
|
del self.results['actions']
|
||||||
return self.results
|
return self.results
|
||||||
|
|
||||||
def get_container(self):
|
def get_container(self):
|
||||||
|
|
|
@ -115,7 +115,6 @@ from ansible.module_utils.azure_rm_common import *
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from msrestazure.azure_exceptions import CloudError
|
from msrestazure.azure_exceptions import CloudError
|
||||||
from azure.common import AzureMissingResourceHttpError
|
|
||||||
from azure.mgmt.network.models import Subnet, NetworkSecurityGroup
|
from azure.mgmt.network.models import Subnet, NetworkSecurityGroup
|
||||||
except ImportError:
|
except ImportError:
|
||||||
# This is handled in azure_rm_common
|
# This is handled in azure_rm_common
|
||||||
|
|
|
@ -227,21 +227,10 @@ options:
|
||||||
- When removing a VM using state 'absent', also remove any public IP addresses associate with the VM.
|
- When removing a VM using state 'absent', also remove any public IP addresses associate with the VM.
|
||||||
default: true
|
default: true
|
||||||
required: false
|
required: false
|
||||||
tags:
|
|
||||||
description:
|
|
||||||
- "Dictionary of string:string pairs to assign as metadata to the object. Metadata tags on the object
|
|
||||||
will be updated with any provided values. To remove tags use the purge_tags option."
|
|
||||||
default: null
|
|
||||||
required: false
|
|
||||||
purge_tags:
|
|
||||||
description:
|
|
||||||
- Use to remove tags from an object. Any tags not found in the tags parameter will be removed from
|
|
||||||
the object's metadata.
|
|
||||||
default: false
|
|
||||||
required: false
|
|
||||||
|
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- azure
|
- azure
|
||||||
|
- azure_tags
|
||||||
|
|
||||||
author:
|
author:
|
||||||
- "Chris Houseknecht (@chouseknecht)"
|
- "Chris Houseknecht (@chouseknecht)"
|
||||||
|
@ -454,20 +443,17 @@ from ansible.module_utils.azure_rm_common import *
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from msrestazure.azure_exceptions import CloudError
|
from msrestazure.azure_exceptions import CloudError
|
||||||
from azure.common import AzureMissingResourceHttpError
|
|
||||||
from azure.mgmt.compute.models import NetworkInterfaceReference, VirtualMachine, HardwareProfile, \
|
from azure.mgmt.compute.models import NetworkInterfaceReference, VirtualMachine, HardwareProfile, \
|
||||||
StorageProfile, OSProfile, OSDisk, VirtualHardDisk, ImageReference, NetworkProfile, LinuxConfiguration, \
|
StorageProfile, OSProfile, OSDisk, VirtualHardDisk, ImageReference, NetworkProfile, LinuxConfiguration, \
|
||||||
SshConfiguration, SshPublicKey
|
SshConfiguration, SshPublicKey
|
||||||
from azure.mgmt.network.models import PublicIPAddress, NetworkSecurityGroup, SecurityRule, NetworkInterface, \
|
from azure.mgmt.network.models import PublicIPAddress, NetworkSecurityGroup, NetworkInterface, \
|
||||||
NetworkInterfaceIPConfiguration, Subnet
|
NetworkInterfaceIPConfiguration, Subnet
|
||||||
from azure.mgmt.storage.models import AccountType, AccountStatus, StorageAccountCreateParameters
|
from azure.mgmt.storage.models import StorageAccountCreateParameters
|
||||||
from azure.mgmt.compute.models.compute_management_client_enums import CachingTypes, DiskCreateOptionTypes, \
|
from azure.mgmt.compute.models.compute_management_client_enums import DiskCreateOptionTypes, VirtualMachineSizeTypes
|
||||||
VirtualMachineSizeTypes
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
# This is handled in azure_rm_common
|
# This is handled in azure_rm_common
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
AZURE_OBJECT_CLASS = 'VirtualMachine'
|
AZURE_OBJECT_CLASS = 'VirtualMachine'
|
||||||
|
|
||||||
|
|
||||||
|
@ -887,6 +873,9 @@ class AzureRMVirtualMachine(AzureRMModuleBase):
|
||||||
self.results['state']['status'] = 'Deleted'
|
self.results['state']['status'] = 'Deleted'
|
||||||
self.delete_vm(vm)
|
self.delete_vm(vm)
|
||||||
|
|
||||||
|
# until we sort out how we want to do this globally
|
||||||
|
del self.results['actions']
|
||||||
|
|
||||||
return self.results
|
return self.results
|
||||||
|
|
||||||
def get_vm(self):
|
def get_vm(self):
|
||||||
|
|
|
@ -77,21 +77,10 @@ options:
|
||||||
- absent
|
- absent
|
||||||
- present
|
- present
|
||||||
required: false
|
required: false
|
||||||
tags:
|
|
||||||
description:
|
|
||||||
- "Dictionary of string:string pairs to assign as metadata to the object. Metadata tags on the object
|
|
||||||
will be updated with any provided values. To remove tags use the purge_tags option."
|
|
||||||
default: null
|
|
||||||
required: false
|
|
||||||
purge_tags:
|
|
||||||
description:
|
|
||||||
- Use to remove tags from an object. Any tags not found in the tags parameter will be removed from
|
|
||||||
the object's metadata.
|
|
||||||
default: false
|
|
||||||
required: false
|
|
||||||
|
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- azure
|
- azure
|
||||||
|
- azure_tags
|
||||||
|
|
||||||
author:
|
author:
|
||||||
- "Chris Houseknecht (@chouseknecht)"
|
- "Chris Houseknecht (@chouseknecht)"
|
||||||
|
@ -150,7 +139,6 @@ from ansible.module_utils.azure_rm_common import *
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from msrestazure.azure_exceptions import CloudError
|
from msrestazure.azure_exceptions import CloudError
|
||||||
from azure.common import AzureMissingResourceHttpError
|
|
||||||
from azure.mgmt.network.models import VirtualNetwork, AddressSpace, DhcpOptions
|
from azure.mgmt.network.models import VirtualNetwork, AddressSpace, DhcpOptions
|
||||||
except ImportError:
|
except ImportError:
|
||||||
# This is handled in azure_rm_common
|
# This is handled in azure_rm_common
|
||||||
|
|
Loading…
Reference in a new issue