Resolving differences in core modules post-merge

This commit is contained in:
James Cammarata
2016-12-07 21:33:38 -05:00
committed by Matt Clay
parent 95d59b61eb
commit 8afa090417
115 changed files with 2651 additions and 17913 deletions

View File

@@ -116,7 +116,10 @@ options:
required: false
default: publicURL
version_added: "1.7"
requirements: ["glanceclient", "keystoneclient"]
requirements:
- "python >= 2.6"
- "python-glanceclient"
- "python-keystoneclient"
'''
@@ -136,9 +139,14 @@ EXAMPLES = '''
import time
try:
import glanceclient
from keystoneclient.v2_0 import client as ksclient
HAS_GLANCECLIENT = True
except ImportError:
print("failed=True msg='glanceclient and keystone client are required'")
HAS_GLANCECLIENT = False
try:
from keystoneclient.v2_0 import client as ksclient
HAS_KEYSTONECLIENT = True
except ImportError:
HAS_KEYSTONECLIENT= False
def _get_ksclient(module, kwargs):
@@ -269,4 +277,5 @@ def main():
# this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
main()
if __name__ == '__main__':
main()

View File

@@ -19,15 +19,16 @@
import operator
import os
import time
try:
from novaclient.v1_1 import client as nova_client
from novaclient.v1_1 import floating_ips
from novaclient import exceptions
from novaclient import utils
import time
HAS_NOVACLIENT = True
except ImportError:
print("failed=True msg='novaclient is required for this module'")
HAS_NOVACLIENT = False
ANSIBLE_METADATA = {'status': ['deprecated'],
'supported_by': 'community',
@@ -37,7 +38,7 @@ DOCUMENTATION = '''
---
module: nova_compute
version_added: "1.2"
deprecated: Deprecated in 1.10. Use os_server instead
deprecated: Deprecated in 2.0. Use os_server instead
short_description: Create/Delete VMs from OpenStack
description:
- Create or Remove virtual machines from Openstack.
@@ -179,7 +180,9 @@ options:
required: false
default: None
version_added: "1.9"
requirements: ["novaclient"]
requirements:
- "python >= 2.6"
- "python-novaclient"
'''
EXAMPLES = '''
@@ -567,6 +570,9 @@ def main():
],
)
if not HAS_NOVACLIENT:
module.fail_json(msg='python-novaclient is required for this module')
nova = nova_client.Client(module.params['login_username'],
module.params['login_password'],
module.params['login_tenant_name'],
@@ -593,4 +599,5 @@ def main():
# this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
main()
if __name__ == '__main__':
main()

View File

@@ -17,12 +17,13 @@
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
import time
try:
from novaclient.v1_1 import client as nova_client
from novaclient import exceptions as exc
import time
HAS_NOVACLIENT = True
except ImportError:
print("failed=True msg='novaclient is required for this module to work'")
HAS_NOVACLIENT = False
ANSIBLE_METADATA = {'status': ['deprecated'],
'supported_by': 'community',
@@ -81,7 +82,9 @@ options:
required: false
default: None
requirements: ["novaclient"]
requirements:
- "python >= 2.6"
- "python-novaclient"
'''
EXAMPLES = '''
- name: Create a key pair with the running users public key
@@ -110,6 +113,8 @@ def main():
state = dict(default='present', choices=['absent', 'present'])
))
module = AnsibleModule(argument_spec=argument_spec)
if not HAS_NOVACLIENT:
module.fail_json(msg='python-novaclient is required for this module to work')
nova = nova_client.Client(module.params['login_username'],
module.params['login_password'],
@@ -151,5 +156,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

@@ -16,6 +16,8 @@
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
import time
try:
from novaclient.v1_1 import client as nova_client
try:
@@ -23,9 +25,9 @@ try:
except ImportError:
from quantumclient.quantum import client
from keystoneclient.v2_0 import client as ksclient
import time
HAVE_DEPS = True
except ImportError:
print("failed=True msg='novaclient,keystoneclient and quantumclient (or neutronclient) are required'")
HAVE_DEPS = False
ANSIBLE_METADATA = {'status': ['deprecated'],
'supported_by': 'community',
@@ -89,7 +91,11 @@ options:
required: false
default: None
version_added: "1.5"
requirements: ["novaclient", "quantumclient", "neutronclient", "keystoneclient"]
requirements:
- "python >= 2.6"
- "python-novaclient"
- "python-neutronclient or python-quantumclient"
- "python-keystoneclient"
'''
EXAMPLES = '''
@@ -252,6 +258,9 @@ def main():
))
module = AnsibleModule(argument_spec=argument_spec)
if not HAVE_DEPS:
module.fail_json(msg='python-novaclient, python-keystoneclient, and either python-neutronclient or python-quantumclient are required')
try:
nova = nova_client.Client(module.params['login_username'], module.params['login_password'],
module.params['login_tenant_name'], module.params['auth_url'], region_name=module.params['region_name'], service_type='compute')
@@ -285,5 +294,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

@@ -16,6 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
import time
try:
from novaclient.v1_1 import client as nova_client
try:
@@ -23,9 +24,9 @@ try:
except ImportError:
from quantumclient.quantum import client
from keystoneclient.v2_0 import client as ksclient
import time
HAVE_DEPS = True
except ImportError:
print "failed=True msg='novaclient, keystone, and quantumclient (or neutronclient) client are required'"
HAVE_DEPS = False
ANSIBLE_METADATA = {'status': ['deprecated'],
'supported_by': 'community',
@@ -81,7 +82,11 @@ options:
- floating ip that should be assigned to the instance
required: true
default: None
requirements: ["quantumclient", "neutronclient", "keystoneclient"]
requirements:
- "python >= 2.6"
- "python-novaclient"
- "python-neutronclient or python-quantumclient"
- "python-keystoneclient"
'''
EXAMPLES = '''
@@ -192,6 +197,9 @@ def main():
))
module = AnsibleModule(argument_spec=argument_spec)
if not HAVE_DEPS:
module.fail_json(msg='python-novaclient, python-keystoneclient, and either python-neutronclient or python-quantumclient are required')
try:
nova = nova_client.Client(module.params['login_username'], module.params['login_password'],
module.params['login_tenant_name'], module.params['auth_url'], service_type='compute')
@@ -220,5 +228,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

@@ -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 keystone client are required'")
HAVE_DEPS = False
ANSIBLE_METADATA = {'status': ['deprecated'],
'supported_by': 'community',
@@ -108,7 +109,10 @@ options:
- Whether the state should be marked as up or down
required: false
default: true
requirements: ["quantumclient", "neutronclient", "keystoneclient"]
requirements:
- "python >= 2.6"
- "python-neutronclient or python-quantumclient"
- "python-keystoneclient"
'''
@@ -259,6 +263,9 @@ def main():
))
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')
if module.params['provider_network_type'] in ['vlan' , 'flat']:
if not module.params['provider_physical_network']:
module.fail_json(msg = " for vlan and flat networks, variable provider_physical_network should be set.")
@@ -290,5 +297,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

