Add boilerplate and remove wildcard imports for openstack modules (#31461)

* Add boilerplate and remove wildcard imports for openstack modules
* Remove openstack files that are now pep8 compliant from the legacy list
This commit is contained in:
Toshio Kuratomi 2017-10-09 09:56:26 -07:00 committed by GitHub
parent e609618274
commit 5e9384300d
47 changed files with 421 additions and 759 deletions

View file

@ -1,19 +1,11 @@
#!/usr/bin/python #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -49,13 +41,18 @@ EXAMPLES = '''
var: service_catalog var: service_catalog
''' '''
import traceback
try: try:
import shade import shade
from shade import meta
HAS_SHADE = True HAS_SHADE = True
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
# this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
def main(): def main():
@ -76,8 +73,6 @@ def main():
except Exception as e: except Exception as e:
module.fail_json(msg=str(e), exception=traceback.format_exc()) module.fail_json(msg=str(e), exception=traceback.format_exc())
# this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -46,8 +46,6 @@ EXAMPLES = '''
- mordred - mordred
''' '''
from ansible.module_utils.basic import AnsibleModule
try: try:
import os_client_config import os_client_config
from os_client_config import exceptions from os_client_config import exceptions
@ -55,6 +53,8 @@ try:
except ImportError: except ImportError:
HAS_OS_CLIENT_CONFIG = False HAS_OS_CLIENT_CONFIG = False
from ansible.module_utils.basic import AnsibleModule
def main(): def main():
module = AnsibleModule(argument_spec=dict( module = AnsibleModule(argument_spec=dict(

View file

@ -1,19 +1,11 @@
#!/usr/bin/python #!/usr/bin/python
# Copyright (c) 2015 IBM # Copyright (c) 2015 IBM
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -179,7 +171,7 @@ openstack_flavors:
sample: true sample: true
''' '''
import re from distutils.version import StrictVersion
try: try:
import shade import shade
@ -187,7 +179,8 @@ try:
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from distutils.version import StrictVersion from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
def main(): def main():
@ -246,8 +239,5 @@ def main():
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -1,19 +1,11 @@
#!/usr/bin/python #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# Author: Davide Guerri <davide.guerri@hp.com> # Author: Davide Guerri <davide.guerri@hp.com>
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -136,15 +128,16 @@ EXAMPLES = '''
server: cattle001 server: cattle001
''' '''
from distutils.version import StrictVersion
try: try:
import shade import shade
from shade import meta
HAS_SHADE = True HAS_SHADE = True
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from distutils.version import StrictVersion from ansible.module_utils.basic import AnsibleModule, remove_values
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
def _get_floating_ip(cloud, floating_ip_address): def _get_floating_ip(cloud, floating_ip_address):
@ -267,10 +260,5 @@ def main():
module.fail_json(msg=str(e), extra_data=e.extra_data) module.fail_json(msg=str(e), extra_data=e.extra_data)
# this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -1,18 +1,10 @@
#!/usr/bin/python #!/usr/bin/python
# Copyright (c) 2016 IBM # Copyright (c) 2016 IBM
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -113,6 +105,9 @@ try:
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
def _system_state_change(state, description, group): def _system_state_change(state, description, group):
if state == 'present' and not group: if state == 'present' and not group:
@ -171,18 +166,15 @@ def main():
elif state == 'absent': elif state == 'absent':
if group is None: if group is None:
changed=False changed = False
else: else:
cloud.delete_group(group.id) cloud.delete_group(group.id)
changed=True changed = True
module.exit_json(changed=changed) module.exit_json(changed=changed)
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -2,21 +2,13 @@
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013, Benno Joy <benno@ansible.com> # Copyright (c) 2013, Benno Joy <benno@ansible.com>
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
#TODO(mordred): we need to support "location"(v1) and "locations"(v2) from __future__ import absolute_import, division, print_function
__metaclass__ = type
# TODO(mordred): we need to support "location"(v1) and "locations"(v2)
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -138,6 +130,9 @@ try:
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
def main(): def main():
@ -215,9 +210,6 @@ def main():
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=str(e), extra_data=e.extra_data) module.fail_json(msg=str(e), extra_data=e.extra_data)
# this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == "__main__": if __name__ == "__main__":
main() main()

View file

@ -1,19 +1,11 @@
#!/usr/bin/python #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -141,6 +133,9 @@ try:
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
def main(): def main():
@ -162,8 +157,6 @@ def main():
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -2,19 +2,11 @@
# coding: utf-8 -*- # coding: utf-8 -*-
# (c) 2014, Hewlett-Packard Development Company, L.P. # (c) 2014, Hewlett-Packard Development Company, L.P.
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -150,17 +142,20 @@ EXAMPLES = '''
''' '''
try:
import jsonpatch
HAS_JSONPATCH = True
except ImportError:
HAS_JSONPATCH = False
try: try:
import shade import shade
HAS_SHADE = True HAS_SHADE = True
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
try: from ansible.module_utils.basic import AnsibleModule
import jsonpatch from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
HAS_JSONPATCH = True
except ImportError:
HAS_JSONPATCH = False
def _parse_properties(module): def _parse_properties(module):
@ -197,8 +192,6 @@ def _choose_id_value(module):
return None return None
def _choose_if_password_only(module, patch): def _choose_if_password_only(module, patch):
if len(patch) is 1: if len(patch) is 1:
if 'password' in patch[0]['path'] and module.params['skip_update_of_masked_password']: if 'password' in patch[0]['path'] and module.params['skip_update_of_masked_password']:
@ -357,9 +350,5 @@ def main():
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == "__main__": if __name__ == "__main__":
main() main()

View file

@ -2,19 +2,11 @@
# coding: utf-8 -*- # coding: utf-8 -*-
# (c) 2015-2016, Hewlett Packard Enterprise Development Company LP # (c) 2015-2016, Hewlett Packard Enterprise Development Company LP
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -97,13 +89,16 @@ EXAMPLES = '''
name: "testnode1" name: "testnode1"
''' '''
from distutils.version import StrictVersion
try: try:
import shade import shade
HAS_SHADE = True HAS_SHADE = True
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from distutils.version import StrictVersion from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
def _choose_id_value(module): def _choose_id_value(module):
@ -170,9 +165,5 @@ def main():
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == "__main__": if __name__ == "__main__":
main() main()

View file

@ -2,19 +2,11 @@
# coding: utf-8 -*- # coding: utf-8 -*-
# (c) 2015, Hewlett-Packard Development Company, L.P. # (c) 2015, Hewlett-Packard Development Company, L.P.
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -130,13 +122,16 @@ os_ironic_node:
delegate_to: localhost delegate_to: localhost
''' '''
from distutils.version import StrictVersion
try: try:
import shade import shade
HAS_SHADE = True HAS_SHADE = True
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from distutils.version import StrictVersion from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
def _choose_id_value(module): def _choose_id_value(module):
@ -371,9 +366,5 @@ def main():
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == "__main__": if __name__ == "__main__":
main() main()

View file

@ -3,19 +3,11 @@
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013, Benno Joy <benno@ansible.com> # Copyright (c) 2013, Benno Joy <benno@ansible.com>
# Copyright (c) 2013, John Dewey <john@dewey.ws> # Copyright (c) 2013, John Dewey <john@dewey.ws>
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -102,6 +94,9 @@ try:
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
def _system_state_change(module, keypair): def _system_state_change(module, keypair):
state = module.params['state'] state = module.params['state']
@ -172,8 +167,6 @@ def main():
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -1,18 +1,10 @@
#!/usr/bin/python #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -112,6 +104,9 @@ try:
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
def _needs_update(module, domain): def _needs_update(module, domain):
if module.params['description'] is not None and \ if module.params['description'] is not None and \
@ -121,6 +116,7 @@ def _needs_update(module, domain):
return True return True
return False return False
def _system_state_change(module, domain): def _system_state_change(module, domain):
state = module.params['state'] state = module.params['state']
if state == 'absent' and domain: if state == 'absent' and domain:
@ -133,8 +129,8 @@ def _system_state_change(module, domain):
return False return False
def main():
def main():
argument_spec = openstack_full_argument_spec( argument_spec = openstack_full_argument_spec(
name=dict(required=True), name=dict(required=True),
description=dict(default=None), description=dict(default=None),
@ -187,18 +183,15 @@ def main():
elif state == 'absent': elif state == 'absent':
if domain is None: if domain is None:
changed=False changed = False
else: else:
cloud.delete_domain(domain.id) cloud.delete_domain(domain.id)
changed=True changed = True
module.exit_json(changed=changed) module.exit_json(changed=changed)
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -1,18 +1,10 @@
#!/usr/bin/python #!/usr/bin/python
# Copyright (c) 2016 Hewlett-Packard Enterprise Corporation # Copyright (c) 2016 Hewlett-Packard Enterprise Corporation
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],

View file

@ -3,6 +3,10 @@
# Copyright: (c) 2017, VEXXHOST, Inc. # Copyright: (c) 2017, VEXXHOST, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
'supported_by': 'community'} 'supported_by': 'community'}
@ -101,16 +105,16 @@ endpoint:
sample: True sample: True
''' '''
from distutils.version import StrictVersion
try: try:
import shade import shade
HAS_SHADE = True HAS_SHADE = True
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from distutils.version import StrictVersion
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
from ansible.module_utils.openstack import openstack_module_kwargs
def _needs_update(module, endpoint): def _needs_update(module, endpoint):

View file

@ -1,18 +1,10 @@
#!/usr/bin/python #!/usr/bin/python
# Copyright (c) 2016 IBM # Copyright (c) 2016 IBM
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -83,6 +75,9 @@ try:
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
def _system_state_change(state, role): def _system_state_change(state, role):
if state == 'present' and not role: if state == 'present' and not role:
@ -126,19 +121,15 @@ def main():
module.exit_json(changed=changed, role=role) module.exit_json(changed=changed, role=role)
elif state == 'absent': elif state == 'absent':
if role is None: if role is None:
changed=False changed = False
else: else:
cloud.delete_role(name) cloud.delete_role(name)
changed=True changed = True
module.exit_json(changed=changed) module.exit_json(changed=changed)
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -1,18 +1,10 @@
#!/usr/bin/python #!/usr/bin/python
# Copyright 2016 Sam Yaple # Copyright 2016 Sam Yaple
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -112,13 +104,16 @@ id:
sample: "3292f020780b4d5baf27ff7e1d224c44" sample: "3292f020780b4d5baf27ff7e1d224c44"
''' '''
from distutils.version import StrictVersion
try: try:
import shade import shade
HAS_SHADE = True HAS_SHADE = True
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from distutils.version import StrictVersion from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
def _needs_update(module, service): def _needs_update(module, service):
@ -177,7 +172,7 @@ def main():
if len(services) > 1: if len(services) > 1:
module.fail_json(msg='Service name %s and type %s are not unique' % module.fail_json(msg='Service name %s and type %s are not unique' %
(name, service_type)) (name, service_type))
elif len(services) == 1: elif len(services) == 1:
service = services[0] service = services[0]
else: else:
@ -188,8 +183,8 @@ def main():
if state == 'present': if state == 'present':
if service is None: if service is None:
service = cloud.create_service(name=name, service = cloud.create_service(name=name, description=description,
description=description, type=service_type, enabled=True) type=service_type, enabled=True)
changed = True changed = True
else: else:
if _needs_update(module, service): if _needs_update(module, service):
@ -203,17 +198,15 @@ def main():
elif state == 'absent': elif state == 'absent':
if service is None: if service is None:
changed=False changed = False
else: else:
cloud.delete_service(service.id) cloud.delete_service(service.id)
changed=True changed = True
module.exit_json(changed=changed) module.exit_json(changed=changed)
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -2,19 +2,11 @@
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013, Benno Joy <benno@ansible.com> # Copyright (c) 2013, Benno Joy <benno@ansible.com>
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -159,13 +151,16 @@ network:
sample: 101 sample: 101
''' '''
from distutils.version import StrictVersion
try: try:
import shade import shade
HAS_SHADE = True HAS_SHADE = True
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from distutils.version import StrictVersion from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
def main(): def main():
@ -250,8 +245,5 @@ def main():
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == "__main__": if __name__ == "__main__":
main() main()

View file

@ -1,19 +1,11 @@
#!/usr/bin/python #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -131,6 +123,9 @@ try:
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec
def main(): def main():
@ -153,8 +148,6 @@ def main():
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -1,19 +1,11 @@
#!/usr/bin/python #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -187,6 +179,9 @@ try:
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
def _system_state_change(module, flavor): def _system_state_change(module, flavor):
state = module.params['state'] state = module.params['state']
@ -282,8 +277,5 @@ def main():
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -1,18 +1,10 @@
#!/usr/bin/python #!/usr/bin/python
# Copyright 2016 Jakub Jursa <jakub.jursa1@gmail.com> # Copyright 2016 Jakub Jursa <jakub.jursa1@gmail.com>
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -77,13 +69,16 @@ RETURN = '''
''' '''
from distutils.version import StrictVersion
try: try:
import shade import shade
HAS_SHADE = True HAS_SHADE = True
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from distutils.version import StrictVersion from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
def _needs_update(module, aggregate): def _needs_update(module, aggregate):
@ -100,6 +95,7 @@ def _needs_update(module, aggregate):
return False return False
def _system_state_change(module, aggregate): def _system_state_change(module, aggregate):
state = module.params['state'] state = module.params['state']
if state == 'absent' and aggregate: if state == 'absent' and aggregate:
@ -112,6 +108,7 @@ def _system_state_change(module, aggregate):
return False return False
def main(): def main():
argument_spec = openstack_full_argument_spec( argument_spec = openstack_full_argument_spec(
name=dict(required=True), name=dict(required=True),
@ -158,7 +155,7 @@ def main():
if state == 'present': if state == 'present':
if aggregate is None: if aggregate is None:
aggregate = cloud.create_aggregate(name=name, aggregate = cloud.create_aggregate(name=name,
availability_zone=availability_zone) availability_zone=availability_zone)
if hosts: if hosts:
for h in hosts: for h in hosts:
cloud.add_host_to_aggregate(aggregate.id, h) cloud.add_host_to_aggregate(aggregate.id, h)
@ -168,8 +165,8 @@ def main():
else: else:
if _needs_update(module, aggregate): if _needs_update(module, aggregate):
if availability_zone is not None: if availability_zone is not None:
aggregate = cloud.update_aggregate(aggregate.id, aggregate = cloud.update_aggregate(aggregate.id, name=name,
name=name, availability_zone=availability_zone) availability_zone=availability_zone)
if metadata is not None: if metadata is not None:
metas = metadata metas = metadata
for i in (set(aggregate.metadata.keys()) - set(metadata.keys())): for i in (set(aggregate.metadata.keys()) - set(metadata.keys())):
@ -177,7 +174,7 @@ def main():
metas[i] = None metas[i] = None
cloud.set_aggregate_metadata(aggregate.id, metas) cloud.set_aggregate_metadata(aggregate.id, metas)
if hosts is not None: if hosts is not None:
for i in (set(aggregate.hosts) - set (hosts)): for i in (set(aggregate.hosts) - set(hosts)):
cloud.remove_host_from_aggregate(aggregate.id, i) cloud.remove_host_from_aggregate(aggregate.id, i)
for i in (set(hosts) - set(aggregate.hosts)): for i in (set(hosts) - set(aggregate.hosts)):
cloud.add_host_to_aggregate(aggregate.id, i) cloud.add_host_to_aggregate(aggregate.id, i)
@ -188,17 +185,15 @@ def main():
elif state == 'absent': elif state == 'absent':
if aggregate is None: if aggregate is None:
changed=False changed = False
else: else:
cloud.delete_aggregate(aggregate.id) cloud.delete_aggregate(aggregate.id)
changed=True changed = True
module.exit_json(changed=changed) module.exit_json(changed=changed)
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -2,19 +2,11 @@
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013, Benno Joy <benno@ansible.com> # Copyright (c) 2013, Benno Joy <benno@ansible.com>
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -83,6 +75,9 @@ try:
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
def process_object( def process_object(
cloud_obj, container, name, filename, container_access, **kwargs): cloud_obj, container, name, filename, container_access, **kwargs):
@ -105,10 +100,10 @@ def process_object(
if name: if name:
if cloud_obj.get_object_metadata(container, name): if cloud_obj.get_object_metadata(container, name):
cloud_obj.delete_object(container, name) cloud_obj.delete_object(container, name)
changed= True changed = True
else: else:
cloud_obj.delete_container(container) cloud_obj.delete_container(container)
changed= True changed = True
return changed return changed
@ -135,9 +130,6 @@ def main():
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == "__main__": if __name__ == "__main__":
main() main()

View file

@ -1,19 +1,11 @@
#!/usr/bin/python #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -215,6 +207,9 @@ try:
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
def _needs_update(module, port, cloud): def _needs_update(module, port, cloud):
"""Check for differences in the updatable values. """Check for differences in the updatable values.
@ -392,8 +387,6 @@ def main():
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -1,19 +1,11 @@
#!/usr/bin/python #!/usr/bin/python
# Copyright (c) 2016 IBM # Copyright (c) 2016 IBM
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -203,6 +195,9 @@ try:
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
def main(): def main():
argument_spec = openstack_full_argument_spec( argument_spec = openstack_full_argument_spec(
@ -227,8 +222,6 @@ def main():
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -1,18 +1,10 @@
#!/usr/bin/python #!/usr/bin/python
# Copyright (c) 2015 IBM Corporation # Copyright (c) 2015 IBM Corporation
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -110,13 +102,16 @@ project:
sample: True sample: True
''' '''
from distutils.version import StrictVersion
try: try:
import shade import shade
HAS_SHADE = True HAS_SHADE = True
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from distutils.version import StrictVersion from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
def _needs_update(module, project): def _needs_update(module, project):
@ -127,6 +122,7 @@ def _needs_update(module, project):
return False return False
def _system_state_change(module, project): def _system_state_change(module, project):
state = module.params['state'] state = module.params['state']
if state == 'present': if state == 'present':
@ -140,14 +136,14 @@ def _system_state_change(module, project):
elif state == 'absent': elif state == 'absent':
if project is None: if project is None:
changed=False changed = False
else: else:
changed=True changed = True
return changed return changed
def main():
def main():
argument_spec = openstack_full_argument_spec( argument_spec = openstack_full_argument_spec(
name=dict(required=True), name=dict(required=True),
description=dict(required=False, default=None), description=dict(required=False, default=None),
@ -221,17 +217,15 @@ def main():
elif state == 'absent': elif state == 'absent':
if project is None: if project is None:
changed=False changed = False
else: else:
cloud.delete_project(project['id']) cloud.delete_project(project['id'])
changed=True changed = True
module.exit_json(changed=changed) module.exit_json(changed=changed)
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=e.message, extra_data=e.extra_data) module.fail_json(msg=e.message, extra_data=e.extra_data)
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -1,18 +1,10 @@
#!/usr/bin/python #!/usr/bin/python
# Copyright (c) 2016 Hewlett-Packard Enterprise Corporation # Copyright (c) 2016 Hewlett-Packard Enterprise Corporation
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -121,6 +113,9 @@ try:
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec
def main(): def main():
@ -168,8 +163,6 @@ def main():
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -1,18 +1,9 @@
#!/usr/bin/python #!/usr/bin/python
# Copyright (c) 2016 Pason System Corporation # Copyright (c) 2016 Pason System Corporation
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
@ -300,8 +291,6 @@ openstack_quotas:
''' '''
import sys
try: try:
import shade import shade
from keystoneauth1 import exceptions from keystoneauth1 import exceptions
@ -309,6 +298,9 @@ try:
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec
def _get_volume_quotas(cloud, project): def _get_volume_quotas(cloud, project):
@ -489,7 +481,6 @@ def main():
project_quota_output = _get_quotas(module, cloud, cloud_params['name']) project_quota_output = _get_quotas(module, cloud, cloud_params['name'])
changes_required = True changes_required = True
elif module.params['state'] == "present": elif module.params['state'] == "present":
if module.check_mode: if module.check_mode:
module.exit_json(changed=_system_state_change(module, project_quota_output)) module.exit_json(changed=_system_state_change(module, project_quota_output))
@ -520,7 +511,5 @@ def main():
module.fail_json(msg=str(e), extra_data=e.extra_data) module.fail_json(msg=str(e), extra_data=e.extra_data)
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -1,18 +1,10 @@
#!/usr/bin/python #!/usr/bin/python
# Copyright (c) 2016 Hewlett-Packard Enterprise # Copyright (c) 2016 Hewlett-Packard Enterprise
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -135,13 +127,16 @@ recordset:
sample: ['10.0.0.1'] sample: ['10.0.0.1']
''' '''
from distutils.version import StrictVersion
try: try:
import shade import shade
HAS_SHADE = True HAS_SHADE = True
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from distutils.version import StrictVersion from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
def _system_state_change(state, records, description, ttl, zone, recordset): def _system_state_change(state, records, description, ttl, zone, recordset):
@ -158,6 +153,7 @@ def _system_state_change(state, records, description, ttl, zone, recordset):
return True return True
return False return False
def main(): def main():
argument_spec = openstack_full_argument_spec( argument_spec = openstack_full_argument_spec(
zone=dict(required=True), zone=dict(required=True),
@ -190,7 +186,7 @@ def main():
try: try:
cloud = shade.openstack_cloud(**module.params) cloud = shade.openstack_cloud(**module.params)
recordset_type = module.params.get('recordset_type') recordset_type = module.params.get('recordset_type')
recordset_filter = { 'type': recordset_type } recordset_filter = {'type': recordset_type}
recordsets = cloud.search_recordsets(zone, name_or_id=name + '.' + zone, filters=recordset_filter) recordsets = cloud.search_recordsets(zone, name_or_id=name + '.' + zone, filters=recordset_filter)
@ -245,18 +241,15 @@ def main():
None, recordset)) None, recordset))
if recordset is None: if recordset is None:
changed=False changed = False
else: else:
cloud.delete_recordset(zone, recordset_id) cloud.delete_recordset(zone, recordset_id)
changed=True changed = True
module.exit_json(changed=changed) module.exit_json(changed=changed)
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -1,17 +1,11 @@
#!/usr/bin/python #!/usr/bin/python
# #
# This module is free software: you can redistribute it and/or modify # Copyright: Ansible Project
# it under the terms of the GNU General Public License as published by # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. from __future__ import absolute_import, division, print_function
# __metaclass__ = type
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -172,13 +166,17 @@ router:
type: list type: list
''' '''
from distutils.version import StrictVersion
try: try:
import shade import shade
HAS_SHADE = True HAS_SHADE = True
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from distutils.version import StrictVersion from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
ROUTER_INTERFACE_OWNERS = set([ ROUTER_INTERFACE_OWNERS = set([
'network:router_interface', 'network:router_interface',
@ -417,8 +415,5 @@ def main():
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -2,19 +2,11 @@
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013, Benno Joy <benno@ansible.com> # Copyright (c) 2013, Benno Joy <benno@ansible.com>
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -74,6 +66,9 @@ try:
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
def _needs_update(module, secgroup): def _needs_update(module, secgroup):
"""Check for differences in the updatable values. """Check for differences in the updatable values.
@ -144,9 +139,6 @@ def main():
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == "__main__": if __name__ == "__main__":
main() main()

View file

@ -2,19 +2,11 @@
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013, Benno Joy <benno@ansible.com> # Copyright (c) 2013, Benno Joy <benno@ansible.com>
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -181,6 +173,9 @@ try:
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
def _ports_match(protocol, module_min, module_max, rule_min, rule_max): def _ports_match(protocol, module_min, module_max, rule_min, rule_max):
""" """
@ -353,9 +348,6 @@ def main():
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -4,19 +4,11 @@
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013, Benno Joy <benno@ansible.com> # Copyright (c) 2013, Benno Joy <benno@ansible.com>
# Copyright (c) 2013, John Dewey <john@dewey.ws> # Copyright (c) 2013, John Dewey <john@dewey.ws>
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -422,6 +414,10 @@ try:
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import (openstack_find_nova_addresses,
openstack_full_argument_spec, openstack_module_kwargs)
def _exit_hostvars(module, cloud, server, changed=True): def _exit_hostvars(module, cloud, server, changed=True):
hostvars = meta.get_hostvars_from_server(cloud, server) hostvars = meta.get_hostvars_from_server(cloud, server)
@ -766,8 +762,6 @@ def main():
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=str(e), extra_data=e.extra_data) module.fail_json(msg=str(e), extra_data=e.extra_data)
# this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -2,19 +2,11 @@
# coding: utf-8 -*- # coding: utf-8 -*-
# Copyright (c) 2015, Jesse Keating <jlk@derpops.bike> # Copyright (c) 2015, Jesse Keating <jlk@derpops.bike>
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -84,7 +76,6 @@ EXAMPLES = '''
try: try:
import shade import shade
from shade import meta
HAS_SHADE = True HAS_SHADE = True
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
@ -97,7 +88,7 @@ _action_map = {'stop': 'SHUTOFF',
'start': 'ACTIVE', 'start': 'ACTIVE',
'pause': 'PAUSED', 'pause': 'PAUSED',
'unpause': 'ACTIVE', 'unpause': 'ACTIVE',
'lock': 'ACTIVE', # API doesn't show lock/unlock status 'lock': 'ACTIVE', # API doesn't show lock/unlock status
'unlock': 'ACTIVE', 'unlock': 'ACTIVE',
'suspend': 'SUSPENDED', 'suspend': 'SUSPENDED',
'resume': 'ACTIVE', 'resume': 'ACTIVE',
@ -105,6 +96,7 @@ _action_map = {'stop': 'SHUTOFF',
_admin_actions = ['pause', 'unpause', 'suspend', 'resume', 'lock', 'unlock'] _admin_actions = ['pause', 'unpause', 'suspend', 'resume', 'lock', 'unlock']
def _wait(timeout, cloud, server, action, module): def _wait(timeout, cloud, server, action, module):
"""Wait for the server to reach the desired state for the given action.""" """Wait for the server to reach the desired state for the given action."""
@ -122,12 +114,14 @@ def _wait(timeout, cloud, server, action, module):
if server.status == 'ERROR': if server.status == 'ERROR':
module.fail_json(msg="Server reached ERROR state while attempting to %s" % action) module.fail_json(msg="Server reached ERROR state while attempting to %s" % action)
def _system_state_change(action, status): def _system_state_change(action, status):
"""Check if system state would change.""" """Check if system state would change."""
if status == _action_map[action]: if status == _action_map[action]:
return False return False
return True return True
def main(): def main():
argument_spec = openstack_full_argument_spec( argument_spec = openstack_full_argument_spec(
server=dict(required=True), server=dict(required=True),

View file

@ -1,19 +1,11 @@
#!/usr/bin/python #!/usr/bin/python
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -67,11 +59,13 @@ import fnmatch
try: try:
import shade import shade
from shade import meta
HAS_SHADE = True HAS_SHADE = True
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
def main(): def main():
@ -101,8 +95,6 @@ def main():
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -1,19 +1,11 @@
#!/usr/bin/python #!/usr/bin/python
# Copyright (c) 2016 Catalyst IT Limited # Copyright (c) 2016 Catalyst IT Limited
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -118,6 +110,9 @@ try:
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
def _system_state_change(state, server_group): def _system_state_change(state, server_group):
if state == 'present' and not server_group: if state == 'present' and not server_group:
@ -182,9 +177,5 @@ def main():
module.fail_json(msg=str(e), extra_data=e.extra_data) module.fail_json(msg=str(e), extra_data=e.extra_data)
# this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -2,19 +2,11 @@
#coding: utf-8 -*- #coding: utf-8 -*-
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -80,6 +72,9 @@ try:
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
def _system_state_change(state, device): def _system_state_change(state, device):
"""Check if system state would change.""" """Check if system state would change."""
@ -155,8 +150,6 @@ def main():
except (shade.OpenStackCloudException, shade.OpenStackCloudTimeout) as e: except (shade.OpenStackCloudException, shade.OpenStackCloudTimeout) as e:
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_utils/common.py
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -3,19 +3,11 @@
# (c) 2016, Mathieu Bultel <mbultel@redhat.com> # (c) 2016, Mathieu Bultel <mbultel@redhat.com>
# (c) 2016, Steve Baker <sbaker@redhat.com> # (c) 2016, Steve Baker <sbaker@redhat.com>
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -159,14 +151,17 @@ stack:
'updated_time': null}" 'updated_time': null}"
''' '''
from time import sleep
from distutils.version import StrictVersion from distutils.version import StrictVersion
try: try:
import shade import shade
HAS_SHADE = True HAS_SHADE = True
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
def _create_stack(module, stack, cloud): def _create_stack(module, stack, cloud):
try: try:
@ -271,7 +266,6 @@ def main():
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -1,20 +1,12 @@
#!/usr/bin/python #!/usr/bin/python
#coding: utf-8 -*- # coding: utf-8 -*-
# (c) 2013, Benno Joy <benno@ansible.com> # (c) 2013, Benno Joy <benno@ansible.com>
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -165,20 +157,21 @@ EXAMPLES = '''
ipv6_address_mode: dhcpv6-stateless ipv6_address_mode: dhcpv6-stateless
''' '''
from distutils.version import StrictVersion
try: try:
import shade import shade
HAS_SHADE = True HAS_SHADE = True
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from ansible.module_utils.basic import AnsibleModule
from distutils.version import StrictVersion from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
def _can_update(subnet, module, cloud): def _can_update(subnet, module, cloud):
"""Check for differences in non-updatable values""" """Check for differences in non-updatable values"""
network_name = module.params['network_name'] network_name = module.params['network_name']
cidr = module.params['cidr']
ip_version = int(module.params['ip_version']) ip_version = int(module.params['ip_version'])
ipv6_ra_mode = module.params['ipv6_ra_mode'] ipv6_ra_mode = module.params['ipv6_ra_mode']
ipv6_a_mode = module.params['ipv6_address_mode'] ipv6_a_mode = module.params['ipv6_address_mode']
@ -200,6 +193,7 @@ def _can_update(subnet, module, cloud):
module.fail_json(msg='Cannot update ipv6_address_mode in existing \ module.fail_json(msg='Cannot update ipv6_address_mode in existing \
subnet') subnet')
def _needs_update(subnet, module, cloud): def _needs_update(subnet, module, cloud):
"""Check for differences in the updatable values.""" """Check for differences in the updatable values."""
@ -384,8 +378,5 @@ def main():
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -1,19 +1,11 @@
#!/usr/bin/python #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -144,6 +136,9 @@ try:
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec
def main(): def main():
@ -159,15 +154,13 @@ def main():
try: try:
cloud = shade.openstack_cloud(**module.params) cloud = shade.openstack_cloud(**module.params)
subnets = cloud.search_subnets(module.params['name'], subnets = cloud.search_subnets(module.params['name'],
module.params['filters']) module.params['filters'])
module.exit_json(changed=False, ansible_facts=dict( module.exit_json(changed=False, ansible_facts=dict(
openstack_subnets=subnets)) openstack_subnets=subnets))
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -1,18 +1,10 @@
#!/usr/bin/python #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -145,13 +137,14 @@ user:
type: string type: string
sample: "demouser" sample: "demouser"
''' '''
from distutils.version import StrictVersion
try: try:
import shade import shade
HAS_SHADE = True HAS_SHADE = True
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from distutils.version import StrictVersion
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs

View file

@ -1,18 +1,10 @@
#!/usr/bin/python #!/usr/bin/python
# Copyright (c) 2016 Hewlett-Packard Enterprise Corporation # Copyright (c) 2016 Hewlett-Packard Enterprise Corporation
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -129,6 +121,9 @@ try:
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec
def main(): def main():
@ -169,16 +164,13 @@ def main():
filters['domain_id'] = domain filters['domain_id'] = domain
users = opcloud.search_users(name, users = opcloud.search_users(name, filters)
filters)
module.exit_json(changed=False, ansible_facts=dict( module.exit_json(changed=False, ansible_facts=dict(
openstack_users=users)) openstack_users=users))
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -1,18 +1,10 @@
#!/usr/bin/python #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -65,6 +57,9 @@ try:
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
def _system_state_change(state, in_group): def _system_state_change(state, in_group):
if state == 'present' and not in_group: if state == 'present' and not in_group:
@ -73,6 +68,7 @@ def _system_state_change(state, in_group):
return True return True
return False return False
def main(): def main():
argument_spec = openstack_full_argument_spec( argument_spec = openstack_full_argument_spec(
user=dict(required=True), user=dict(required=True),
@ -109,7 +105,7 @@ def main():
elif state == 'absent': elif state == 'absent':
if in_group: if in_group:
cloud.remove_user_from_group(user, group) cloud.remove_user_from_group(user, group)
changed=True changed = True
module.exit_json(changed=changed) module.exit_json(changed=changed)
@ -117,8 +113,5 @@ def main():
module.fail_json(msg=str(e), extra_data=e.extra_data) module.fail_json(msg=str(e), extra_data=e.extra_data)
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -1,18 +1,10 @@
#!/usr/bin/python #!/usr/bin/python
# Copyright (c) 2016 IBM # Copyright (c) 2016 IBM
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -94,13 +86,16 @@ RETURN = '''
# #
''' '''
from distutils.version import StrictVersion
try: try:
import shade import shade
HAS_SHADE = True HAS_SHADE = True
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from distutils.version import StrictVersion from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
def _system_state_change(state, assignment): def _system_state_change(state, assignment):
@ -205,7 +200,7 @@ def main():
if assignment: if assignment:
kwargs = _build_kwargs(user, group, project, domain) kwargs = _build_kwargs(user, group, project, domain)
cloud.revoke_role(role, **kwargs) cloud.revoke_role(role, **kwargs)
changed=True changed = True
module.exit_json(changed=changed) module.exit_json(changed=changed)
@ -213,8 +208,5 @@ def main():
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -1,19 +1,11 @@
#!/usr/bin/python #!/usr/bin/python
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -101,6 +93,7 @@ EXAMPLES = '''
scheduler_hints: scheduler_hints:
same_host: 243e8d3c-8f47-4a61-93d6-7215c344b0c0 same_host: 243e8d3c-8f47-4a61-93d6-7215c344b0c0
''' '''
from distutils.version import StrictVersion
try: try:
import shade import shade
@ -108,7 +101,8 @@ try:
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from distutils.version import StrictVersion from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
def _present_volume(module, cloud): def _present_volume(module, cloud):
@ -197,8 +191,6 @@ def main():
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -1,18 +1,10 @@
#!/usr/bin/python #!/usr/bin/python
# Copyright (c) 2016 Hewlett-Packard Enterprise # Copyright (c) 2016 Hewlett-Packard Enterprise
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by from __future__ import absolute_import, division, print_function
# the Free Software Foundation, either version 3 of the License, or __metaclass__ = type
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -134,13 +126,16 @@ zone:
sample: [] sample: []
''' '''
from distutils.version import StrictVersion
try: try:
import shade import shade
HAS_SHADE = True HAS_SHADE = True
except ImportError: except ImportError:
HAS_SHADE = False HAS_SHADE = False
from distutils.version import StrictVersion from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
def _system_state_change(state, email, description, ttl, masters, zone): def _system_state_change(state, email, description, ttl, masters, zone):
@ -159,6 +154,7 @@ def _system_state_change(state, email, description, ttl, masters, zone):
return True return True
return False return False
def main(): def main():
argument_spec = openstack_full_argument_spec( argument_spec = openstack_full_argument_spec(
name=dict(required=True), name=dict(required=True),
@ -188,7 +184,6 @@ def main():
cloud = shade.openstack_cloud(**module.params) cloud = shade.openstack_cloud(**module.params)
zone = cloud.get_zone(name) zone = cloud.get_zone(name)
if state == 'present': if state == 'present':
zone_type = module.params.get('zone_type') zone_type = module.params.get('zone_type')
email = module.params.get('email') email = module.params.get('email')
@ -228,18 +223,15 @@ def main():
None, zone)) None, zone))
if zone is None: if zone is None:
changed=False changed = False
else: else:
cloud.delete_zone(name) cloud.delete_zone(name)
changed=True changed = True
module.exit_json(changed=changed) module.exit_json(changed=changed)
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))
from ansible.module_utils.basic import *
from ansible.module_utils.openstack import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -21,7 +21,6 @@ future2=$(find ./lib/ansible -path ./lib/ansible/modules -prune \
# Eventually we want metaclass3 and future3 to get down to 0 # Eventually we want metaclass3 and future3 to get down to 0
metaclass3=$(find ./lib/ansible/modules -path ./lib/ansible/modules/windows -prune \ metaclass3=$(find ./lib/ansible/modules -path ./lib/ansible/modules/windows -prune \
-o -path ./lib/ansible/modules/cloud/ovirt -prune \ -o -path ./lib/ansible/modules/cloud/ovirt -prune \
-o -path ./lib/ansible/modules/cloud/openstack -prune \
-o -path ./lib/ansible/modules/cloud/cloudstack -prune \ -o -path ./lib/ansible/modules/cloud/cloudstack -prune \
-o -path ./lib/ansible/modules/cloud/amazon -prune \ -o -path ./lib/ansible/modules/cloud/amazon -prune \
-o -path ./lib/ansible/modules/network/aos -prune \ -o -path ./lib/ansible/modules/network/aos -prune \
@ -40,7 +39,6 @@ metaclass3=$(find ./lib/ansible/modules -path ./lib/ansible/modules/windows -pru
future3=$(find ./lib/ansible/modules -path ./lib/ansible/modules/windows -prune \ future3=$(find ./lib/ansible/modules -path ./lib/ansible/modules/windows -prune \
-o -path ./lib/ansible/modules/cloud/ovirt -prune \ -o -path ./lib/ansible/modules/cloud/ovirt -prune \
-o -path ./lib/ansible/modules/cloud/openstack -prune \
-o -path ./lib/ansible/modules/cloud/cloudstack -prune \ -o -path ./lib/ansible/modules/cloud/cloudstack -prune \
-o -path ./lib/ansible/modules/cloud/amazon -prune \ -o -path ./lib/ansible/modules/cloud/amazon -prune \
-o -path ./lib/ansible/modules/network/aos -prune \ -o -path ./lib/ansible/modules/network/aos -prune \
@ -64,7 +62,7 @@ future3=$(find ./lib/ansible/modules -path ./lib/ansible/modules/windows -prune
### TODO: ### TODO:
### - module_utils <=== these are important but not well organized so we'd ### - module_utils <=== these are important but not well organized so we'd
### have to construct the teset file by file ### have to construct the test file by file
### - contrib/ <=== Not a priority as these will move to inventory plugins over time ### - contrib/ <=== Not a priority as these will move to inventory plugins over time

View file

@ -18,7 +18,6 @@ wildcard_imports=$(find . -path ./test/runner/.tox -prune \
-o -path ./lib/ansible/compat/tests/mock.py -prune \ -o -path ./lib/ansible/compat/tests/mock.py -prune \
-o -path ./lib/ansible/compat/tests/unittest.py \ -o -path ./lib/ansible/compat/tests/unittest.py \
-o -path ./test/units/modules/network/cumulus/test_nclu.py -prune \ -o -path ./test/units/modules/network/cumulus/test_nclu.py -prune \
-o -path ./lib/ansible/modules/cloud/openstack -prune \
-o -path ./lib/ansible/modules/cloud/cloudstack -prune \ -o -path ./lib/ansible/modules/cloud/cloudstack -prune \
-o -path ./lib/ansible/modules/network/f5 -prune \ -o -path ./lib/ansible/modules/network/f5 -prune \
-o -path ./lib/ansible/modules/network/nxos -prune \ -o -path ./lib/ansible/modules/network/nxos -prune \

View file

@ -98,30 +98,14 @@ lib/ansible/modules/cloud/misc/serverless.py
lib/ansible/modules/cloud/misc/virt_net.py lib/ansible/modules/cloud/misc/virt_net.py
lib/ansible/modules/cloud/misc/virt_pool.py lib/ansible/modules/cloud/misc/virt_pool.py
lib/ansible/modules/cloud/misc/xenserver_facts.py lib/ansible/modules/cloud/misc/xenserver_facts.py
lib/ansible/modules/cloud/openstack/os_group.py
lib/ansible/modules/cloud/openstack/os_image.py lib/ansible/modules/cloud/openstack/os_image.py
lib/ansible/modules/cloud/openstack/os_ironic.py
lib/ansible/modules/cloud/openstack/os_keypair.py lib/ansible/modules/cloud/openstack/os_keypair.py
lib/ansible/modules/cloud/openstack/os_keystone_domain.py
lib/ansible/modules/cloud/openstack/os_keystone_role.py
lib/ansible/modules/cloud/openstack/os_keystone_service.py
lib/ansible/modules/cloud/openstack/os_nova_flavor.py lib/ansible/modules/cloud/openstack/os_nova_flavor.py
lib/ansible/modules/cloud/openstack/os_nova_host_aggregate.py
lib/ansible/modules/cloud/openstack/os_object.py
lib/ansible/modules/cloud/openstack/os_project.py
lib/ansible/modules/cloud/openstack/os_quota.py lib/ansible/modules/cloud/openstack/os_quota.py
lib/ansible/modules/cloud/openstack/os_recordset.py
lib/ansible/modules/cloud/openstack/os_security_group_rule.py lib/ansible/modules/cloud/openstack/os_security_group_rule.py
lib/ansible/modules/cloud/openstack/os_server.py lib/ansible/modules/cloud/openstack/os_server.py
lib/ansible/modules/cloud/openstack/os_server_action.py
lib/ansible/modules/cloud/openstack/os_server_volume.py lib/ansible/modules/cloud/openstack/os_server_volume.py
lib/ansible/modules/cloud/openstack/os_stack.py lib/ansible/modules/cloud/openstack/os_stack.py
lib/ansible/modules/cloud/openstack/os_subnet.py
lib/ansible/modules/cloud/openstack/os_subnets_facts.py
lib/ansible/modules/cloud/openstack/os_user_facts.py
lib/ansible/modules/cloud/openstack/os_user_group.py
lib/ansible/modules/cloud/openstack/os_user_role.py
lib/ansible/modules/cloud/openstack/os_zone.py
lib/ansible/modules/cloud/ovh/ovh_ip_loadbalancing_backend.py lib/ansible/modules/cloud/ovh/ovh_ip_loadbalancing_backend.py
lib/ansible/modules/cloud/ovirt/ovirt_affinity_group.py lib/ansible/modules/cloud/ovirt/ovirt_affinity_group.py
lib/ansible/modules/cloud/ovirt/ovirt_nics.py lib/ansible/modules/cloud/ovirt/ovirt_nics.py