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
reviewable/pr18780/r1
Brian Coca 9 years ago
parent 0f26d71715
commit 9eb2b557cd

@ -136,20 +136,9 @@ options:
type: list
required: false
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:
- azure
- azure_tags
author:
- "Chris Houseknecht (@chouseknecht)"
@ -238,10 +227,8 @@ from ansible.module_utils.azure_rm_common import *
try:
from msrestazure.azure_exceptions import CloudError
from azure.common import AzureMissingResourceHttpError
from azure.mgmt.network.models import NetworkInterface, NetworkInterfaceIPConfiguration, Subnet, \
PublicIPAddress, NetworkSecurityGroup
from azure.mgmt.network.models.network_management_client_enums import IPAllocationMethod
except ImportError:
# This is handled in azure_rm_common
pass

@ -71,21 +71,10 @@ options:
- Valid azure location. Defaults to location of the resource group.
default: resource_group location
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:
- azure
- azure_tags
author:
- "Chris Houseknecht (@chouseknecht)"
@ -108,11 +97,6 @@ EXAMPLES = '''
'''
RETURN = '''
changed:
description: Whether or not the object was changed.
returned: always
type: bool
sample: True
state:
description: Facts about the current state of the object.
returned: always
@ -136,9 +120,7 @@ from ansible.module_utils.azure_rm_common import *
try:
from msrestazure.azure_exceptions import CloudError
from azure.common import AzureMissingResourceHttpError
from azure.mgmt.network.models import PublicIPAddress, PublicIPAddressDnsSettings
from azure.mgmt.network.models.network_management_client_enums import IPAllocationMethod
except ImportError:
# This is handled in azure_rm_common
pass
@ -248,7 +230,7 @@ class AzureRMPublicIPAddress(AzureRMModuleBase):
if self.check_mode:
return results
if changed:
if self.state == 'present':
if not pip:

@ -53,21 +53,9 @@ options:
- absent
- present
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:
- azure
- azure_tags
author:
- "Chris Houseknecht (@chouseknecht)"
@ -116,7 +104,6 @@ from ansible.module_utils.azure_rm_common import *
try:
from msrestazure.azure_exceptions import CloudError
from azure.common import AzureMissingResourceHttpError
from azure.mgmt.resource.resources.models import ResourceGroup
except ImportError:
pass

@ -118,21 +118,10 @@ options:
choices:
- absent
- 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:
- azure
- azure_tags
author:
- "Chris Houseknecht (@chouseknecht)"
@ -340,8 +329,8 @@ from ansible.module_utils.azure_rm_common import *
try:
from msrestazure.azure_exceptions import CloudError
from azure.common import AzureMissingResourceHttpError, AzureHttpError
from azure.mgmt.network.models import NetworkSecurityGroup, SecurityRule, Subnet, NetworkInterface
from azure.common import AzureHttpError
from azure.mgmt.network.models import NetworkSecurityGroup, SecurityRule
from azure.mgmt.network.models.network_management_client_enums import (SecurityRuleAccess,
SecurityRuleDirection,
SecurityRuleProtocol)

@ -74,21 +74,10 @@ options:
- Can be added to an existing storage account. Will be ignored during storage account creation.
required: false
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:
- azure
- azure_tags
author:
- "Chris Houseknecht (@chouseknecht)"
@ -155,10 +144,9 @@ try:
from azure.storage.cloudstorageaccount import CloudStorageAccount
from azure.common import AzureMissingResourceHttpError, AzureHttpError
from azure.mgmt.storage.models import AccountType,\
AccountStatus, \
ProvisioningState, \
StorageAccountUpdateParameters,\
CustomDomain, StorageAccountCreateParameters, KeyName
CustomDomain, StorageAccountCreateParameters
except ImportError:
# This is handled in azure_rm_common
pass
@ -449,7 +437,7 @@ class AzureRMStorageAccount(AzureRMModuleBase):
return False
def main():
AzureRMStorageAccount()
if __name__ == '__main__':

@ -126,21 +126,10 @@ options:
choices:
- container
- 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:
- azure
- azure_tags
author:
- "Chris Houseknecht (@chouseknecht)"
@ -176,13 +165,6 @@ EXAMPLES = '''
'''
RETURN = '''
actions:
description: List of descriptive actions taken by the module.
returned: always
type: list
sample: [
"updated blob foo:graylog.png content settings."
]
blob:
description: Facts about the current state of the blob.
returned: when a blob is operated on
@ -214,8 +196,6 @@ container:
'''
import datetime
import hashlib
import os
from ansible.module_utils.basic import *
@ -224,7 +204,6 @@ from ansible.module_utils.azure_rm_common import *
try:
from azure.storage.blob.models import ContentSettings
from azure.storage.cloudstorageaccount import CloudStorageAccount
from azure.common import AzureMissingResourceHttpError, AzureHttpError
except ImportError:
# This is handled in azure_rm_common
@ -347,6 +326,8 @@ class AzureRMStorageBlob(AzureRMModuleBase):
# Delete blob
self.delete_blob()
# until we sort out how we want to do this globally
del self.results['actions']
return self.results
def get_container(self):

@ -115,7 +115,6 @@ from ansible.module_utils.azure_rm_common import *
try:
from msrestazure.azure_exceptions import CloudError
from azure.common import AzureMissingResourceHttpError
from azure.mgmt.network.models import Subnet, NetworkSecurityGroup
except ImportError:
# 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.
default: true
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:
- azure
- azure_tags
author:
- "Chris Houseknecht (@chouseknecht)"
@ -454,20 +443,17 @@ from ansible.module_utils.azure_rm_common import *
try:
from msrestazure.azure_exceptions import CloudError
from azure.common import AzureMissingResourceHttpError
from azure.mgmt.compute.models import NetworkInterfaceReference, VirtualMachine, HardwareProfile, \
StorageProfile, OSProfile, OSDisk, VirtualHardDisk, ImageReference, NetworkProfile, LinuxConfiguration, \
SshConfiguration, SshPublicKey
from azure.mgmt.network.models import PublicIPAddress, NetworkSecurityGroup, SecurityRule, NetworkInterface, \
from azure.mgmt.network.models import PublicIPAddress, NetworkSecurityGroup, NetworkInterface, \
NetworkInterfaceIPConfiguration, Subnet
from azure.mgmt.storage.models import AccountType, AccountStatus, StorageAccountCreateParameters
from azure.mgmt.compute.models.compute_management_client_enums import CachingTypes, DiskCreateOptionTypes, \
VirtualMachineSizeTypes
from azure.mgmt.storage.models import StorageAccountCreateParameters
from azure.mgmt.compute.models.compute_management_client_enums import DiskCreateOptionTypes, VirtualMachineSizeTypes
except ImportError:
# This is handled in azure_rm_common
pass
AZURE_OBJECT_CLASS = 'VirtualMachine'
@ -887,6 +873,9 @@ class AzureRMVirtualMachine(AzureRMModuleBase):
self.results['state']['status'] = 'Deleted'
self.delete_vm(vm)
# until we sort out how we want to do this globally
del self.results['actions']
return self.results
def get_vm(self):

@ -77,21 +77,10 @@ options:
- absent
- present
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:
- azure
- azure_tags
author:
- "Chris Houseknecht (@chouseknecht)"
@ -150,7 +139,6 @@ from ansible.module_utils.azure_rm_common import *
try:
from msrestazure.azure_exceptions import CloudError
from azure.common import AzureMissingResourceHttpError
from azure.mgmt.network.models import VirtualNetwork, AddressSpace, DhcpOptions
except ImportError:
# This is handled in azure_rm_common

Loading…
Cancel
Save