@@ -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 keystone client are required'")
HAVE_DEPS = False
ANSIBLE_METADATA = {'status': ['deprecated'],
'supported_by': 'community',
@@ -84,7 +85,10 @@ options:
- desired admin state of the created router .
required: false
default: true
requirements: ["quantumclient", "neutronclient", "keystoneclient"]
requirements:
- "python >= 2.6"
- "python-neutronclient or python-quantumclient"
- "python-keystoneclient"
'''
EXAMPLES = '''
@@ -189,6 +193,8 @@ def main():
admin_state_up = dict(type='bool', default=True),
))
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)
@@ -212,5 +218,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

@@ -22,6 +22,7 @@ try:
except ImportError:
from quantumclient.quantum import client
from keystoneclient.v2_0 import client as ksclient
HAVE_DEPS = True
except ImportError:
HAVE_DEPS = False
@@ -79,7 +80,10 @@ options:
- Name of the external network which should be attached to the router.
required: true
default: None
requirements: ["quantumclient", "neutronclient", "keystoneclient"]
requirements:
- "python >= 2.6"
- "python-neutronclient or python-quantumclient"
- "python-keystoneclient"
'''
EXAMPLES = '''
@@ -192,6 +196,8 @@ def main():
state = dict(default='present', choices=['absent', 'present']),
))
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)
router_id = _get_router_id(module, neutron)
@@ -220,5 +226,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

