Fix differences with devel.

This commit is contained in:
Matt Clay 2016-12-08 09:38:05 -05:00
parent 1c9a58a885
commit c709b22e5c
32 changed files with 78 additions and 237 deletions

0
lib/ansible/modules/cloud/amazon/ec2.py Executable file → Normal file
View file

View file

@ -78,7 +78,7 @@ options:
- Number of instances you'd like to replace at a time. Used with replace_all_instances.
required: false
version_added: "1.8"
default: 1
default: 1
replace_instances:
description:
- List of instance_ids belonging to the named ASG that you would like to terminate and be replaced with instances matching the current launch configuration.

View file

@ -92,7 +92,7 @@ def list_ec2_snapshots_boto3(connection, module):
def get_eni_info(interface):
# Private addresses
private_addresses = []
for ip in interface.private_ip_addresses:
@ -125,23 +125,23 @@ def get_eni_info(interface):
'attach_time': interface.attachment.attach_time,
'delete_on_termination': interface.attachment.delete_on_termination,
}
return interface_info
def list_eni(connection, module):
filters = module.params.get("filters")
interface_dict_array = []
try:
all_eni = connection.get_all_network_interfaces(filters=filters)
except BotoServerError as e:
module.fail_json(msg=e.message)
for interface in all_eni:
interface_dict_array.append(get_eni_info(interface))
module.exit_json(interfaces=interface_dict_array)
@ -152,12 +152,12 @@ def main():
filters = dict(default=None, type='dict')
)
)
module = AnsibleModule(argument_spec=argument_spec)
if not HAS_BOTO:
module.fail_json(msg='boto required for this module')
if HAS_BOTO3:
region, ec2_url, aws_connect_params = get_aws_connection_info(module, boto3=True)

View file

@ -144,4 +144,4 @@ def main():
if __name__ == '__main__':
main()
main()

View file

@ -101,7 +101,7 @@ options:
- C(always) will update passwords if they differ. C(on_create) will only set the password for newly created users.
notes:
- 'Currently boto does not support the removal of Managed Policies, the module will error out if your user/group/role has managed policies when you try to do state=absent. They will need to be removed manually.'
author:
author:
- "Jonathan I. Davila (@defionscode)"
- "Paul Seiffert (@seiffert)"
extends_documentation_fragment: aws

2
lib/ansible/modules/cloud/amazon/rds.py Executable file → Normal file
View file

@ -224,7 +224,7 @@ options:
requirements:
- "python >= 2.6"
- "boto"
author:
author:
- "Bruce Pennypacker (@bpennypacker)"
- "Will Thames (@willthames)"
extends_documentation_fragment:

View file

@ -28,7 +28,7 @@ description:
options:
command:
description:
- Specifies the action to take.
- Specifies the action to take.
required: true
choices: [ 'get', 'create', 'delete' ]
zone:

View file

@ -181,4 +181,4 @@ def main():
if __name__ == '__main__':
main()
main()

View file

