Initial commit

This commit is contained in:
Ansible Core Team 2020-03-09 09:11:07 +00:00
commit aebc1b03fd
4861 changed files with 812621 additions and 0 deletions

View file

View file

@ -0,0 +1,34 @@
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete work.
#
# (c) 2018 Luca 'remix_tj' Lorenzetto
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
emc_vnx_argument_spec = {
'sp_address': dict(type='str', required=True),
'sp_user': dict(type='str', required=False, default='sysadmin'),
'sp_password': dict(type='str', required=False, default='sysadmin',
no_log=True),
}

View file

@ -0,0 +1,90 @@
# Copyright: (c) 2018, Hewlett Packard Enterprise Development LP
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
from ansible.module_utils import basic
def convert_to_binary_multiple(size_with_unit):
if size_with_unit is None:
return -1
valid_units = ['MiB', 'GiB', 'TiB']
valid_unit = False
for unit in valid_units:
if size_with_unit.strip().endswith(unit):
valid_unit = True
size = size_with_unit.split(unit)[0]
if float(size) < 0:
return -1
if not valid_unit:
raise ValueError("%s does not have a valid unit. The unit must be one of %s" % (size_with_unit, valid_units))
size = size_with_unit.replace(" ", "").split('iB')[0]
size_kib = basic.human_to_bytes(size)
return int(size_kib / (1024 * 1024))
storage_system_spec = {
"storage_system_ip": {
"required": True,
"type": "str"
},
"storage_system_username": {
"required": True,
"type": "str",
"no_log": True
},
"storage_system_password": {
"required": True,
"type": "str",
"no_log": True
},
"secure": {
"type": "bool",
"default": False
}
}
def cpg_argument_spec():
spec = {
"state": {
"required": True,
"choices": ['present', 'absent'],
"type": 'str'
},
"cpg_name": {
"required": True,
"type": "str"
},
"domain": {
"type": "str"
},
"growth_increment": {
"type": "str",
},
"growth_limit": {
"type": "str",
},
"growth_warning": {
"type": "str",
},
"raid_type": {
"required": False,
"type": "str",
"choices": ['R0', 'R1', 'R5', 'R6']
},
"set_size": {
"required": False,
"type": "int"
},
"high_availability": {
"type": "str",
"choices": ['PORT', 'CAGE', 'MAG']
},
"disk_type": {
"type": "str",
"choices": ['FC', 'NL', 'SSD']
}
}
spec.update(storage_system_spec)
return spec