@@ -22,6 +22,7 @@ try:
except ImportError:
from quantumclient.quantum import client
from keystoneclient.v2_0 import client as ksclient
HAVE_DEPS = True
except ImportError:
HAVE_DEPS = False
@@ -84,7 +85,10 @@ options:
- Name of the tenant whose subnet has to be attached.
required: false
default: None
requirements: ["quantumclient", "keystoneclient"]
requirements:
- "python >= 2.6"
- "python-neutronclient or python-quantumclient"
- "python-keystoneclient"
'''
EXAMPLES = '''
@@ -224,6 +228,8 @@ def main():
state = dict(default='present', choices=['absent', 'present']),
))
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)
@@ -253,5 +259,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

@@ -34,6 +34,9 @@ version_added: "2.0"
author: "Monty Taylor (@emonty)"
description:
- Retrieve an auth token from an OpenStack Cloud
requirements:
- "python >= 2.6"
- "shade"
extends_documentation_fragment: openstack
'''
@@ -69,4 +72,5 @@ def main():
# this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
main()
if __name__ == '__main__':
main()

View File

@@ -97,6 +97,7 @@ options:
IP completely, or only detach it from the server. Default is to detach only.
required: false
default: false
version_added: "2.1"
requirements: ["shade"]
'''

View File

@@ -32,6 +32,7 @@ DOCUMENTATION = '''
module: os_ironic
short_description: Create/Delete Bare Metal Resources from OpenStack
extends_documentation_fragment: openstack
author: "Monty Taylor (@emonty)"
version_added: "2.0"
description:
- Create or Remove Ironic nodes from OpenStack.
@@ -75,28 +76,30 @@ options:
- Information for this server's driver. Will vary based on which
driver is in use. Any sub-field which is populated will be validated
during creation.
suboptions:
power:
- Information necessary to turn this server on / off. This often
includes such things as IPMI username, password, and IP address.
description:
- Information necessary to turn this server on / off.
This often includes such things as IPMI username, password, and IP address.
required: true
deploy:
- Information necessary to deploy this server directly, without
using Nova. THIS IS NOT RECOMMENDED.
description:
- Information necessary to deploy this server directly, without using Nova. THIS IS NOT RECOMMENDED.
console:
- Information necessary to connect to this server's serial console.
Not all drivers support this.
description:
- Information necessary to connect to this server's serial console. Not all drivers support this.
management:
- Information necessary to interact with this server's management
interface. May be shared by power_info in some cases.
description:
- Information necessary to interact with this server's management interface. May be shared by power_info in some cases.
required: true
nics:
description:
- A list of network interface cards, eg, " - mac: aa:bb:cc:aa:bb:cc"
- 'A list of network interface cards, eg, " - mac: aa:bb:cc:aa:bb:cc"'
required: true
properties:
description:
- Definition of the physical characteristics of this server, used for
scheduling purposes
- Definition of the physical characteristics of this server, used for scheduling purposes
suboptions:
cpu_arch:
description:
- CPU architecture (x86_64, i686, ...)
@@ -111,8 +114,7 @@ options:
default: 1
disk_size:
description:
- size of first storage device in this machine (typically
/dev/sda), in GB
- size of first storage device in this machine (typically /dev/sda), in GB
default: 1
skip_update_of_driver_password:
description:

View File

@@ -32,7 +32,9 @@ DOCUMENTATION = '''
---
module: os_ironic_node
short_description: Activate/Deactivate Bare Metal Resources from OpenStack
author: "Monty Taylor (@emonty)"
extends_documentation_fragment: openstack
version_added: "2.0"
description:
- Deploy to nodes controlled by Ironic.
options:
@@ -71,6 +73,7 @@ options:
- Definition of the instance information which is used to deploy
the node. This information is only required when an instance is
set to present.
suboptions:
image_source:
description:
- An HTTP(S) URL where the image can be retrieved from.