@ -24,7 +24,7 @@ DOCUMENTATION = '''
module: digital_ocean
short_description: Create/delete a droplet/SSH_key in DigitalOcean
description:
- Create/delete a droplet in DigitalOcean and optionally wait for it to be 'running', or deploy an SSH key.
- Create/delete a droplet in DigitalOcean and optionally wait for it to be 'running', or deploy an SSH key.
version_added: "1.3"
author: "Vincent Viallet (@zbal)"
options:

View file

@ -22,14 +22,14 @@ DOCUMENTATION = '''
---
module: gc_storage
version_added: "1.4"
short_description: This module manages objects/buckets in Google Cloud Storage.
short_description: This module manages objects/buckets in Google Cloud Storage.
description:
- This module allows users to manage their objects/buckets in Google Cloud Storage. It allows upload and download operations and can set some canned permissions. It also allows retrieval of URLs for objects for use in playbooks, and retrieval of string contents of objects. This module requires setting the default project in GCS prior to playbook usage. See U(https://developers.google.com/storage/docs/reference/v1/apiversion1) for information about setting the default project.
options:
bucket:
description:
- Bucket name.
- Bucket name.
required: true
object:
description:
@ -55,7 +55,7 @@ options:
description:
- This option let's the user set the canned permissions on the object/bucket that are created. The permissions that can be set are 'private', 'public-read', 'authenticated-read'.
required: false
default: private
default: private
headers:
version_added: "2.0"
description:
@ -69,7 +69,7 @@ options:
default: null
mode:
description:
- Switches the module behaviour between upload, download, get_url (return download url) , get_str (download object as string), create (bucket) and delete (bucket).
- Switches the module behaviour between upload, download, get_url (return download url) , get_str (download object as string), create (bucket) and delete (bucket).
required: true
default: null
choices: [ 'get', 'put', 'get_url', 'get_str', 'delete', 'create' ]

View file

@ -22,8 +22,9 @@ try:
except ImportError:
from quantumclient.quantum import client
from keystoneclient.v2_0 import client as ksclient
HAVE_DEPS = True
except ImportError:
print("failed=True msg='quantumclient (or neutronclient) and keystoneclient are required'")
HAVE_DEPS = False
ANSIBLE_METADATA = {'status': ['deprecated'],
'supported_by': 'community',
@ -119,7 +120,10 @@ options:
- From the subnet pool the last IP that should be assigned to the virtual machines
required: false
default: None
requirements: ["quantumclient", "neutronclient", "keystoneclient"]
requirements:
- "python >= 2.6"
- "python-neutronclient or python-quantumclient"
- "python-keystoneclient"
'''
EXAMPLES = '''
@ -278,6 +282,9 @@ def main():
allocation_pool_end = dict(default=None),
))
module = AnsibleModule(argument_spec=argument_spec)
if not HAVE_DEPS:
module.fail_json(msg='python-keystoneclient and either python-neutronclient or python-quantumclient are required')
neutron = _get_neutron_client(module, module.params)
_set_tenant_id(module)
if module.params['state'] == 'present':
@ -298,5 +305,6 @@ def main():
# this is magic, see lib/ansible/module.params['common.py
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
main()
if __name__ == '__main__':
main()

View file

@ -33,7 +33,7 @@ short_description: Retrieve an auth token
version_added: "2.0"
author: "Monty Taylor (@emonty)"
description:
- Retrieve an auth token from an OpenStack Cloud
- Retrieve an auth token from an OpenStack Cloud
requirements:
- "python >= 2.6"
- "shade"

View file

@ -519,24 +519,24 @@ class PyVmomiHelper(object):
def set_powerstate(self, vm, state, force):
"""
Set the power status for a VM determined by the current and
requested states. force is forceful
"""
"""
Set the power status for a VM determined by the current and
requested states. force is forceful
"""
facts = self.gather_facts(vm)
expected_state = state.replace('_', '').lower()
current_state = facts['hw_power_status'].lower()
result = {}
# Need Force
if not force and current_state not in ['poweredon', 'poweredoff']:
return "VM is in %s power state. Force is required!" % current_state
# Need Force
if not force and current_state not in ['poweredon', 'poweredoff']:
return "VM is in %s power state. Force is required!" % current_state
# State is already true
if current_state == expected_state:
# State is already true
if current_state == expected_state:
result['changed'] = False
result['failed'] = False
else:
else:
task = None
try:
if expected_state == 'poweredoff':
@ -602,20 +602,20 @@ class PyVmomiHelper(object):
else:
facts['ipv4'] = ipaddress
for idx,entry in enumerate(vm.config.hardware.device):
if not hasattr(entry, 'macAddress'):
continue
for idx,entry in enumerate(vm.config.hardware.device):
if not hasattr(entry, 'macAddress'):
continue
factname = 'hw_eth' + str(idx)
facts[factname] = {
'addresstype': entry.addressType,
'label': entry.deviceInfo.label,
'macaddress': entry.macAddress,
'ipaddresses': netDict.get(entry.macAddress, None),
'macaddress_dash': entry.macAddress.replace(':', '-'),
'summary': entry.deviceInfo.summary,
}
facts['hw_interfaces'].append('eth'+str(idx))
factname = 'hw_eth' + str(idx)
facts[factname] = {
'addresstype': entry.addressType,
'label': entry.deviceInfo.label,
'macaddress': entry.macAddress,
'ipaddresses': netDict.get(entry.macAddress, None),
'macaddress_dash': entry.macAddress.replace(':', '-'),
'summary': entry.deviceInfo.summary,
}
facts['hw_interfaces'].append('eth'+str(idx))
return facts