View File

@@ -31,7 +31,8 @@ DOCUMENTATION = '''
---
module: os_object
short_description: Create or Delete objects and containers from OpenStack
version_added: "1.10"
version_added: "2.0"
author: "Monty Taylor (@emonty)"
extends_documentation_fragment: openstack
description:
- Create or Delete objects and containers from OpenStack
@@ -60,7 +61,6 @@ options:
- Should the resource be present or absent.
choices: [present, absent]
default: present
requirements: ["shade"]
'''
EXAMPLES = '''

View File

@@ -32,6 +32,7 @@ DOCUMENTATION = '''
module: os_security_group
short_description: Add/Delete security groups from an OpenStack cloud.
extends_documentation_fragment: openstack
author: "Monty Taylor (@emonty)"
version_added: "2.0"
description:
- Add or Remove security groups from an OpenStack cloud.

View File

@@ -32,7 +32,7 @@ DOCUMENTATION = '''
module: os_security_group_rule
short_description: Add/Delete rule from an existing security group
extends_documentation_fragment: openstack
version_added: "1.10"
version_added: "2.0"
description:
- Add or Remove rule from an existing security group
options:
@@ -81,7 +81,6 @@ options:
- Should the resource be present or absent.
choices: [present, absent]
default: present
requirements: ["shade"]
'''
@@ -257,7 +256,6 @@ def _system_state_change(module, secgroup, remotegroup):
def main():
argument_spec = openstack_full_argument_spec(
security_group = dict(required=True),
# NOTE(Shrews): None is an acceptable protocol value for

View File

@@ -45,12 +45,10 @@ options:
description:
- Name that has to be given to the instance
required: true
default: None
image:
description:
- The name or id of the base image to boot.
required: true
default: None
image_exclude:
description:
- Text to use to filter image names, for the case, such as HP, where
@@ -110,7 +108,7 @@ options:
default: 'yes'
aliases: ['auto_floating_ip', 'public_ip']
floating_ips:
decription:
description:
- list of valid floating IPs that pre-exist to assign to this node
required: false
default: None
@@ -648,4 +646,5 @@ def main():
# this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
main()
if __name__ == '__main__':
main()

View File

@@ -44,11 +44,11 @@ options:
- Should the resource be present or absent.
choices: [present, absent]
default: present
required: false
server:
description:
- Name or ID of server you want to attach a volume to
required: true
default: None
volume:
description:
- Name or id of volume you want to attach to a server
@@ -58,7 +58,9 @@ options:
- Device you want to attach. Defaults to auto finding a device name.
required: false
default: None
requirements: ["shade"]
requirements:
- "python >= 2.6"
- "shade"
'''
EXAMPLES = '''
@@ -153,4 +155,5 @@ def main():
# this is magic, see lib/ansible/module_utils/common.py
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
main()
if __name__ == '__main__':
main()

View File

@@ -47,7 +47,6 @@ options:
description:
- Name of volume
required: true
default: None
display_description:
description:
- String describing the volume
@@ -59,7 +58,7 @@ options:
required: false
default: None
image:
descritpion:
description:
- Image name or id for boot from volume
required: false
default: None
@@ -73,7 +72,9 @@ options:
- Should the resource be present or absent.
choices: [present, absent]
default: present
requirements: ["shade"]
requirements:
- "python >= 2.6"
- "shade"
'''
EXAMPLES = '''
@@ -162,4 +163,5 @@ def main():
# this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
main()
if __name__ == '__main__':
main()