PEP 8 indent cleanup. (#20800)
* PEP 8 E121 cleanup. * PEP 8 E126 cleanup. * PEP 8 E122 cleanup.
This commit is contained in:
parent
1c6bb4add9
commit
10d9318de7
244 changed files with 2873 additions and 2973 deletions
|
@ -446,7 +446,7 @@ class AzureInventory(object):
|
|||
def _parse_cli_args(self):
|
||||
# Parse command line arguments
|
||||
parser = argparse.ArgumentParser(
|
||||
description='Produce an Ansible Inventory file for an Azure subscription')
|
||||
description='Produce an Ansible Inventory file for an Azure subscription')
|
||||
parser.add_argument('--list', action='store_true', default=True,
|
||||
help='List instances (default: True)')
|
||||
parser.add_argument('--debug', action='store_true', default=False,
|
||||
|
|
|
@ -199,8 +199,8 @@ class CloudStackInventory(object):
|
|||
group_name = group['name']
|
||||
if group_name and not group_name in data:
|
||||
data[group_name] = {
|
||||
'hosts': []
|
||||
}
|
||||
'hosts': []
|
||||
}
|
||||
|
||||
hosts = self.cs.listVirtualMachines(projectid=project_id, domainid=domain_id)
|
||||
if not hosts:
|
||||
|
|
|
@ -252,10 +252,10 @@ class ConsulInventory(object):
|
|||
ok = 'passing' == check['Status']
|
||||
if ok:
|
||||
suffix = self.config.get_availability_suffix(
|
||||
'available_suffix', '_available')
|
||||
'available_suffix', '_available')
|
||||
else:
|
||||
suffix = self.config.get_availability_suffix(
|
||||
'unavailable_suffix', '_unavailable')
|
||||
'unavailable_suffix', '_unavailable')
|
||||
self.add_node_to_map(self.nodes_by_availability,
|
||||
service_name + suffix, node['Node'])
|
||||
|
||||
|
|
|
@ -353,12 +353,12 @@ or environment variables (DO_API_TOKEN)\n''')
|
|||
def build_inventory(self):
|
||||
'''Build Ansible inventory of droplets'''
|
||||
self.inventory = {
|
||||
'all': {
|
||||
'hosts': [],
|
||||
'vars': self.group_variables
|
||||
},
|
||||
'_meta': {'hostvars': {}}
|
||||
}
|
||||
'all': {
|
||||
'hosts': [],
|
||||
'vars': self.group_variables
|
||||
},
|
||||
'_meta': {'hostvars': {}}
|
||||
}
|
||||
|
||||
# add all droplets by id and name
|
||||
for droplet in self.data['droplets']:
|
||||
|
@ -379,22 +379,22 @@ or environment variables (DO_API_TOKEN)\n''')
|
|||
|
||||
# groups that are always present
|
||||
for group in [
|
||||
'region_' + droplet['region']['slug'],
|
||||
'image_' + str(droplet['image']['id']),
|
||||
'size_' + droplet['size']['slug'],
|
||||
'distro_' + self.to_safe(droplet['image']['distribution']),
|
||||
'status_' + droplet['status'],
|
||||
'region_' + droplet['region']['slug'],
|
||||
'image_' + str(droplet['image']['id']),
|
||||
'size_' + droplet['size']['slug'],
|
||||
'distro_' + self.to_safe(droplet['image']['distribution']),
|
||||
'status_' + droplet['status'],
|
||||
|
||||
]:
|
||||
]:
|
||||
if group not in self.inventory:
|
||||
self.inventory[group] = { 'hosts': [ ], 'vars': {} }
|
||||
self.inventory[group]['hosts'].append(dest)
|
||||
|
||||
# groups that are not always present
|
||||
for group in [
|
||||
droplet['image']['slug'],
|
||||
droplet['image']['name']
|
||||
]:
|
||||
droplet['image']['slug'],
|
||||
droplet['image']['name']
|
||||
]:
|
||||
if group:
|
||||
image = 'image_' + self.to_safe(group)
|
||||
if image not in self.inventory:
|
||||
|
|
|
@ -676,7 +676,7 @@ class DockerInventory(object):
|
|||
# use hosts from config file
|
||||
for host in hosts_list:
|
||||
docker_host = host.get('host') or def_host or self._args.docker_host or \
|
||||
self._env_args.docker_host or DEFAULT_DOCKER_HOST
|
||||
self._env_args.docker_host or DEFAULT_DOCKER_HOST
|
||||
api_version = host.get('version') or def_version or self._args.api_version or \
|
||||
self._env_args.api_version or DEFAULT_DOCKER_API_VERSION
|
||||
tls_hostname = host.get('tls_hostname') or def_tls_hostname or self._args.tls_hostname or \
|
||||
|
@ -816,7 +816,7 @@ class DockerInventory(object):
|
|||
default_config = basename + '.yml'
|
||||
|
||||
parser = argparse.ArgumentParser(
|
||||
description='Return Ansible inventory for one or more Docker hosts.')
|
||||
description='Return Ansible inventory for one or more Docker hosts.')
|
||||
parser.add_argument('--list', action='store_true', default=True,
|
||||
help='List all containers (default: True)')
|
||||
parser.add_argument('--debug', action='store_true', default=False,
|
||||
|
|
|
@ -323,7 +323,7 @@ class GceInventory(object):
|
|||
''' Command line argument processing '''
|
||||
|
||||
parser = argparse.ArgumentParser(
|
||||
description='Produce an Ansible Inventory file based on GCE')
|
||||
description='Produce an Ansible Inventory file based on GCE')
|
||||
parser.add_argument('--list', action='store_true', default=True,
|
||||
help='List instances (default: True)')
|
||||
parser.add_argument('--host', action='store',
|
||||
|
|
|
@ -109,7 +109,7 @@ def print_host(host):
|
|||
|
||||
def get_args(args_list):
|
||||
parser = argparse.ArgumentParser(
|
||||
description='ansible inventory script parsing .ssh/config')
|
||||
description='ansible inventory script parsing .ssh/config')
|
||||
mutex_group = parser.add_mutually_exclusive_group(required=True)
|
||||
help_list = 'list all hosts from .ssh/config inventory'
|
||||
mutex_group.add_argument('--list', action='store_true', help=help_list)
|
||||
|
|
|
@ -230,17 +230,17 @@ htmlhelp_basename = 'Ansibledoc'
|
|||
# -- Options for LaTeX output ---------------------------------------------
|
||||
|
||||
latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#'papersize': 'letterpaper',
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#'papersize': 'letterpaper',
|
||||
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#'pointsize': '10pt',
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#'pointsize': '10pt',
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#'preamble': '',
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#'preamble': '',
|
||||
|
||||
# Latex figure (float) alignment
|
||||
#'figure_align': 'htbp',
|
||||
# Latex figure (float) alignment
|
||||
#'figure_align': 'htbp',
|
||||
}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
|
|
|
@ -203,7 +203,7 @@ htmlhelp_basename = 'Poseidodoc'
|
|||
# (source start file, target name, title, author, document class
|
||||
# [howto/manual]).
|
||||
latex_documents = [
|
||||
('index', 'ansible.tex', 'Ansible 2.2 Documentation', AUTHOR, 'manual'),
|
||||
('index', 'ansible.tex', 'Ansible 2.2 Documentation', AUTHOR, 'manual'),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
|
|
|
@ -203,7 +203,7 @@ htmlhelp_basename = 'Poseidodoc'
|
|||
# (source start file, target name, title, author, document class
|
||||
# [howto/manual]).
|
||||
latex_documents = [
|
||||
('index', 'ansible.tex', 'Ansible 1.2 Documentation',
|
||||
('index', 'ansible.tex', 'Ansible 1.2 Documentation',
|
||||
AUTHOR, 'manual'),
|
||||
]
|
||||
|
||||
|
|
|
@ -238,21 +238,21 @@ htmlhelp_basename = 'dev_guidedoc'
|
|||
# -- Options for LaTeX output ---------------------------------------------
|
||||
|
||||
latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#
|
||||
# 'papersize': 'letterpaper',
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#
|
||||
# 'papersize': 'letterpaper',
|
||||
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#
|
||||
# 'pointsize': '10pt',
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#
|
||||
# 'pointsize': '10pt',
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#
|
||||
# 'preamble': '',
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#
|
||||
# 'preamble': '',
|
||||
|
||||
# Latex figure (float) alignment
|
||||
#
|
||||
# 'figure_align': 'htbp',
|
||||
# Latex figure (float) alignment
|
||||
#
|
||||
# 'figure_align': 'htbp',
|
||||
}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
|
|
|
@ -48,11 +48,11 @@ def main():
|
|||
|
||||
# create play with tasks
|
||||
play_source = dict(
|
||||
name = "Ansible Play",
|
||||
hosts = host_list,
|
||||
gather_facts = 'no',
|
||||
tasks = [ dict(action=dict(module='command', args=dict(cmd='/usr/bin/uptime'))) ]
|
||||
)
|
||||
name = "Ansible Play",
|
||||
hosts = host_list,
|
||||
gather_facts = 'no',
|
||||
tasks = [ dict(action=dict(module='command', args=dict(cmd='/usr/bin/uptime'))) ]
|
||||
)
|
||||
play = Play().load(play_source, variable_manager=variable_manager, loader=loader)
|
||||
|
||||
# actually run it
|
||||
|
@ -60,12 +60,12 @@ def main():
|
|||
callback = ResultsCollector()
|
||||
try:
|
||||
tqm = TaskQueueManager(
|
||||
inventory=inventory,
|
||||
variable_manager=variable_manager,
|
||||
loader=loader,
|
||||
options=options,
|
||||
passwords=passwords,
|
||||
)
|
||||
inventory=inventory,
|
||||
variable_manager=variable_manager,
|
||||
loader=loader,
|
||||
options=options,
|
||||
passwords=passwords,
|
||||
)
|
||||
tqm._stdout_callback = callback
|
||||
result = tqm.run(play)
|
||||
finally:
|
||||
|
|
|
@ -15,23 +15,23 @@ import json
|
|||
import sys
|
||||
|
||||
filelist = [
|
||||
'/etc/oracle-release',
|
||||
'/etc/slackware-version',
|
||||
'/etc/redhat-release',
|
||||
'/etc/vmware-release',
|
||||
'/etc/openwrt_release',
|
||||
'/etc/system-release',
|
||||
'/etc/alpine-release',
|
||||
'/etc/release',
|
||||
'/etc/arch-release',
|
||||
'/etc/os-release',
|
||||
'/etc/SuSE-release',
|
||||
'/etc/gentoo-release',
|
||||
'/etc/os-release',
|
||||
'/etc/lsb-release',
|
||||
'/etc/altlinux-release',
|
||||
'/etc/os-release',
|
||||
'/etc/coreos/update.conf',
|
||||
'/etc/oracle-release',
|
||||
'/etc/slackware-version',
|
||||
'/etc/redhat-release',
|
||||
'/etc/vmware-release',
|
||||
'/etc/openwrt_release',
|
||||
'/etc/system-release',
|
||||
'/etc/alpine-release',
|
||||
'/etc/release',
|
||||
'/etc/arch-release',
|
||||
'/etc/os-release',
|
||||
'/etc/SuSE-release',
|
||||
'/etc/gentoo-release',
|
||||
'/etc/os-release',
|
||||
'/etc/lsb-release',
|
||||
'/etc/altlinux-release',
|
||||
'/etc/os-release',
|
||||
'/etc/coreos/update.conf',
|
||||
]
|
||||
|
||||
fcont = {}
|
||||
|
|
|
@ -187,15 +187,15 @@ class AdHocCLI(CLI):
|
|||
self._tqm = None
|
||||
try:
|
||||
self._tqm = TaskQueueManager(
|
||||
inventory=inventory,
|
||||
variable_manager=variable_manager,
|
||||
loader=loader,
|
||||
options=self.options,
|
||||
passwords=passwords,
|
||||
stdout_callback=cb,
|
||||
run_additional_callbacks=C.DEFAULT_LOAD_CALLBACK_PLUGINS,
|
||||
run_tree=run_tree,
|
||||
)
|
||||
inventory=inventory,
|
||||
variable_manager=variable_manager,
|
||||
loader=loader,
|
||||
options=self.options,
|
||||
passwords=passwords,
|
||||
stdout_callback=cb,
|
||||
run_additional_callbacks=C.DEFAULT_LOAD_CALLBACK_PLUGINS,
|
||||
run_tree=run_tree,
|
||||
)
|
||||
|
||||
result = self._tqm.run(play)
|
||||
finally:
|
||||
|
|
|
@ -198,15 +198,15 @@ class ConsoleCLI(CLI, cmd.Cmd):
|
|||
self._tqm = None
|
||||
try:
|
||||
self._tqm = TaskQueueManager(
|
||||
inventory=self.inventory,
|
||||
variable_manager=self.variable_manager,
|
||||
loader=self.loader,
|
||||
options=self.options,
|
||||
passwords=self.passwords,
|
||||
stdout_callback=cb,
|
||||
run_additional_callbacks=C.DEFAULT_LOAD_CALLBACK_PLUGINS,
|
||||
run_tree=False,
|
||||
)
|
||||
inventory=self.inventory,
|
||||
variable_manager=self.variable_manager,
|
||||
loader=self.loader,
|
||||
options=self.options,
|
||||
passwords=self.passwords,
|
||||
stdout_callback=cb,
|
||||
run_additional_callbacks=C.DEFAULT_LOAD_CALLBACK_PLUGINS,
|
||||
run_tree=False,
|
||||
)
|
||||
|
||||
result = self._tqm.run(play)
|
||||
finally:
|
||||
|
|
|
@ -42,7 +42,7 @@ if _system_six:
|
|||
not hasattr(_system_six, 'byte2int') or
|
||||
not hasattr(_system_six, 'add_metaclass') or
|
||||
not hasattr(_system_six.moves, 'urllib')
|
||||
):
|
||||
):
|
||||
|
||||
_system_six = False
|
||||
|
||||
|
|
|
@ -177,7 +177,7 @@ class PlayIterator:
|
|||
setup_task.name = 'Gathering Facts'
|
||||
setup_task.tags = ['always']
|
||||
setup_task.args = {
|
||||
'gather_subset': gather_subset,
|
||||
'gather_subset': gather_subset,
|
||||
}
|
||||
if gather_timeout:
|
||||
setup_task.args['gather_timeout'] = gather_timeout
|
||||
|
|
|
@ -35,26 +35,26 @@ BOOLEANS = BOOLEANS_TRUE + BOOLEANS_FALSE
|
|||
SIZE_RANGES = { 'Y': 1<<80, 'Z': 1<<70, 'E': 1<<60, 'P': 1<<50, 'T': 1<<40, 'G': 1<<30, 'M': 1<<20, 'K': 1<<10, 'B': 1 }
|
||||
|
||||
FILE_ATTRIBUTES = {
|
||||
'A': 'noatime',
|
||||
'a': 'append',
|
||||
'c': 'compressed',
|
||||
'C': 'nocow',
|
||||
'd': 'nodump',
|
||||
'D': 'dirsync',
|
||||
'e': 'extents',
|
||||
'E': 'encrypted',
|
||||
'h': 'blocksize',
|
||||
'i': 'immutable',
|
||||
'I': 'indexed',
|
||||
'j': 'journalled',
|
||||
'N': 'inline',
|
||||
's': 'zero',
|
||||
'S': 'synchronous',
|
||||
't': 'notail',
|
||||
'T': 'blockroot',
|
||||
'u': 'undelete',
|
||||
'X': 'compressedraw',
|
||||
'Z': 'compresseddirty',
|
||||
'A': 'noatime',
|
||||
'a': 'append',
|
||||
'c': 'compressed',
|
||||
'C': 'nocow',
|
||||
'd': 'nodump',
|
||||
'D': 'dirsync',
|
||||
'e': 'extents',
|
||||
'E': 'encrypted',
|
||||
'h': 'blocksize',
|
||||
'i': 'immutable',
|
||||
'I': 'indexed',
|
||||
'j': 'journalled',
|
||||
'N': 'inline',
|
||||
's': 'zero',
|
||||
'S': 'synchronous',
|
||||
't': 'notail',
|
||||
'T': 'blockroot',
|
||||
'u': 'undelete',
|
||||
'X': 'compressedraw',
|
||||
'Z': 'compresseddirty',
|
||||
}
|
||||
|
||||
# ansible modules can be written in any language. To simplify
|
||||
|
@ -728,19 +728,19 @@ class AnsibleModule(object):
|
|||
self._set_defaults(pre=True)
|
||||
|
||||
self._CHECK_ARGUMENT_TYPES_DISPATCHER = {
|
||||
'str': self._check_type_str,
|
||||
'list': self._check_type_list,
|
||||
'dict': self._check_type_dict,
|
||||
'bool': self._check_type_bool,
|
||||
'int': self._check_type_int,
|
||||
'float': self._check_type_float,
|
||||
'path': self._check_type_path,
|
||||
'raw': self._check_type_raw,
|
||||
'jsonarg': self._check_type_jsonarg,
|
||||
'json': self._check_type_jsonarg,
|
||||
'bytes': self._check_type_bytes,
|
||||
'bits': self._check_type_bits,
|
||||
}
|
||||
'str': self._check_type_str,
|
||||
'list': self._check_type_list,
|
||||
'dict': self._check_type_dict,
|
||||
'bool': self._check_type_bool,
|
||||
'int': self._check_type_int,
|
||||
'float': self._check_type_float,
|
||||
'path': self._check_type_path,
|
||||
'raw': self._check_type_raw,
|
||||
'jsonarg': self._check_type_jsonarg,
|
||||
'json': self._check_type_jsonarg,
|
||||
'bytes': self._check_type_bytes,
|
||||
'bits': self._check_type_bits,
|
||||
}
|
||||
if not bypass_checks:
|
||||
self._check_required_arguments()
|
||||
self._check_argument_types()
|
||||
|
|
|
@ -1078,22 +1078,22 @@ class LinuxHardware(Hardware):
|
|||
memstats['swap:used'] = memstats['swaptotal'] - memstats['swapfree']
|
||||
|
||||
self.facts['memory_mb'] = {
|
||||
'real' : {
|
||||
'total': memstats.get('memtotal'),
|
||||
'used': memstats.get('real:used'),
|
||||
'free': memstats.get('memfree'),
|
||||
},
|
||||
'nocache' : {
|
||||
'free': memstats.get('nocache:free'),
|
||||
'used': memstats.get('nocache:used'),
|
||||
},
|
||||
'swap' : {
|
||||
'total': memstats.get('swaptotal'),
|
||||
'free': memstats.get('swapfree'),
|
||||
'used': memstats.get('swap:used'),
|
||||
'cached': memstats.get('swapcached'),
|
||||
},
|
||||
}
|
||||
'real' : {
|
||||
'total': memstats.get('memtotal'),
|
||||
'used': memstats.get('real:used'),
|
||||
'free': memstats.get('memfree'),
|
||||
},
|
||||
'nocache' : {
|
||||
'free': memstats.get('nocache:free'),
|
||||
'used': memstats.get('nocache:used'),
|
||||
},
|
||||
'swap' : {
|
||||
'total': memstats.get('swaptotal'),
|
||||
'free': memstats.get('swapfree'),
|
||||
'used': memstats.get('swap:used'),
|
||||
'cached': memstats.get('swapcached'),
|
||||
},
|
||||
}
|
||||
|
||||
def get_cpu_facts(self):
|
||||
i = 0
|
||||
|
@ -1212,15 +1212,15 @@ class LinuxHardware(Hardware):
|
|||
"CompactPCI", "AdvancedTCA", "Blade" ]
|
||||
|
||||
DMI_DICT = {
|
||||
'bios_date': '/sys/devices/virtual/dmi/id/bios_date',
|
||||
'bios_version': '/sys/devices/virtual/dmi/id/bios_version',
|
||||
'form_factor': '/sys/devices/virtual/dmi/id/chassis_type',
|
||||
'product_name': '/sys/devices/virtual/dmi/id/product_name',
|
||||
'product_serial': '/sys/devices/virtual/dmi/id/product_serial',
|
||||
'product_uuid': '/sys/devices/virtual/dmi/id/product_uuid',
|
||||
'product_version': '/sys/devices/virtual/dmi/id/product_version',
|
||||
'system_vendor': '/sys/devices/virtual/dmi/id/sys_vendor'
|
||||
}
|
||||
'bios_date': '/sys/devices/virtual/dmi/id/bios_date',
|
||||
'bios_version': '/sys/devices/virtual/dmi/id/bios_version',
|
||||
'form_factor': '/sys/devices/virtual/dmi/id/chassis_type',
|
||||
'product_name': '/sys/devices/virtual/dmi/id/product_name',
|
||||
'product_serial': '/sys/devices/virtual/dmi/id/product_serial',
|
||||
'product_uuid': '/sys/devices/virtual/dmi/id/product_uuid',
|
||||
'product_version': '/sys/devices/virtual/dmi/id/product_version',
|
||||
'system_vendor': '/sys/devices/virtual/dmi/id/sys_vendor'
|
||||
}
|
||||
|
||||
for (key,path) in DMI_DICT.items():
|
||||
data = get_file_content(path)
|
||||
|
@ -1239,15 +1239,15 @@ class LinuxHardware(Hardware):
|
|||
# Fall back to using dmidecode, if available
|
||||
dmi_bin = self.module.get_bin_path('dmidecode')
|
||||
DMI_DICT = {
|
||||
'bios_date': 'bios-release-date',
|
||||
'bios_version': 'bios-version',
|
||||
'form_factor': 'chassis-type',
|
||||
'product_name': 'system-product-name',
|
||||
'product_serial': 'system-serial-number',
|
||||
'product_uuid': 'system-uuid',
|
||||
'product_version': 'system-version',
|
||||
'system_vendor': 'system-manufacturer'
|
||||
}
|
||||
'bios_date': 'bios-release-date',
|
||||
'bios_version': 'bios-version',
|
||||
'form_factor': 'chassis-type',
|
||||
'product_name': 'system-product-name',
|
||||
'product_serial': 'system-serial-number',
|
||||
'product_uuid': 'system-uuid',
|
||||
'product_version': 'system-version',
|
||||
'system_vendor': 'system-manufacturer'
|
||||
}
|
||||
for (k, v) in DMI_DICT.items():
|
||||
if dmi_bin is not None:
|
||||
(rc, out, err) = self.module.run_command('%s -s %s' % (dmi_bin, v))
|
||||
|
|
|
@ -77,7 +77,7 @@ def _get_gcp_ansible_credentials(module):
|
|||
def _get_gcp_environ_var(var_name, default_value):
|
||||
"""Wrapper around os.environ.get call."""
|
||||
return os.environ.get(
|
||||
var_name, default_value)
|
||||
var_name, default_value)
|
||||
|
||||
def _get_gcp_environment_credentials(service_account_email, credentials_file, project_id):
|
||||
"""Helper to look in environment variables for credentials."""
|
||||
|
@ -315,7 +315,7 @@ def get_google_cloud_credentials(module, scopes=[]):
|
|||
credentials = credentials.with_scopes(scopes)
|
||||
else:
|
||||
credentials = google.auth.default(
|
||||
scopes=scopes)[0]
|
||||
scopes=scopes)[0]
|
||||
|
||||
return (credentials, conn_params)
|
||||
except Exception as e:
|
||||
|
|
|
@ -103,7 +103,7 @@ class Nxapi(NxapiConfigMixin):
|
|||
command_type = self.OUTPUT_TO_COMMAND_TYPE[output]
|
||||
except KeyError:
|
||||
msg = 'invalid format, received %s, expected one of %s' % \
|
||||
(output, ','.join(self.OUTPUT_TO_COMMAND_TYPE.keys()))
|
||||
(output, ','.join(self.OUTPUT_TO_COMMAND_TYPE.keys()))
|
||||
self._error(msg=msg)
|
||||
|
||||
if isinstance(commands, (list, set, tuple)):
|
||||
|
|
|
@ -141,7 +141,7 @@ class Rhsm(RegistrationBase):
|
|||
# Quick version...
|
||||
if False:
|
||||
return os.path.isfile('/etc/pki/consumer/cert.pem') and \
|
||||
os.path.isfile('/etc/pki/consumer/key.pem')
|
||||
os.path.isfile('/etc/pki/consumer/key.pem')
|
||||
|
||||
args = ['subscription-manager', 'identity']
|
||||
rc, stdout, stderr = self.module.run_command(args, check_rc=False)
|
||||
|
|
|
@ -698,19 +698,19 @@ def terminate_vpc(module, vpc_conn, vpc_id=None, cidr=None):
|
|||
def main():
|
||||
argument_spec = ec2_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
cidr_block = dict(),
|
||||
instance_tenancy = dict(choices=['default', 'dedicated'], default='default'),
|
||||
wait = dict(type='bool', default=False),
|
||||
wait_timeout = dict(default=300),
|
||||
dns_support = dict(type='bool', default=True),
|
||||
dns_hostnames = dict(type='bool', default=True),
|
||||
subnets = dict(type='list'),
|
||||
vpc_id = dict(),
|
||||
internet_gateway = dict(type='bool', default=False),
|
||||
resource_tags = dict(type='dict', required=True),
|
||||
route_tables = dict(type='list'),
|
||||
state = dict(choices=['present', 'absent'], default='present'),
|
||||
)
|
||||
cidr_block = dict(),
|
||||
instance_tenancy = dict(choices=['default', 'dedicated'], default='default'),
|
||||
wait = dict(type='bool', default=False),
|
||||
wait_timeout = dict(default=300),
|
||||
dns_support = dict(type='bool', default=True),
|
||||
dns_hostnames = dict(type='bool', default=True),
|
||||
subnets = dict(type='list'),
|
||||
vpc_id = dict(),
|
||||
internet_gateway = dict(type='bool', default=False),
|
||||
resource_tags = dict(type='dict', required=True),
|
||||
route_tables = dict(type='list'),
|
||||
state = dict(choices=['present', 'absent'], default='present'),
|
||||
)
|
||||
)
|
||||
|
||||
module = AnsibleModule(
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
ANSIBLE_METADATA = {
|
||||
'version': '1.0',
|
||||
'status': ['preview'],
|
||||
'supported_by': 'committer'
|
||||
'version': '1.0',
|
||||
'status': ['preview'],
|
||||
'supported_by': 'committer'
|
||||
}
|
||||
|
||||
DOCUMENTATION = '''
|
||||
|
@ -236,14 +236,14 @@ def assert_policy_shape(policy):
|
|||
def main():
|
||||
argument_spec = ansible.module_utils.ec2.ec2_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
mode = dict(choices=['grant', 'deny'], default='grant'),
|
||||
key_alias = dict(required=False, type='str'),
|
||||
key_arn = dict(required=False, type='str'),
|
||||
role_name = dict(required=False, type='str'),
|
||||
role_arn = dict(required=False, type='str'),
|
||||
grant_types = dict(required=False, type='list'),
|
||||
clean_invalid_entries = dict(type='bool', default=True),
|
||||
)
|
||||
mode = dict(choices=['grant', 'deny'], default='grant'),
|
||||
key_alias = dict(required=False, type='str'),
|
||||
key_arn = dict(required=False, type='str'),
|
||||
role_name = dict(required=False, type='str'),
|
||||
role_arn = dict(required=False, type='str'),
|
||||
grant_types = dict(required=False, type='list'),
|
||||
clean_invalid_entries = dict(type='bool', default=True),
|
||||
)
|
||||
)
|
||||
|
||||
module = AnsibleModule(
|
||||
|
|
|
@ -390,18 +390,18 @@ def get_stack_facts(cfn, stack_name):
|
|||
def main():
|
||||
argument_spec = ansible.module_utils.ec2.ec2_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
stack_name=dict(required=True),
|
||||
template_parameters=dict(required=False, type='dict', default={}),
|
||||
state=dict(default='present', choices=['present', 'absent']),
|
||||
template=dict(default=None, required=False, type='path'),
|
||||
notification_arns=dict(default=None, required=False),
|
||||
stack_policy=dict(default=None, required=False),
|
||||
disable_rollback=dict(default=False, type='bool'),
|
||||
template_url=dict(default=None, required=False),
|
||||
template_format=dict(default=None, choices=['json', 'yaml'], required=False),
|
||||
role_arn=dict(default=None, required=False),
|
||||
tags=dict(default=None, type='dict')
|
||||
)
|
||||
stack_name=dict(required=True),
|
||||
template_parameters=dict(required=False, type='dict', default={}),
|
||||
state=dict(default='present', choices=['present', 'absent']),
|
||||
template=dict(default=None, required=False, type='path'),
|
||||
notification_arns=dict(default=None, required=False),
|
||||
stack_policy=dict(default=None, required=False),
|
||||
disable_rollback=dict(default=False, type='bool'),
|
||||
template_url=dict(default=None, required=False),
|
||||
template_format=dict(default=None, choices=['json', 'yaml'], required=False),
|
||||
role_arn=dict(default=None, required=False),
|
||||
tags=dict(default=None, type='dict')
|
||||
)
|
||||
)
|
||||
|
||||
module = AnsibleModule(
|
||||
|
@ -413,7 +413,7 @@ def main():
|
|||
|
||||
# collect the parameters that are passed to boto3. Keeps us from having so many scalars floating around.
|
||||
stack_params = {
|
||||
'Capabilities': ['CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM'],
|
||||
'Capabilities': ['CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM'],
|
||||
}
|
||||
state = module.params['state']
|
||||
stack_params['StackName'] = module.params['stack_name']
|
||||
|
|
|
@ -1135,18 +1135,18 @@ def create_instances(module, ec2, vpc, override_count=None):
|
|||
if not spot_price:
|
||||
if assign_public_ip and private_ip:
|
||||
params.update(dict(
|
||||
min_count = count_remaining,
|
||||
max_count = count_remaining,
|
||||
client_token = id,
|
||||
placement_group = placement_group,
|
||||
min_count = count_remaining,
|
||||
max_count = count_remaining,
|
||||
client_token = id,
|
||||
placement_group = placement_group,
|
||||
))
|
||||
else:
|
||||
params.update(dict(
|
||||
min_count = count_remaining,
|
||||
max_count = count_remaining,
|
||||
client_token = id,
|
||||
placement_group = placement_group,
|
||||
private_ip_address = private_ip,
|
||||
min_count = count_remaining,
|
||||
max_count = count_remaining,
|
||||
client_token = id,
|
||||
placement_group = placement_group,
|
||||
private_ip_address = private_ip,
|
||||
))
|
||||
|
||||
# For ordinary (not spot) instances, we can select 'stop'
|
||||
|
@ -1537,56 +1537,56 @@ def restart_instances(module, ec2, instance_ids, state, instance_tags):
|
|||
def main():
|
||||
argument_spec = ec2_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
key_name = dict(aliases = ['keypair']),
|
||||
id = dict(),
|
||||
group = dict(type='list', aliases=['groups']),
|
||||
group_id = dict(type='list'),
|
||||
zone = dict(aliases=['aws_zone', 'ec2_zone']),
|
||||
instance_type = dict(aliases=['type']),
|
||||
spot_price = dict(),
|
||||
spot_type = dict(default='one-time', choices=["one-time", "persistent"]),
|
||||
spot_launch_group = dict(),
|
||||
image = dict(),
|
||||
kernel = dict(),
|
||||
count = dict(type='int', default='1'),
|
||||
monitoring = dict(type='bool', default=False),
|
||||
ramdisk = dict(),
|
||||
wait = dict(type='bool', default=False),
|
||||
wait_timeout = dict(default=300),
|
||||
spot_wait_timeout = dict(default=600),
|
||||
placement_group = dict(),
|
||||
user_data = dict(),
|
||||
instance_tags = dict(type='dict'),
|
||||
vpc_subnet_id = dict(),
|
||||
assign_public_ip = dict(type='bool', default=False),
|
||||
private_ip = dict(),
|
||||
instance_profile_name = dict(),
|
||||
instance_ids = dict(type='list', aliases=['instance_id']),
|
||||
source_dest_check = dict(type='bool', default=True),
|
||||
termination_protection = dict(type='bool', default=None),
|
||||
state = dict(default='present', choices=['present', 'absent', 'running', 'restarted', 'stopped']),
|
||||
instance_initiated_shutdown_behavior=dict(default=None, choices=['stop', 'terminate']),
|
||||
exact_count = dict(type='int', default=None),
|
||||
count_tag = dict(),
|
||||
volumes = dict(type='list'),
|
||||
ebs_optimized = dict(type='bool', default=False),
|
||||
tenancy = dict(default='default'),
|
||||
network_interfaces = dict(type='list', aliases=['network_interface'])
|
||||
)
|
||||
key_name = dict(aliases = ['keypair']),
|
||||
id = dict(),
|
||||
group = dict(type='list', aliases=['groups']),
|
||||
group_id = dict(type='list'),
|
||||
zone = dict(aliases=['aws_zone', 'ec2_zone']),
|
||||
instance_type = dict(aliases=['type']),
|
||||
spot_price = dict(),
|
||||
spot_type = dict(default='one-time', choices=["one-time", "persistent"]),
|
||||
spot_launch_group = dict(),
|
||||
image = dict(),
|
||||
kernel = dict(),
|
||||
count = dict(type='int', default='1'),
|
||||
monitoring = dict(type='bool', default=False),
|
||||
ramdisk = dict(),
|
||||
wait = dict(type='bool', default=False),
|
||||
wait_timeout = dict(default=300),
|
||||
spot_wait_timeout = dict(default=600),
|
||||
placement_group = dict(),
|
||||
user_data = dict(),
|
||||
instance_tags = dict(type='dict'),
|
||||
vpc_subnet_id = dict(),
|
||||
assign_public_ip = dict(type='bool', default=False),
|
||||
private_ip = dict(),
|
||||
instance_profile_name = dict(),
|
||||
instance_ids = dict(type='list', aliases=['instance_id']),
|
||||
source_dest_check = dict(type='bool', default=True),
|
||||
termination_protection = dict(type='bool', default=None),
|
||||
state = dict(default='present', choices=['present', 'absent', 'running', 'restarted', 'stopped']),
|
||||
instance_initiated_shutdown_behavior=dict(default=None, choices=['stop', 'terminate']),
|
||||
exact_count = dict(type='int', default=None),
|
||||
count_tag = dict(),
|
||||
volumes = dict(type='list'),
|
||||
ebs_optimized = dict(type='bool', default=False),
|
||||
tenancy = dict(default='default'),
|
||||
network_interfaces = dict(type='list', aliases=['network_interface'])
|
||||
)
|
||||
)
|
||||
|
||||
module = AnsibleModule(
|
||||
argument_spec=argument_spec,
|
||||
mutually_exclusive = [
|
||||
['exact_count', 'count'],
|
||||
['exact_count', 'state'],
|
||||
['exact_count', 'instance_ids'],
|
||||
['network_interfaces', 'assign_public_ip'],
|
||||
['network_interfaces', 'group'],
|
||||
['network_interfaces', 'group_id'],
|
||||
['network_interfaces', 'private_ip'],
|
||||
['network_interfaces', 'vpc_subnet_id'],
|
||||
],
|
||||
['exact_count', 'count'],
|
||||
['exact_count', 'state'],
|
||||
['exact_count', 'instance_ids'],
|
||||
['network_interfaces', 'assign_public_ip'],
|
||||
['network_interfaces', 'group'],
|
||||
['network_interfaces', 'group_id'],
|
||||
['network_interfaces', 'private_ip'],
|
||||
['network_interfaces', 'vpc_subnet_id'],
|
||||
],
|
||||
)
|
||||
|
||||
if not HAS_BOTO:
|
||||
|
|
|
@ -584,23 +584,23 @@ def update_image(module, ec2, image_id):
|
|||
def main():
|
||||
argument_spec = ec2_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
instance_id = dict(),
|
||||
image_id = dict(),
|
||||
architecture = dict(default="x86_64"),
|
||||
kernel_id = dict(),
|
||||
virtualization_type = dict(default="hvm"),
|
||||
root_device_name = dict(),
|
||||
delete_snapshot = dict(default=False, type='bool'),
|
||||
name = dict(),
|
||||
wait = dict(type='bool', default=False),
|
||||
wait_timeout = dict(default=900),
|
||||
description = dict(default=""),
|
||||
no_reboot = dict(default=False, type='bool'),
|
||||
state = dict(default='present'),
|
||||
device_mapping = dict(type='list'),
|
||||
tags = dict(type='dict'),
|
||||
launch_permissions = dict(type='dict')
|
||||
)
|
||||
instance_id = dict(),
|
||||
image_id = dict(),
|
||||
architecture = dict(default="x86_64"),
|
||||
kernel_id = dict(),
|
||||
virtualization_type = dict(default="hvm"),
|
||||
root_device_name = dict(),
|
||||
delete_snapshot = dict(default=False, type='bool'),
|
||||
name = dict(),
|
||||
wait = dict(type='bool', default=False),
|
||||
wait_timeout = dict(default=900),
|
||||
description = dict(default=""),
|
||||
no_reboot = dict(default=False, type='bool'),
|
||||
state = dict(default='present'),
|
||||
device_mapping = dict(type='list'),
|
||||
tags = dict(type='dict'),
|
||||
launch_permissions = dict(type='dict')
|
||||
)
|
||||
)
|
||||
module = AnsibleModule(argument_spec=argument_spec)
|
||||
|
||||
|
|
|
@ -173,9 +173,9 @@ def copy_image(module, ec2):
|
|||
ec2.get_waiter('image_available').wait(ImageIds=[image_id])
|
||||
if module.params.get('tags'):
|
||||
ec2.create_tags(
|
||||
Resources=[image_id],
|
||||
Tags=[{'Key' : k, 'Value': v} for k,v in module.params.get('tags').items()]
|
||||
)
|
||||
Resources=[image_id],
|
||||
Tags=[{'Key' : k, 'Value': v} for k,v in module.params.get('tags').items()]
|
||||
)
|
||||
|
||||
module.exit_json(changed=True, image_id=image_id)
|
||||
except WaiterError as we:
|
||||
|
|
|
@ -298,27 +298,27 @@ def get_block_device_mapping(image):
|
|||
def main():
|
||||
argument_spec = ec2_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
owner = dict(required=False, default=None),
|
||||
ami_id = dict(required=False),
|
||||
ami_tags = dict(required=False, type='dict',
|
||||
owner = dict(required=False, default=None),
|
||||
ami_id = dict(required=False),
|
||||
ami_tags = dict(required=False, type='dict',
|
||||
aliases = ['search_tags', 'image_tags']),
|
||||
architecture = dict(required=False),
|
||||
hypervisor = dict(required=False),
|
||||
is_public = dict(required=False, type='bool'),
|
||||
name = dict(required=False),
|
||||
platform = dict(required=False),
|
||||
sort = dict(required=False, default=None,
|
||||
architecture = dict(required=False),
|
||||
hypervisor = dict(required=False),
|
||||
is_public = dict(required=False, type='bool'),
|
||||
name = dict(required=False),
|
||||
platform = dict(required=False),
|
||||
sort = dict(required=False, default=None,
|
||||
choices=['name', 'description', 'tag', 'architecture', 'block_device_mapping', 'creationDate', 'hypervisor', 'is_public', 'location', 'owner_id', 'platform', 'root_device_name', 'root_device_type', 'state', 'virtualization_type']),
|
||||
sort_tag = dict(required=False),
|
||||
sort_order = dict(required=False, default='ascending',
|
||||
sort_tag = dict(required=False),
|
||||
sort_order = dict(required=False, default='ascending',
|
||||
choices=['ascending', 'descending']),
|
||||
sort_start = dict(required=False),
|
||||
sort_end = dict(required=False),
|
||||
state = dict(required=False, default='available'),
|
||||
virtualization_type = dict(required=False),
|
||||
no_result_action = dict(required=False, default='success',
|
||||
sort_start = dict(required=False),
|
||||
sort_end = dict(required=False),
|
||||
state = dict(required=False, default='available'),
|
||||
virtualization_type = dict(required=False),
|
||||
no_result_action = dict(required=False, default='success',
|
||||
choices = ['success', 'fail']),
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
module = AnsibleModule(
|
||||
|
|
|
@ -473,21 +473,21 @@ def create_autoscaling_group(connection, module):
|
|||
if len(launch_configs) == 0:
|
||||
module.fail_json(msg="No launch config found with name %s" % launch_config_name)
|
||||
ag = AutoScalingGroup(
|
||||
group_name=group_name,
|
||||
load_balancers=load_balancers,
|
||||
availability_zones=availability_zones,
|
||||
launch_config=launch_configs[0],
|
||||
min_size=min_size,
|
||||
max_size=max_size,
|
||||
placement_group=placement_group,
|
||||
desired_capacity=desired_capacity,
|
||||
vpc_zone_identifier=vpc_zone_identifier,
|
||||
connection=connection,
|
||||
tags=asg_tags,
|
||||
health_check_period=health_check_period,
|
||||
health_check_type=health_check_type,
|
||||
default_cooldown=default_cooldown,
|
||||
termination_policies=termination_policies)
|
||||
group_name=group_name,
|
||||
load_balancers=load_balancers,
|
||||
availability_zones=availability_zones,
|
||||
launch_config=launch_configs[0],
|
||||
min_size=min_size,
|
||||
max_size=max_size,
|
||||
placement_group=placement_group,
|
||||
desired_capacity=desired_capacity,
|
||||
vpc_zone_identifier=vpc_zone_identifier,
|
||||
connection=connection,
|
||||
tags=asg_tags,
|
||||
health_check_period=health_check_period,
|
||||
health_check_type=health_check_type,
|
||||
default_cooldown=default_cooldown,
|
||||
termination_policies=termination_policies)
|
||||
|
||||
try:
|
||||
connection.create_auto_scaling_group(ag)
|
||||
|
|
|
@ -326,13 +326,13 @@ class ElbManager:
|
|||
def main():
|
||||
argument_spec = ec2_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
state={'required': True},
|
||||
instance_id={'required': True},
|
||||
ec2_elbs={'default': None, 'required': False, 'type':'list'},
|
||||
enable_availability_zone={'default': True, 'required': False, 'type': 'bool'},
|
||||
wait={'required': False, 'default': True, 'type': 'bool'},
|
||||
wait_timeout={'required': False, 'default': 0, 'type': 'int'}
|
||||
)
|
||||
state={'required': True},
|
||||
instance_id={'required': True},
|
||||
ec2_elbs={'default': None, 'required': False, 'type':'list'},
|
||||
enable_availability_zone={'default': True, 'required': False, 'type': 'bool'},
|
||||
wait={'required': False, 'default': True, 'type': 'bool'},
|
||||
wait_timeout={'required': False, 'default': 0, 'type': 'int'}
|
||||
)
|
||||
)
|
||||
|
||||
module = AnsibleModule(
|
||||
|
|
|
@ -195,8 +195,8 @@ class ElbInformation(object):
|
|||
elb_info['instances_outofservice'] = [inst.instance_id for inst in instance_health if inst.state == 'OutOfService']
|
||||
elb_info['instances_outofservice_count'] = len(elb_info['instances_outofservice'])
|
||||
elb_info['instances_inservice_percent'] = float(elb_info['instances_inservice_count'])/(
|
||||
float(elb_info['instances_inservice_count']) +
|
||||
float(elb_info['instances_outofservice_count']))*100
|
||||
float(elb_info['instances_inservice_count']) +
|
||||
float(elb_info['instances_outofservice_count']))*100
|
||||
return elb_info
|
||||
|
||||
|
||||
|
@ -221,8 +221,8 @@ class ElbInformation(object):
|
|||
def main():
|
||||
argument_spec = ec2_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
names={'default': [], 'type': 'list'}
|
||||
)
|
||||
names={'default': [], 'type': 'list'}
|
||||
)
|
||||
)
|
||||
module = AnsibleModule(argument_spec=argument_spec,
|
||||
supports_check_mode=True)
|
||||
|
|
|
@ -650,7 +650,7 @@ class ElbManager(object):
|
|||
status_achieved = False
|
||||
|
||||
elb_interfaces = self.ec2_conn.get_all_network_interfaces(
|
||||
filters={'attachment.instance-owner-id': 'amazon-elb',
|
||||
filters={'attachment.instance-owner-id': 'amazon-elb',
|
||||
'description': 'ELB {0}'.format(self.name) })
|
||||
|
||||
for x in range(0, max_retries):
|
||||
|
@ -1227,29 +1227,29 @@ class ElbManager(object):
|
|||
def main():
|
||||
argument_spec = ec2_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
state={'required': True, 'choices': ['present', 'absent']},
|
||||
name={'required': True},
|
||||
listeners={'default': None, 'required': False, 'type': 'list'},
|
||||
purge_listeners={'default': True, 'required': False, 'type': 'bool'},
|
||||
instance_ids={'default': None, 'required': False, 'type': 'list'},
|
||||
purge_instance_ids={'default': False, 'required': False, 'type': 'bool'},
|
||||
zones={'default': None, 'required': False, 'type': 'list'},
|
||||
purge_zones={'default': False, 'required': False, 'type': 'bool'},
|
||||
security_group_ids={'default': None, 'required': False, 'type': 'list'},
|
||||
security_group_names={'default': None, 'required': False, 'type': 'list'},
|
||||
health_check={'default': None, 'required': False, 'type': 'dict'},
|
||||
subnets={'default': None, 'required': False, 'type': 'list'},
|
||||
purge_subnets={'default': False, 'required': False, 'type': 'bool'},
|
||||
scheme={'default': 'internet-facing', 'required': False},
|
||||
connection_draining_timeout={'default': None, 'required': False},
|
||||
idle_timeout={'default': None, 'required': False},
|
||||
cross_az_load_balancing={'default': None, 'required': False},
|
||||
stickiness={'default': None, 'required': False, 'type': 'dict'},
|
||||
access_logs={'default': None, 'required': False, 'type': 'dict'},
|
||||
wait={'default': False, 'type': 'bool', 'required': False},
|
||||
wait_timeout={'default': 60, 'type': 'int', 'required': False},
|
||||
tags={'default': None, 'required': False, 'type': 'dict'}
|
||||
)
|
||||
state={'required': True, 'choices': ['present', 'absent']},
|
||||
name={'required': True},
|
||||
listeners={'default': None, 'required': False, 'type': 'list'},
|
||||
purge_listeners={'default': True, 'required': False, 'type': 'bool'},
|
||||
instance_ids={'default': None, 'required': False, 'type': 'list'},
|
||||
purge_instance_ids={'default': False, 'required': False, 'type': 'bool'},
|
||||
zones={'default': None, 'required': False, 'type': 'list'},
|
||||
purge_zones={'default': False, 'required': False, 'type': 'bool'},
|
||||
security_group_ids={'default': None, 'required': False, 'type': 'list'},
|
||||
security_group_names={'default': None, 'required': False, 'type': 'list'},
|
||||
health_check={'default': None, 'required': False, 'type': 'dict'},
|
||||
subnets={'default': None, 'required': False, 'type': 'list'},
|
||||
purge_subnets={'default': False, 'required': False, 'type': 'bool'},
|
||||
scheme={'default': 'internet-facing', 'required': False},
|
||||
connection_draining_timeout={'default': None, 'required': False},
|
||||
idle_timeout={'default': None, 'required': False},
|
||||
cross_az_load_balancing={'default': None, 'required': False},
|
||||
stickiness={'default': None, 'required': False, 'type': 'dict'},
|
||||
access_logs={'default': None, 'required': False, 'type': 'dict'},
|
||||
wait={'default': False, 'type': 'bool', 'required': False},
|
||||
wait_timeout={'default': 60, 'type': 'int', 'required': False},
|
||||
tags={'default': None, 'required': False, 'type': 'dict'}
|
||||
)
|
||||
)
|
||||
|
||||
module = AnsibleModule(
|
||||
|
|
|
@ -532,12 +532,12 @@ def main():
|
|||
module = AnsibleModule(argument_spec=argument_spec,
|
||||
mutually_exclusive=[
|
||||
['secondary_private_ip_addresses', 'secondary_private_ip_address_count']
|
||||
],
|
||||
],
|
||||
required_if=([
|
||||
('state', 'present', ['subnet_id']),
|
||||
('state', 'absent', ['eni_id']),
|
||||
('attached', True, ['instance_id'])
|
||||
])
|
||||
])
|
||||
)
|
||||
|
||||
if not HAS_BOTO:
|
||||
|
|
|
@ -176,8 +176,8 @@ def main():
|
|||
argument_spec = url_argument_spec()
|
||||
|
||||
module = AnsibleModule(
|
||||
argument_spec=argument_spec,
|
||||
supports_check_mode=True,
|
||||
argument_spec=argument_spec,
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
ec2_facts = Ec2Metadata(module).run()
|
||||
|
|
|
@ -241,16 +241,16 @@ def get_target_from_rule(module, ec2, rule, name, group, groups, vpc_id):
|
|||
def main():
|
||||
argument_spec = ec2_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
name=dict(type='str', required=True),
|
||||
description=dict(type='str', required=True),
|
||||
vpc_id=dict(type='str'),
|
||||
rules=dict(type='list'),
|
||||
rules_egress=dict(type='list'),
|
||||
state = dict(default='present', type='str', choices=['present', 'absent']),
|
||||
purge_rules=dict(default=True, required=False, type='bool'),
|
||||
purge_rules_egress=dict(default=True, required=False, type='bool'),
|
||||
name=dict(type='str', required=True),
|
||||
description=dict(type='str', required=True),
|
||||
vpc_id=dict(type='str'),
|
||||
rules=dict(type='list'),
|
||||
rules_egress=dict(type='list'),
|
||||
state = dict(default='present', type='str', choices=['present', 'absent']),
|
||||
purge_rules=dict(default=True, required=False, type='bool'),
|
||||
purge_rules_egress=dict(default=True, required=False, type='bool'),
|
||||
|
||||
)
|
||||
)
|
||||
)
|
||||
module = AnsibleModule(
|
||||
argument_spec=argument_spec,
|
||||
|
@ -427,12 +427,12 @@ def main():
|
|||
|
||||
if not module.check_mode:
|
||||
ec2.authorize_security_group_egress(
|
||||
group_id=group.id,
|
||||
ip_protocol=rule['proto'],
|
||||
from_port=rule['from_port'],
|
||||
to_port=rule['to_port'],
|
||||
src_group_id=grantGroup,
|
||||
cidr_ip=thisip)
|
||||
group_id=group.id,
|
||||
ip_protocol=rule['proto'],
|
||||
from_port=rule['from_port'],
|
||||
to_port=rule['to_port'],
|
||||
src_group_id=grantGroup,
|
||||
cidr_ip=thisip)
|
||||
changed = True
|
||||
elif vpc_id:
|
||||
# when using a vpc, but no egress rules are specified,
|
||||
|
@ -462,12 +462,12 @@ def main():
|
|||
grantGroup = groups[grant.group_id].id
|
||||
if not module.check_mode:
|
||||
ec2.revoke_security_group_egress(
|
||||
group_id=group.id,
|
||||
ip_protocol=rule.ip_protocol,
|
||||
from_port=rule.from_port,
|
||||
to_port=rule.to_port,
|
||||
src_group_id=grantGroup,
|
||||
cidr_ip=grant.cidr_ip)
|
||||
group_id=group.id,
|
||||
ip_protocol=rule.ip_protocol,
|
||||
from_port=rule.from_port,
|
||||
to_port=rule.to_port,
|
||||
src_group_id=grantGroup,
|
||||
cidr_ip=grant.cidr_ip)
|
||||
changed = True
|
||||
|
||||
if group:
|
||||
|
|
|
@ -108,12 +108,12 @@ import string
|
|||
def main():
|
||||
argument_spec = ec2_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
name=dict(required=True),
|
||||
key_material=dict(required=False),
|
||||
state = dict(default='present', choices=['present', 'absent']),
|
||||
wait = dict(type='bool', default=False),
|
||||
wait_timeout = dict(default=300),
|
||||
)
|
||||
name=dict(required=True),
|
||||
key_material=dict(required=False),
|
||||
state = dict(default='present', choices=['present', 'absent']),
|
||||
wait = dict(type='bool', default=False),
|
||||
wait_timeout = dict(default=300),
|
||||
)
|
||||
)
|
||||
module = AnsibleModule(
|
||||
argument_spec=argument_spec,
|
||||
|
|
|
@ -229,7 +229,7 @@ def create_launch_config(connection, module):
|
|||
result = dict(
|
||||
((a[0], a[1]) for a in vars(launch_configs[0]).items()
|
||||
if a[0] not in ('connection', 'created_time', 'instance_monitoring', 'block_device_mappings'))
|
||||
)
|
||||
)
|
||||
result['created_time'] = str(launch_configs[0].created_time)
|
||||
# Looking at boto's launchconfig.py, it looks like this could be a boolean
|
||||
# value or an object with an enabled attribute. The enabled attribute
|
||||
|
|
|
@ -261,7 +261,7 @@ def main():
|
|||
insufficient_data_actions=dict(type='list'),
|
||||
ok_actions=dict(type='list'),
|
||||
state=dict(default='present', choices=['present', 'absent']),
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
module = AnsibleModule(argument_spec=argument_spec)
|
||||
|
|
|
@ -127,9 +127,9 @@ def get_instance_info(instance):
|
|||
'requester_id': instance.requester_id,
|
||||
'monitoring_state': instance.monitoring_state,
|
||||
'placement': {
|
||||
'tenancy': instance._placement.tenancy,
|
||||
'zone': instance._placement.zone
|
||||
},
|
||||
'tenancy': instance._placement.tenancy,
|
||||
'zone': instance._placement.zone
|
||||
},
|
||||
'ami_launch_index': instance.ami_launch_index,
|
||||
'launch_time': instance.launch_time,
|
||||
'hypervisor': instance.hypervisor,
|
||||
|
|
|
@ -130,10 +130,10 @@ except ImportError:
|
|||
def main():
|
||||
argument_spec = ec2_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
resource = dict(required=True),
|
||||
tags = dict(type='dict'),
|
||||
state = dict(default='present', choices=['present', 'absent', 'list']),
|
||||
)
|
||||
resource = dict(required=True),
|
||||
tags = dict(type='dict'),
|
||||
state = dict(default='present', choices=['present', 'absent', 'list']),
|
||||
)
|
||||
)
|
||||
module = AnsibleModule(argument_spec=argument_spec)
|
||||
|
||||
|
|
|
@ -470,23 +470,23 @@ def get_volume_info(volume, state):
|
|||
attachment = volume.attach_data
|
||||
|
||||
volume_info = {
|
||||
'create_time': volume.create_time,
|
||||
'encrypted': volume.encrypted,
|
||||
'id': volume.id,
|
||||
'iops': volume.iops,
|
||||
'size': volume.size,
|
||||
'snapshot_id': volume.snapshot_id,
|
||||
'status': volume.status,
|
||||
'type': volume.type,
|
||||
'zone': volume.zone,
|
||||
'attachment_set': {
|
||||
'attach_time': attachment.attach_time,
|
||||
'device': attachment.device,
|
||||
'instance_id': attachment.instance_id,
|
||||
'status': attachment.status
|
||||
},
|
||||
'tags': volume.tags
|
||||
}
|
||||
'create_time': volume.create_time,
|
||||
'encrypted': volume.encrypted,
|
||||
'id': volume.id,
|
||||
'iops': volume.iops,
|
||||
'size': volume.size,
|
||||
'snapshot_id': volume.snapshot_id,
|
||||
'status': volume.status,
|
||||
'type': volume.type,
|
||||
'zone': volume.zone,
|
||||
'attachment_set': {
|
||||
'attach_time': attachment.attach_time,
|
||||
'device': attachment.device,
|
||||
'instance_id': attachment.instance_id,
|
||||
'status': attachment.status
|
||||
},
|
||||
'tags': volume.tags
|
||||
}
|
||||
if hasattr(attachment, 'deleteOnTermination'):
|
||||
volume_info['attachment_set']['deleteOnTermination'] = attachment.deleteOnTermination
|
||||
|
||||
|
@ -496,20 +496,20 @@ def get_volume_info(volume, state):
|
|||
def main():
|
||||
argument_spec = ec2_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
instance = dict(),
|
||||
id = dict(),
|
||||
name = dict(),
|
||||
volume_size = dict(),
|
||||
volume_type = dict(choices=['standard', 'gp2', 'io1', 'st1', 'sc1'], default='standard'),
|
||||
iops = dict(),
|
||||
encrypted = dict(type='bool', default=False),
|
||||
kms_key_id = dict(),
|
||||
device_name = dict(),
|
||||
delete_on_termination = dict(type='bool', default=False),
|
||||
zone = dict(aliases=['availability_zone', 'aws_zone', 'ec2_zone']),
|
||||
snapshot = dict(),
|
||||
state = dict(choices=['absent', 'present', 'list'], default='present')
|
||||
)
|
||||
instance = dict(),
|
||||
id = dict(),
|
||||
name = dict(),
|
||||
volume_size = dict(),
|
||||
volume_type = dict(choices=['standard', 'gp2', 'io1', 'st1', 'sc1'], default='standard'),
|
||||
iops = dict(),
|
||||
encrypted = dict(type='bool', default=False),
|
||||
kms_key_id = dict(),
|
||||
device_name = dict(),
|
||||
delete_on_termination = dict(type='bool', default=False),
|
||||
zone = dict(aliases=['availability_zone', 'aws_zone', 'ec2_zone']),
|
||||
snapshot = dict(),
|
||||
state = dict(choices=['absent', 'present', 'list'], default='present')
|
||||
)
|
||||
)
|
||||
module = AnsibleModule(argument_spec=argument_spec)
|
||||
|
||||
|
|
|
@ -79,24 +79,24 @@ def get_volume_info(volume):
|
|||
attachment = volume.attach_data
|
||||
|
||||
volume_info = {
|
||||
'create_time': volume.create_time,
|
||||
'id': volume.id,
|
||||
'encrypted': volume.encrypted,
|
||||
'iops': volume.iops,
|
||||
'size': volume.size,
|
||||
'snapshot_id': volume.snapshot_id,
|
||||
'status': volume.status,
|
||||
'type': volume.type,
|
||||
'zone': volume.zone,
|
||||
'region': volume.region.name,
|
||||
'attachment_set': {
|
||||
'attach_time': attachment.attach_time,
|
||||
'device': attachment.device,
|
||||
'instance_id': attachment.instance_id,
|
||||
'status': attachment.status
|
||||
},
|
||||
'tags': volume.tags
|
||||
}
|
||||
'create_time': volume.create_time,
|
||||
'id': volume.id,
|
||||
'encrypted': volume.encrypted,
|
||||
'iops': volume.iops,
|
||||
'size': volume.size,
|
||||
'snapshot_id': volume.snapshot_id,
|
||||
'status': volume.status,
|
||||
'type': volume.type,
|
||||
'zone': volume.zone,
|
||||
'region': volume.region.name,
|
||||
'attachment_set': {
|
||||
'attach_time': attachment.attach_time,
|
||||
'device': attachment.device,
|
||||
'instance_id': attachment.instance_id,
|
||||
'status': attachment.status
|
||||
},
|
||||
'tags': volume.tags
|
||||
}
|
||||
|
||||
return volume_info
|
||||
|
||||
|
|
|
@ -186,16 +186,16 @@ def get_vpc_values(vpc_obj):
|
|||
def main():
|
||||
argument_spec=ec2_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
name = dict(type='str', default=None, required=True),
|
||||
cidr_block = dict(type='str', default=None, required=True),
|
||||
tenancy = dict(choices=['default', 'dedicated'], default='default'),
|
||||
dns_support = dict(type='bool', default=True),
|
||||
dns_hostnames = dict(type='bool', default=True),
|
||||
dhcp_opts_id = dict(type='str', default=None, required=False),
|
||||
tags = dict(type='dict', required=False, default=None, aliases=['resource_tags']),
|
||||
state = dict(choices=['present', 'absent'], default='present'),
|
||||
multi_ok = dict(type='bool', default=False)
|
||||
)
|
||||
name = dict(type='str', default=None, required=True),
|
||||
cidr_block = dict(type='str', default=None, required=True),
|
||||
tenancy = dict(choices=['default', 'dedicated'], default='default'),
|
||||
dns_support = dict(type='bool', default=True),
|
||||
dns_hostnames = dict(type='bool', default=True),
|
||||
dhcp_opts_id = dict(type='str', default=None, required=False),
|
||||
tags = dict(type='dict', required=False, default=None, aliases=['resource_tags']),
|
||||
state = dict(choices=['present', 'absent'], default='present'),
|
||||
multi_ok = dict(type='bool', default=False)
|
||||
)
|
||||
)
|
||||
|
||||
module = AnsibleModule(
|
||||
|
|
|
@ -150,7 +150,7 @@ def create_subnet(vpc_conn, vpc_id, cidr, az, check_mode):
|
|||
subnet = None
|
||||
else:
|
||||
raise AnsibleVPCSubnetCreationException(
|
||||
'Unable to create subnet {0}, error: {1}'.format(cidr, e))
|
||||
'Unable to create subnet {0}, error: {1}'.format(cidr, e))
|
||||
|
||||
return subnet
|
||||
|
||||
|
|
|
@ -106,12 +106,12 @@ except ImportError:
|
|||
def main():
|
||||
argument_spec = ec2_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
instance_id = dict(required=True),
|
||||
key_file = dict(required=True),
|
||||
key_passphrase = dict(no_log=True, default=None, required=False),
|
||||
wait = dict(type='bool', default=False, required=False),
|
||||
wait_timeout = dict(default=120, required=False),
|
||||
)
|
||||
instance_id = dict(required=True),
|
||||
key_file = dict(required=True),
|
||||
key_passphrase = dict(no_log=True, default=None, required=False),
|
||||
wait = dict(type='bool', default=False, required=False),
|
||||
wait_timeout = dict(default=120, required=False),
|
||||
)
|
||||
)
|
||||
module = AnsibleModule(argument_spec=argument_spec)
|
||||
|
||||
|
|
|
@ -260,7 +260,7 @@ class EcsServiceManager:
|
|||
cluster=cluster_name,
|
||||
services=[
|
||||
service_name
|
||||
])
|
||||
])
|
||||
msg = ''
|
||||
if len(response['failures'])>0:
|
||||
c = self.find_in_array(response['failures'], service_name, 'arn')
|
||||
|
|
|
@ -483,22 +483,22 @@ class ElastiCacheManager(object):
|
|||
def main():
|
||||
argument_spec = ec2_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
state ={'required': True, 'choices': ['present', 'absent', 'rebooted']},
|
||||
name ={'required': True},
|
||||
engine ={'required': False, 'default': 'memcached'},
|
||||
cache_engine_version ={'required': False},
|
||||
node_type ={'required': False, 'default': 'cache.m1.small'},
|
||||
num_nodes ={'required': False, 'default': None, 'type': 'int'},
|
||||
# alias for compat with the original PR 1950
|
||||
cache_parameter_group ={'required': False, 'default': None, 'aliases': ['parameter_group']},
|
||||
cache_port ={'required': False, 'type': 'int'},
|
||||
cache_subnet_group ={'required': False, 'default': None},
|
||||
cache_security_groups ={'required': False, 'default': [], 'type': 'list'},
|
||||
security_group_ids ={'required': False, 'default': [], 'type': 'list'},
|
||||
zone ={'required': False, 'default': None},
|
||||
wait ={'required': False, 'type' : 'bool', 'default': True},
|
||||
hard_modify ={'required': False, 'type': 'bool', 'default': False}
|
||||
)
|
||||
state ={'required': True, 'choices': ['present', 'absent', 'rebooted']},
|
||||
name ={'required': True},
|
||||
engine ={'required': False, 'default': 'memcached'},
|
||||
cache_engine_version ={'required': False},
|
||||
node_type ={'required': False, 'default': 'cache.m1.small'},
|
||||
num_nodes ={'required': False, 'default': None, 'type': 'int'},
|
||||
# alias for compat with the original PR 1950
|
||||
cache_parameter_group ={'required': False, 'default': None, 'aliases': ['parameter_group']},
|
||||
cache_port ={'required': False, 'type': 'int'},
|
||||
cache_subnet_group ={'required': False, 'default': None},
|
||||
cache_security_groups ={'required': False, 'default': [], 'type': 'list'},
|
||||
security_group_ids ={'required': False, 'default': [], 'type': 'list'},
|
||||
zone ={'required': False, 'default': None},
|
||||
wait ={'required': False, 'type' : 'bool', 'default': True},
|
||||
hard_modify ={'required': False, 'type': 'bool', 'default': False}
|
||||
)
|
||||
)
|
||||
|
||||
module = AnsibleModule(
|
||||
|
|
|
@ -80,11 +80,11 @@ except ImportError:
|
|||
def main():
|
||||
argument_spec = ec2_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
state = dict(required=True, choices=['present', 'absent']),
|
||||
name = dict(required=True),
|
||||
description = dict(required=False),
|
||||
subnets = dict(required=False, type='list'),
|
||||
)
|
||||
state = dict(required=True, choices=['present', 'absent']),
|
||||
name = dict(required=True),
|
||||
description = dict(required=False),
|
||||
subnets = dict(required=False, type='list'),
|
||||
)
|
||||
)
|
||||
module = AnsibleModule(argument_spec=argument_spec)
|
||||
|
||||
|
|
|
@ -297,9 +297,9 @@ def update_user(module, iam, name, new_name, new_path, key_state, key_count, key
|
|||
error_msg = boto_exception(err)
|
||||
if 'cannot be found' in error_msg and updated:
|
||||
current_keys, status = \
|
||||
[ck['access_key_id'] for ck in
|
||||
[ck['access_key_id'] for ck in
|
||||
iam.get_all_access_keys(new_name).list_access_keys_result.access_key_metadata],\
|
||||
[ck['status'] for ck in
|
||||
[ck['status'] for ck in
|
||||
iam.get_all_access_keys(new_name).list_access_keys_result.access_key_metadata]
|
||||
name = new_name
|
||||
else:
|
||||
|
|
|
@ -129,9 +129,9 @@ def boto_exception(err):
|
|||
|
||||
def cert_meta(iam, name):
|
||||
opath = iam.get_server_certificate(name).get_server_certificate_result.\
|
||||
server_certificate.\
|
||||
server_certificate_metadata.\
|
||||
path
|
||||
server_certificate.\
|
||||
server_certificate_metadata.\
|
||||
path
|
||||
ocert = iam.get_server_certificate(name).get_server_certificate_result.\
|
||||
server_certificate.\
|
||||
certificate_body
|
||||
|
|
|
@ -694,7 +694,7 @@ def create_db_instance(module, conn):
|
|||
try:
|
||||
result = conn.create_db_instance(instance_name, module.params.get('size'),
|
||||
module.params.get('instance_type'), module.params.get('db_engine'),
|
||||
module.params.get('username'), module.params.get('password'), **params)
|
||||
module.params.get('username'), module.params.get('password'), **params)
|
||||
changed = True
|
||||
except RDSException as e:
|
||||
module.fail_json(msg="Failed to create instance: %s" % e.message)
|
||||
|
@ -953,40 +953,40 @@ def validate_parameters(required_vars, valid_vars, module):
|
|||
|
||||
# map to convert rds module options to boto rds and rds2 options
|
||||
optional_params = {
|
||||
'port': 'port',
|
||||
'db_name': 'db_name',
|
||||
'zone': 'availability_zone',
|
||||
'maint_window': 'preferred_maintenance_window',
|
||||
'backup_window': 'preferred_backup_window',
|
||||
'backup_retention': 'backup_retention_period',
|
||||
'multi_zone': 'multi_az',
|
||||
'engine_version': 'engine_version',
|
||||
'upgrade': 'auto_minor_version_upgrade',
|
||||
'subnet': 'db_subnet_group_name',
|
||||
'license_model': 'license_model',
|
||||
'option_group': 'option_group_name',
|
||||
'size': 'allocated_storage',
|
||||
'iops': 'iops',
|
||||
'new_instance_name': 'new_instance_id',
|
||||
'apply_immediately': 'apply_immediately',
|
||||
'port': 'port',
|
||||
'db_name': 'db_name',
|
||||
'zone': 'availability_zone',
|
||||
'maint_window': 'preferred_maintenance_window',
|
||||
'backup_window': 'preferred_backup_window',
|
||||
'backup_retention': 'backup_retention_period',
|
||||
'multi_zone': 'multi_az',
|
||||
'engine_version': 'engine_version',
|
||||
'upgrade': 'auto_minor_version_upgrade',
|
||||
'subnet': 'db_subnet_group_name',
|
||||
'license_model': 'license_model',
|
||||
'option_group': 'option_group_name',
|
||||
'size': 'allocated_storage',
|
||||
'iops': 'iops',
|
||||
'new_instance_name': 'new_instance_id',
|
||||
'apply_immediately': 'apply_immediately',
|
||||
}
|
||||
# map to convert rds module options to boto rds options
|
||||
optional_params_rds = {
|
||||
'db_engine': 'engine',
|
||||
'password': 'master_password',
|
||||
'parameter_group': 'param_group',
|
||||
'instance_type': 'instance_class',
|
||||
'db_engine': 'engine',
|
||||
'password': 'master_password',
|
||||
'parameter_group': 'param_group',
|
||||
'instance_type': 'instance_class',
|
||||
}
|
||||
# map to convert rds module options to boto rds2 options
|
||||
optional_params_rds2 = {
|
||||
'tags': 'tags',
|
||||
'publicly_accessible': 'publicly_accessible',
|
||||
'parameter_group': 'db_parameter_group_name',
|
||||
'character_set_name': 'character_set_name',
|
||||
'instance_type': 'db_instance_class',
|
||||
'password': 'master_user_password',
|
||||
'new_instance_name': 'new_db_instance_identifier',
|
||||
'force_failover': 'force_failover',
|
||||
'tags': 'tags',
|
||||
'publicly_accessible': 'publicly_accessible',
|
||||
'parameter_group': 'db_parameter_group_name',
|
||||
'character_set_name': 'character_set_name',
|
||||
'instance_type': 'db_instance_class',
|
||||
'password': 'master_user_password',
|
||||
'new_instance_name': 'new_db_instance_identifier',
|
||||
'force_failover': 'force_failover',
|
||||
}
|
||||
if has_rds2:
|
||||
optional_params.update(optional_params_rds2)
|
||||
|
@ -1029,40 +1029,40 @@ def validate_parameters(required_vars, valid_vars, module):
|
|||
def main():
|
||||
argument_spec = ec2_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
command = dict(choices=['create', 'replicate', 'delete', 'facts', 'modify', 'promote', 'snapshot', 'reboot', 'restore'], required=True),
|
||||
instance_name = dict(required=False),
|
||||
source_instance = dict(required=False),
|
||||
db_engine = dict(choices=['mariadb', 'MySQL', 'oracle-se1', 'oracle-se', 'oracle-ee', 'sqlserver-ee', 'sqlserver-se', 'sqlserver-ex', 'sqlserver-web', 'postgres', 'aurora'], required=False),
|
||||
size = dict(required=False),
|
||||
instance_type = dict(aliases=['type'], required=False),
|
||||
username = dict(required=False),
|
||||
password = dict(no_log=True, required=False),
|
||||
db_name = dict(required=False),
|
||||
engine_version = dict(required=False),
|
||||
parameter_group = dict(required=False),
|
||||
license_model = dict(choices=['license-included', 'bring-your-own-license', 'general-public-license', 'postgresql-license'], required=False),
|
||||
multi_zone = dict(type='bool', default=False),
|
||||
iops = dict(required=False),
|
||||
security_groups = dict(required=False),
|
||||
vpc_security_groups = dict(type='list', required=False),
|
||||
port = dict(required=False),
|
||||
upgrade = dict(type='bool', default=False),
|
||||
option_group = dict(required=False),
|
||||
maint_window = dict(required=False),
|
||||
backup_window = dict(required=False),
|
||||
backup_retention = dict(required=False),
|
||||
zone = dict(aliases=['aws_zone', 'ec2_zone'], required=False),
|
||||
subnet = dict(required=False),
|
||||
wait = dict(type='bool', default=False),
|
||||
wait_timeout = dict(type='int', default=300),
|
||||
snapshot = dict(required=False),
|
||||
apply_immediately = dict(type='bool', default=False),
|
||||
new_instance_name = dict(required=False),
|
||||
tags = dict(type='dict', required=False),
|
||||
publicly_accessible = dict(required=False),
|
||||
character_set_name = dict(required=False),
|
||||
force_failover = dict(type='bool', required=False, default=False)
|
||||
)
|
||||
command = dict(choices=['create', 'replicate', 'delete', 'facts', 'modify', 'promote', 'snapshot', 'reboot', 'restore'], required=True),
|
||||
instance_name = dict(required=False),
|
||||
source_instance = dict(required=False),
|
||||
db_engine = dict(choices=['mariadb', 'MySQL', 'oracle-se1', 'oracle-se', 'oracle-ee', 'sqlserver-ee', 'sqlserver-se', 'sqlserver-ex', 'sqlserver-web', 'postgres', 'aurora'], required=False),
|
||||
size = dict(required=False),
|
||||
instance_type = dict(aliases=['type'], required=False),
|
||||
username = dict(required=False),
|
||||
password = dict(no_log=True, required=False),
|
||||
db_name = dict(required=False),
|
||||
engine_version = dict(required=False),
|
||||
parameter_group = dict(required=False),
|
||||
license_model = dict(choices=['license-included', 'bring-your-own-license', 'general-public-license', 'postgresql-license'], required=False),
|
||||
multi_zone = dict(type='bool', default=False),
|
||||
iops = dict(required=False),
|
||||
security_groups = dict(required=False),
|
||||
vpc_security_groups = dict(type='list', required=False),
|
||||
port = dict(required=False),
|
||||
upgrade = dict(type='bool', default=False),
|
||||
option_group = dict(required=False),
|
||||
maint_window = dict(required=False),
|
||||
backup_window = dict(required=False),
|
||||
backup_retention = dict(required=False),
|
||||
zone = dict(aliases=['aws_zone', 'ec2_zone'], required=False),
|
||||
subnet = dict(required=False),
|
||||
wait = dict(type='bool', default=False),
|
||||
wait_timeout = dict(type='int', default=300),
|
||||
snapshot = dict(required=False),
|
||||
apply_immediately = dict(type='bool', default=False),
|
||||
new_instance_name = dict(required=False),
|
||||
tags = dict(type='dict', required=False),
|
||||
publicly_accessible = dict(required=False),
|
||||
character_set_name = dict(required=False),
|
||||
force_failover = dict(type='bool', required=False, default=False)
|
||||
)
|
||||
)
|
||||
|
||||
module = AnsibleModule(
|
||||
|
@ -1073,15 +1073,15 @@ def main():
|
|||
module.fail_json(msg='boto required for this module')
|
||||
|
||||
invocations = {
|
||||
'create': create_db_instance,
|
||||
'replicate': replicate_db_instance,
|
||||
'delete': delete_db_instance_or_snapshot,
|
||||
'facts': facts_db_instance_or_snapshot,
|
||||
'modify': modify_db_instance,
|
||||
'promote': promote_db_instance,
|
||||
'snapshot': snapshot_db_instance,
|
||||
'reboot': reboot_db_instance,
|
||||
'restore': restore_db_instance,
|
||||
'create': create_db_instance,
|
||||
'replicate': replicate_db_instance,
|
||||
'delete': delete_db_instance_or_snapshot,
|
||||
'facts': facts_db_instance_or_snapshot,
|
||||
'modify': modify_db_instance,
|
||||
'promote': promote_db_instance,
|
||||
'snapshot': snapshot_db_instance,
|
||||
'reboot': reboot_db_instance,
|
||||
'restore': restore_db_instance,
|
||||
}
|
||||
|
||||
region, ec2_url, aws_connect_params = get_aws_connection_info(module)
|
||||
|
|
|
@ -219,13 +219,13 @@ def modify_group(group, params, immediate=False):
|
|||
def main():
|
||||
argument_spec = ec2_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
state = dict(required=True, choices=['present', 'absent']),
|
||||
name = dict(required=True),
|
||||
engine = dict(required=False, choices=VALID_ENGINES),
|
||||
description = dict(required=False),
|
||||
params = dict(required=False, aliases=['parameters'], type='dict'),
|
||||
immediate = dict(required=False, type='bool'),
|
||||
)
|
||||
state = dict(required=True, choices=['present', 'absent']),
|
||||
name = dict(required=True),
|
||||
engine = dict(required=False, choices=VALID_ENGINES),
|
||||
description = dict(required=False),
|
||||
params = dict(required=False, aliases=['parameters'], type='dict'),
|
||||
immediate = dict(required=False, type='bool'),
|
||||
)
|
||||
)
|
||||
module = AnsibleModule(argument_spec=argument_spec)
|
||||
|
||||
|
|
|
@ -84,11 +84,11 @@ except ImportError:
|
|||
def main():
|
||||
argument_spec = ec2_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
state = dict(required=True, choices=['present', 'absent']),
|
||||
name = dict(required=True),
|
||||
description = dict(required=False),
|
||||
subnets = dict(required=False, type='list'),
|
||||
)
|
||||
state = dict(required=True, choices=['present', 'absent']),
|
||||
name = dict(required=True),
|
||||
description = dict(required=False),
|
||||
subnets = dict(required=False, type='list'),
|
||||
)
|
||||
)
|
||||
module = AnsibleModule(argument_spec=argument_spec)
|
||||
|
||||
|
|
|
@ -410,31 +410,31 @@ def modify_cluster(module, redshift):
|
|||
def main():
|
||||
argument_spec = ec2_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
command = dict(choices=['create', 'facts', 'delete', 'modify'], required=True),
|
||||
identifier = dict(required=True),
|
||||
node_type = dict(choices=['ds1.xlarge', 'ds1.8xlarge', 'ds2.xlarge', 'ds2.8xlarge', 'dc1.large', 'dc1.8xlarge', 'dw1.xlarge', 'dw1.8xlarge', 'dw2.large', 'dw2.8xlarge'], required=False),
|
||||
username = dict(required=False),
|
||||
password = dict(no_log=True, required=False),
|
||||
db_name = dict(require=False),
|
||||
cluster_type = dict(choices=['multi-node', 'single-node', ], default='single-node'),
|
||||
cluster_security_groups = dict(aliases=['security_groups'], type='list'),
|
||||
vpc_security_group_ids = dict(aliases=['vpc_security_groups'], type='list'),
|
||||
cluster_subnet_group_name = dict(aliases=['subnet']),
|
||||
availability_zone = dict(aliases=['aws_zone', 'zone']),
|
||||
preferred_maintenance_window = dict(aliases=['maintance_window', 'maint_window']),
|
||||
cluster_parameter_group_name = dict(aliases=['param_group_name']),
|
||||
automated_snapshot_retention_period = dict(aliases=['retention_period']),
|
||||
port = dict(type='int'),
|
||||
cluster_version = dict(aliases=['version'], choices=['1.0']),
|
||||
allow_version_upgrade = dict(aliases=['version_upgrade'], type='bool', default=True),
|
||||
number_of_nodes = dict(type='int'),
|
||||
publicly_accessible = dict(type='bool', default=False),
|
||||
encrypted = dict(type='bool', default=False),
|
||||
elastic_ip = dict(required=False),
|
||||
new_cluster_identifier = dict(aliases=['new_identifier']),
|
||||
wait = dict(type='bool', default=False),
|
||||
wait_timeout = dict(default=300),
|
||||
)
|
||||
command = dict(choices=['create', 'facts', 'delete', 'modify'], required=True),
|
||||
identifier = dict(required=True),
|
||||
node_type = dict(choices=['ds1.xlarge', 'ds1.8xlarge', 'ds2.xlarge', 'ds2.8xlarge', 'dc1.large', 'dc1.8xlarge', 'dw1.xlarge', 'dw1.8xlarge', 'dw2.large', 'dw2.8xlarge'], required=False),
|
||||
username = dict(required=False),
|
||||
password = dict(no_log=True, required=False),
|
||||
db_name = dict(require=False),
|
||||
cluster_type = dict(choices=['multi-node', 'single-node', ], default='single-node'),
|
||||
cluster_security_groups = dict(aliases=['security_groups'], type='list'),
|
||||
vpc_security_group_ids = dict(aliases=['vpc_security_groups'], type='list'),
|
||||
cluster_subnet_group_name = dict(aliases=['subnet']),
|
||||
availability_zone = dict(aliases=['aws_zone', 'zone']),
|
||||
preferred_maintenance_window = dict(aliases=['maintance_window', 'maint_window']),
|
||||
cluster_parameter_group_name = dict(aliases=['param_group_name']),
|
||||
automated_snapshot_retention_period = dict(aliases=['retention_period']),
|
||||
port = dict(type='int'),
|
||||
cluster_version = dict(aliases=['version'], choices=['1.0']),
|
||||
allow_version_upgrade = dict(aliases=['version_upgrade'], type='bool', default=True),
|
||||
number_of_nodes = dict(type='int'),
|
||||
publicly_accessible = dict(type='bool', default=False),
|
||||
encrypted = dict(type='bool', default=False),
|
||||
elastic_ip = dict(required=False),
|
||||
new_cluster_identifier = dict(aliases=['new_identifier']),
|
||||
wait = dict(type='bool', default=False),
|
||||
wait_timeout = dict(default=300),
|
||||
)
|
||||
)
|
||||
|
||||
module = AnsibleModule(
|
||||
|
|
|
@ -388,28 +388,28 @@ def invoke_with_throttling_retries(function_ref, *argv):
|
|||
def main():
|
||||
argument_spec = ec2_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
command = dict(choices=['get', 'create', 'delete'], required=True),
|
||||
zone = dict(required=True),
|
||||
hosted_zone_id = dict(required=False, default=None),
|
||||
record = dict(required=True),
|
||||
ttl = dict(required=False, type='int', default=3600),
|
||||
type = dict(choices=['A', 'CNAME', 'MX', 'AAAA', 'TXT', 'PTR', 'SRV', 'SPF', 'NS', 'SOA'], required=True),
|
||||
alias = dict(required=False, type='bool'),
|
||||
alias_hosted_zone_id = dict(required=False),
|
||||
alias_evaluate_target_health = dict(required=False, type='bool', default=False),
|
||||
value = dict(required=False),
|
||||
overwrite = dict(required=False, type='bool'),
|
||||
retry_interval = dict(required=False, default=500),
|
||||
private_zone = dict(required=False, type='bool', default=False),
|
||||
identifier = dict(required=False, default=None),
|
||||
weight = dict(required=False, type='int'),
|
||||
region = dict(required=False),
|
||||
health_check = dict(required=False),
|
||||
failover = dict(required=False,choices=['PRIMARY','SECONDARY']),
|
||||
vpc_id = dict(required=False),
|
||||
wait = dict(required=False, type='bool', default=False),
|
||||
wait_timeout = dict(required=False, type='int', default=300),
|
||||
)
|
||||
command = dict(choices=['get', 'create', 'delete'], required=True),
|
||||
zone = dict(required=True),
|
||||
hosted_zone_id = dict(required=False, default=None),
|
||||
record = dict(required=True),
|
||||
ttl = dict(required=False, type='int', default=3600),
|
||||
type = dict(choices=['A', 'CNAME', 'MX', 'AAAA', 'TXT', 'PTR', 'SRV', 'SPF', 'NS', 'SOA'], required=True),
|
||||
alias = dict(required=False, type='bool'),
|
||||
alias_hosted_zone_id = dict(required=False),
|
||||
alias_evaluate_target_health = dict(required=False, type='bool', default=False),
|
||||
value = dict(required=False),
|
||||
overwrite = dict(required=False, type='bool'),
|
||||
retry_interval = dict(required=False, default=500),
|
||||
private_zone = dict(required=False, type='bool', default=False),
|
||||
identifier = dict(required=False, default=None),
|
||||
weight = dict(required=False, type='int'),
|
||||
region = dict(required=False),
|
||||
health_check = dict(required=False),
|
||||
failover = dict(required=False,choices=['PRIMARY','SECONDARY']),
|
||||
vpc_id = dict(required=False),
|
||||
wait = dict(required=False, type='bool', default=False),
|
||||
wait_timeout = dict(required=False, type='int', default=300),
|
||||
)
|
||||
)
|
||||
module = AnsibleModule(argument_spec=argument_spec)
|
||||
|
||||
|
|
|
@ -275,16 +275,16 @@ def update_health_check(conn, health_check_id, health_check_version, health_chec
|
|||
def main():
|
||||
argument_spec = ec2_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
state = dict(choices=['present', 'absent'], default='present'),
|
||||
ip_address = dict(),
|
||||
port = dict(type='int'),
|
||||
type = dict(required=True, choices=['HTTP', 'HTTPS', 'HTTP_STR_MATCH', 'HTTPS_STR_MATCH', 'TCP']),
|
||||
resource_path = dict(),
|
||||
fqdn = dict(),
|
||||
string_match = dict(),
|
||||
request_interval = dict(type='int', choices=[10, 30], default=30),
|
||||
failure_threshold = dict(type='int', choices=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], default=3),
|
||||
)
|
||||
state = dict(choices=['present', 'absent'], default='present'),
|
||||
ip_address = dict(),
|
||||
port = dict(type='int'),
|
||||
type = dict(required=True, choices=['HTTP', 'HTTPS', 'HTTP_STR_MATCH', 'HTTPS_STR_MATCH', 'TCP']),
|
||||
resource_path = dict(),
|
||||
fqdn = dict(),
|
||||
string_match = dict(),
|
||||
request_interval = dict(type='int', choices=[10, 30], default=30),
|
||||
failure_threshold = dict(type='int', choices=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], default=3),
|
||||
)
|
||||
)
|
||||
module = AnsibleModule(argument_spec=argument_spec)
|
||||
|
||||
|
|
|
@ -138,11 +138,11 @@ from ansible.module_utils.ec2 import ec2_argument_spec, get_aws_connection_info
|
|||
def main():
|
||||
argument_spec = ec2_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
zone=dict(required=True),
|
||||
state=dict(default='present', choices=['present', 'absent']),
|
||||
vpc_id=dict(default=None),
|
||||
vpc_region=dict(default=None),
|
||||
comment=dict(default='')))
|
||||
zone=dict(required=True),
|
||||
state=dict(default='present', choices=['present', 'absent']),
|
||||
vpc_id=dict(default=None),
|
||||
vpc_region=dict(default=None),
|
||||
comment=dict(default='')))
|
||||
module = AnsibleModule(argument_spec=argument_spec)
|
||||
|
||||
if not HAS_BOTO:
|
||||
|
|
|
@ -433,25 +433,25 @@ def is_walrus(s3_url):
|
|||
def main():
|
||||
argument_spec = ec2_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
bucket = dict(required=True),
|
||||
dest = dict(default=None),
|
||||
encrypt = dict(default=True, type='bool'),
|
||||
expiry = dict(default=600, aliases=['expiration']),
|
||||
headers = dict(type='dict'),
|
||||
marker = dict(default=None),
|
||||
max_keys = dict(default=1000),
|
||||
metadata = dict(type='dict'),
|
||||
mode = dict(choices=['get', 'put', 'delete', 'create', 'geturl', 'getstr', 'delobj', 'list'], required=True),
|
||||
object = dict(),
|
||||
permission = dict(type='list', default=['private']),
|
||||
version = dict(default=None),
|
||||
overwrite = dict(aliases=['force'], default='always'),
|
||||
prefix = dict(default=None),
|
||||
retries = dict(aliases=['retry'], type='int', default=0),
|
||||
s3_url = dict(aliases=['S3_URL']),
|
||||
rgw = dict(default='no', type='bool'),
|
||||
src = dict(),
|
||||
),
|
||||
bucket = dict(required=True),
|
||||
dest = dict(default=None),
|
||||
encrypt = dict(default=True, type='bool'),
|
||||
expiry = dict(default=600, aliases=['expiration']),
|
||||
headers = dict(type='dict'),
|
||||
marker = dict(default=None),
|
||||
max_keys = dict(default=1000),
|
||||
metadata = dict(type='dict'),
|
||||
mode = dict(choices=['get', 'put', 'delete', 'create', 'geturl', 'getstr', 'delobj', 'list'], required=True),
|
||||
object = dict(),
|
||||
permission = dict(type='list', default=['private']),
|
||||
version = dict(default=None),
|
||||
overwrite = dict(aliases=['force'], default='always'),
|
||||
prefix = dict(default=None),
|
||||
retries = dict(aliases=['retry'], type='int', default=0),
|
||||
s3_url = dict(aliases=['S3_URL']),
|
||||
rgw = dict(default='no', type='bool'),
|
||||
src = dict(),
|
||||
),
|
||||
)
|
||||
module = AnsibleModule(argument_spec=argument_spec)
|
||||
|
||||
|
|
|
@ -377,11 +377,11 @@ def main():
|
|||
|
||||
module = AnsibleModule(argument_spec=argument_spec,
|
||||
mutually_exclusive = [
|
||||
[ 'expiration_days', 'expiration_date' ],
|
||||
[ 'expiration_days', 'transition_date' ],
|
||||
[ 'transition_days', 'transition_date' ],
|
||||
[ 'transition_days', 'expiration_date' ]
|
||||
]
|
||||
[ 'expiration_days', 'expiration_date' ],
|
||||
[ 'expiration_days', 'transition_date' ],
|
||||
[ 'transition_days', 'transition_date' ],
|
||||
[ 'transition_days', 'expiration_date' ]
|
||||
]
|
||||
)
|
||||
|
||||
if not HAS_BOTO:
|
||||
|
|
|
@ -306,7 +306,7 @@ def gather_files(fileroot, include=None, exclude=None):
|
|||
'chopped_path':chopped_path,
|
||||
'modified_epoch': f_modified_epoch,
|
||||
'bytes': f_size
|
||||
})
|
||||
})
|
||||
# dirpath = path *to* the directory
|
||||
# dirnames = subdirs *in* our directory
|
||||
# filenames
|
||||
|
@ -428,7 +428,7 @@ def upload_files(s3, bucket, filelist, params):
|
|||
ret = []
|
||||
for entry in filelist:
|
||||
args = {
|
||||
'ContentType': entry['mime_type']
|
||||
'ContentType': entry['mime_type']
|
||||
}
|
||||
if params.get('permission'):
|
||||
args['ACL'] = params['permission']
|
||||
|
@ -440,18 +440,18 @@ def upload_files(s3, bucket, filelist, params):
|
|||
def main():
|
||||
argument_spec = ec2_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
mode = dict(choices=['push'], default='push'),
|
||||
file_change_strategy = dict(choices=['force','date_size','checksum'], default='date_size'),
|
||||
bucket = dict(required=True),
|
||||
key_prefix = dict(required=False, default=''),
|
||||
file_root = dict(required=True, type='path'),
|
||||
permission = dict(required=False, choices=['private', 'public-read', 'public-read-write', 'authenticated-read', 'aws-exec-read', 'bucket-owner-read', 'bucket-owner-full-control']),
|
||||
retries = dict(required=False),
|
||||
mime_map = dict(required=False, type='dict'),
|
||||
exclude = dict(required=False, default=".*"),
|
||||
include = dict(required=False, default="*"),
|
||||
# future options: cache_control (string or map, perhaps), encoding, metadata, storage_class, retries
|
||||
)
|
||||
mode = dict(choices=['push'], default='push'),
|
||||
file_change_strategy = dict(choices=['force','date_size','checksum'], default='date_size'),
|
||||
bucket = dict(required=True),
|
||||
key_prefix = dict(required=False, default=''),
|
||||
file_root = dict(required=True, type='path'),
|
||||
permission = dict(required=False, choices=['private', 'public-read', 'public-read-write', 'authenticated-read', 'aws-exec-read', 'bucket-owner-read', 'bucket-owner-full-control']),
|
||||
retries = dict(required=False),
|
||||
mime_map = dict(required=False, type='dict'),
|
||||
exclude = dict(required=False, default=".*"),
|
||||
include = dict(required=False, default="*"),
|
||||
# future options: cache_control (string or map, perhaps), encoding, metadata, storage_class, retries
|
||||
)
|
||||
)
|
||||
|
||||
module = AnsibleModule(
|
||||
|
|
|
@ -267,9 +267,9 @@ def main():
|
|||
module = AnsibleModule(
|
||||
argument_spec=argument_spec,
|
||||
mutually_exclusive = [
|
||||
['redirect_all_requests', 'suffix'],
|
||||
['redirect_all_requests', 'error_key']
|
||||
])
|
||||
['redirect_all_requests', 'suffix'],
|
||||
['redirect_all_requests', 'error_key']
|
||||
])
|
||||
|
||||
if not HAS_BOTO3:
|
||||
module.fail_json(msg='boto3 required for this module')
|
||||
|
|
|
@ -89,10 +89,10 @@ def core(module):
|
|||
|
||||
def main():
|
||||
module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
revision = dict(default='latest', required=False, aliases=["version"]),
|
||||
),
|
||||
)
|
||||
argument_spec = dict(
|
||||
revision = dict(default='latest', required=False, aliases=["version"]),
|
||||
),
|
||||
)
|
||||
|
||||
# Verify that the platform is atomic host
|
||||
if not os.path.exists("/run/ostree-booted"):
|
||||
|
|
|
@ -119,12 +119,12 @@ def core(module):
|
|||
|
||||
def main():
|
||||
module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
name = dict(default=None, required=True),
|
||||
state = dict(default='latest', choices=['present', 'absent', 'latest']),
|
||||
started = dict(default='yes', type='bool'),
|
||||
),
|
||||
)
|
||||
argument_spec = dict(
|
||||
name = dict(default=None, required=True),
|
||||
state = dict(default='latest', choices=['present', 'absent', 'latest']),
|
||||
started = dict(default='yes', type='bool'),
|
||||
),
|
||||
)
|
||||
|
||||
# Verify that the platform supports atomic command
|
||||
rc, out, err = module.run_command('atomic -v', check_rc=False)
|
||||
|
|
|
@ -299,9 +299,9 @@ class AnsibleCloudStackFirewall(AnsibleCloudStack):
|
|||
|
||||
def _icmp_match(self, rule, protocol, icmp_code, icmp_type):
|
||||
return protocol == 'icmp' \
|
||||
and protocol == rule['protocol'] \
|
||||
and icmp_code == rule['icmpcode'] \
|
||||
and icmp_type == rule['icmptype']
|
||||
and protocol == rule['protocol'] \
|
||||
and icmp_code == rule['icmpcode'] \
|
||||
and icmp_type == rule['icmptype']
|
||||
|
||||
|
||||
def _type_cidr_match(self, rule, cidr):
|
||||
|
|
|
@ -206,27 +206,27 @@ class AnsibleCloudStackSecurityGroupRule(AnsibleCloudStack):
|
|||
|
||||
def _tcp_udp_match(self, rule, protocol, start_port, end_port):
|
||||
return protocol in ['tcp', 'udp'] \
|
||||
and protocol == rule['protocol'] \
|
||||
and start_port == int(rule['startport']) \
|
||||
and end_port == int(rule['endport'])
|
||||
and protocol == rule['protocol'] \
|
||||
and start_port == int(rule['startport']) \
|
||||
and end_port == int(rule['endport'])
|
||||
|
||||
|
||||
def _icmp_match(self, rule, protocol, icmp_code, icmp_type):
|
||||
return protocol == 'icmp' \
|
||||
and protocol == rule['protocol'] \
|
||||
and icmp_code == int(rule['icmpcode']) \
|
||||
and icmp_type == int(rule['icmptype'])
|
||||
and protocol == rule['protocol'] \
|
||||
and icmp_code == int(rule['icmpcode']) \
|
||||
and icmp_type == int(rule['icmptype'])
|
||||
|
||||
|
||||
def _ah_esp_gre_match(self, rule, protocol):
|
||||
return protocol in ['ah', 'esp', 'gre'] \
|
||||
and protocol == rule['protocol']
|
||||
and protocol == rule['protocol']
|
||||
|
||||
|
||||
def _type_security_group_match(self, rule, security_group_name):
|
||||
return security_group_name \
|
||||
and 'securitygroupname' in rule \
|
||||
and security_group_name == rule['securitygroupname']
|
||||
and 'securitygroupname' in rule \
|
||||
and security_group_name == rule['securitygroupname']
|
||||
|
||||
|
||||
def _type_cidr_match(self, rule, cidr):
|
||||
|
|
|
@ -682,26 +682,26 @@ class DockerManager(object):
|
|||
# docker-py version is a tuple of ints because we have to compare them
|
||||
# server APIVersion is passed to a docker-py function that takes strings
|
||||
_cap_ver_req = {
|
||||
'devices': ((0, 7, 0), '1.2'),
|
||||
'dns': ((0, 3, 0), '1.10'),
|
||||
'volumes_from': ((0, 3, 0), '1.10'),
|
||||
'restart_policy': ((0, 5, 0), '1.14'),
|
||||
'extra_hosts': ((0, 7, 0), '1.3.1'),
|
||||
'pid': ((1, 0, 0), '1.17'),
|
||||
'log_driver': ((1, 2, 0), '1.18'),
|
||||
'log_opt': ((1, 2, 0), '1.18'),
|
||||
'host_config': ((0, 7, 0), '1.15'),
|
||||
'cpu_set': ((0, 6, 0), '1.14'),
|
||||
'cap_add': ((0, 5, 0), '1.14'),
|
||||
'cap_drop': ((0, 5, 0), '1.14'),
|
||||
'read_only': ((1, 0, 0), '1.17'),
|
||||
'labels': ((1, 2, 0), '1.18'),
|
||||
'stop_timeout': ((0, 5, 0), '1.0'),
|
||||
'ulimits': ((1, 2, 0), '1.18'),
|
||||
# Clientside only
|
||||
'insecure_registry': ((0, 5, 0), '0.0'),
|
||||
'env_file': ((1, 4, 0), '0.0')
|
||||
}
|
||||
'devices': ((0, 7, 0), '1.2'),
|
||||
'dns': ((0, 3, 0), '1.10'),
|
||||
'volumes_from': ((0, 3, 0), '1.10'),
|
||||
'restart_policy': ((0, 5, 0), '1.14'),
|
||||
'extra_hosts': ((0, 7, 0), '1.3.1'),
|
||||
'pid': ((1, 0, 0), '1.17'),
|
||||
'log_driver': ((1, 2, 0), '1.18'),
|
||||
'log_opt': ((1, 2, 0), '1.18'),
|
||||
'host_config': ((0, 7, 0), '1.15'),
|
||||
'cpu_set': ((0, 6, 0), '1.14'),
|
||||
'cap_add': ((0, 5, 0), '1.14'),
|
||||
'cap_drop': ((0, 5, 0), '1.14'),
|
||||
'read_only': ((1, 0, 0), '1.17'),
|
||||
'labels': ((1, 2, 0), '1.18'),
|
||||
'stop_timeout': ((0, 5, 0), '1.0'),
|
||||
'ulimits': ((1, 2, 0), '1.18'),
|
||||
# Clientside only
|
||||
'insecure_registry': ((0, 5, 0), '0.0'),
|
||||
'env_file': ((1, 4, 0), '0.0')
|
||||
}
|
||||
|
||||
def __init__(self, module):
|
||||
self.module = module
|
||||
|
|
|
@ -1475,10 +1475,10 @@ class Container(DockerBaseClass):
|
|||
else:
|
||||
expected_devices.append(
|
||||
dict(
|
||||
CgroupPermissions=parts[2],
|
||||
PathInContainer=parts[1],
|
||||
PathOnHost=parts[0]
|
||||
))
|
||||
CgroupPermissions=parts[2],
|
||||
PathInContainer=parts[1],
|
||||
PathOnHost=parts[0]
|
||||
))
|
||||
return expected_devices
|
||||
|
||||
def _get_expected_entrypoint(self):
|
||||
|
|
|
@ -225,7 +225,7 @@ def main():
|
|||
try:
|
||||
gcelb = get_driver_lb(Provider_lb.GCE)(gce_driver=gce)
|
||||
gcelb.connection.user_agent_append("%s/%s" % (
|
||||
USER_AGENT_PRODUCT, USER_AGENT_VERSION))
|
||||
USER_AGENT_PRODUCT, USER_AGENT_VERSION))
|
||||
except Exception as e:
|
||||
module.fail_json(msg=unexpected_error_msg(e), changed=False)
|
||||
|
||||
|
|
|
@ -829,7 +829,7 @@ def main():
|
|||
if not autoscaler:
|
||||
module.fail_json(msg='Unable to fetch autoscaler %s to delete \
|
||||
in zone: %s' % (params['autoscaling']['name'], params['zone']),
|
||||
changed=False)
|
||||
changed=False)
|
||||
|
||||
changed = delete_autoscaler(autoscaler)
|
||||
json_output['deleted_autoscaler'] = changed
|
||||
|
|
|
@ -254,7 +254,7 @@ def main():
|
|||
|
||||
if instance_name and inst is None:
|
||||
module.fail_json(msg='Instance %s does not exist in zone %s' % (
|
||||
instance_name, zone), changed=False)
|
||||
instance_name, zone), changed=False)
|
||||
|
||||
if not disk:
|
||||
if image is not None and snapshot is not None:
|
||||
|
|
|
@ -182,10 +182,10 @@ def main():
|
|||
project_id=dict(),
|
||||
),
|
||||
mutually_exclusive=[
|
||||
[ 'instance_name', 'instance_pattern' ]
|
||||
[ 'instance_name', 'instance_pattern' ]
|
||||
],
|
||||
required_one_of=[
|
||||
[ 'instance_name', 'instance_pattern' ]
|
||||
[ 'instance_name', 'instance_pattern' ]
|
||||
]
|
||||
)
|
||||
|
||||
|
|
|
@ -226,17 +226,17 @@ def pull_messages(pull_params, sub):
|
|||
def main():
|
||||
|
||||
module = AnsibleModule(argument_spec=dict(
|
||||
topic=dict(required=True),
|
||||
state=dict(choices=['absent', 'present'], default='present'),
|
||||
publish=dict(type='list', default=None),
|
||||
subscription=dict(type='dict', default=None),
|
||||
service_account_email=dict(),
|
||||
credentials_file=dict(),
|
||||
project_id=dict(), ),)
|
||||
topic=dict(required=True),
|
||||
state=dict(choices=['absent', 'present'], default='present'),
|
||||
publish=dict(type='list', default=None),
|
||||
subscription=dict(type='dict', default=None),
|
||||
service_account_email=dict(),
|
||||
credentials_file=dict(),
|
||||
project_id=dict(), ),)
|
||||
|
||||
if not HAS_PYTHON26:
|
||||
module.fail_json(
|
||||
msg="GCE module requires python's 'ast' module, python v2.6+")
|
||||
msg="GCE module requires python's 'ast' module, python v2.6+")
|
||||
|
||||
if not HAS_GOOGLE_CLOUD_PUBSUB:
|
||||
module.fail_json(msg="Please install google-cloud-pubsub library.")
|
||||
|
@ -307,7 +307,7 @@ def main():
|
|||
if s.push_endpoint is not None:
|
||||
module.fail_json(msg="Cannot pull messages, push_endpoint is configured.")
|
||||
(json_output['pulled_messages'], changed) = pull_messages(
|
||||
mod_params['subscription']['pull'], s)
|
||||
mod_params['subscription']['pull'], s)
|
||||
|
||||
# publish messages to the topic
|
||||
if mod_params['publish'] and len(mod_params['publish']) > 0:
|
||||
|
|
|
@ -102,16 +102,16 @@ def list_func(data, member='name'):
|
|||
|
||||
def main():
|
||||
module = AnsibleModule(argument_spec=dict(
|
||||
view=dict(choices=['topics', 'subscriptions'], default='topics'),
|
||||
topic=dict(required=False),
|
||||
state=dict(choices=['list'], default='list'),
|
||||
service_account_email=dict(),
|
||||
credentials_file=dict(),
|
||||
project_id=dict(), ),)
|
||||
view=dict(choices=['topics', 'subscriptions'], default='topics'),
|
||||
topic=dict(required=False),
|
||||
state=dict(choices=['list'], default='list'),
|
||||
service_account_email=dict(),
|
||||
credentials_file=dict(),
|
||||
project_id=dict(), ),)
|
||||
|
||||
if not HAS_PYTHON26:
|
||||
module.fail_json(
|
||||
msg="GCE module requires python's 'ast' module, python v2.6+")
|
||||
msg="GCE module requires python's 'ast' module, python v2.6+")
|
||||
|
||||
if not HAS_GOOGLE_CLOUD_PUBSUB:
|
||||
module.fail_json(msg="Please install google-cloud-pubsub library.")
|
||||
|
|
|
@ -282,13 +282,13 @@ def linodeServers(module, api, state, name, plan, distribution, datacenter, lino
|
|||
size = servers[0]['TOTALHD'] - swap
|
||||
if ssh_pub_key:
|
||||
res = api.linode_disk_createfromdistribution(
|
||||
LinodeId=linode_id, DistributionID=distribution,
|
||||
rootPass=password, rootSSHKey=ssh_pub_key,
|
||||
Label='%s data disk (lid: %s)' % (name, linode_id), Size=size)
|
||||
LinodeId=linode_id, DistributionID=distribution,
|
||||
rootPass=password, rootSSHKey=ssh_pub_key,
|
||||
Label='%s data disk (lid: %s)' % (name, linode_id), Size=size)
|
||||
else:
|
||||
res = api.linode_disk_createfromdistribution(
|
||||
LinodeId=linode_id, DistributionID=distribution, rootPass=password,
|
||||
Label='%s data disk (lid: %s)' % (name, linode_id), Size=size)
|
||||
LinodeId=linode_id, DistributionID=distribution, rootPass=password,
|
||||
Label='%s data disk (lid: %s)' % (name, linode_id), Size=size)
|
||||
jobs.append(res['JobID'])
|
||||
# Create SWAP disk
|
||||
res = api.linode_disk_create(LinodeId=linode_id, Type='swap',
|
||||
|
|
|
@ -402,33 +402,33 @@ def umount_instance(module, proxmox, vm, vmid, timeout):
|
|||
|
||||
def main():
|
||||
module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
api_host = dict(required=True),
|
||||
api_user = dict(required=True),
|
||||
api_password = dict(no_log=True),
|
||||
vmid = dict(required=False),
|
||||
validate_certs = dict(type='bool', default='no'),
|
||||
node = dict(),
|
||||
pool = dict(),
|
||||
password = dict(no_log=True),
|
||||
hostname = dict(),
|
||||
ostemplate = dict(),
|
||||
disk = dict(type='str', default='3'),
|
||||
cpus = dict(type='int', default=1),
|
||||
memory = dict(type='int', default=512),
|
||||
swap = dict(type='int', default=0),
|
||||
netif = dict(type='dict'),
|
||||
mounts = dict(type='dict'),
|
||||
ip_address = dict(),
|
||||
onboot = dict(type='bool', default='no'),
|
||||
storage = dict(default='local'),
|
||||
cpuunits = dict(type='int', default=1000),
|
||||
nameserver = dict(),
|
||||
searchdomain = dict(),
|
||||
timeout = dict(type='int', default=30),
|
||||
force = dict(type='bool', default='no'),
|
||||
state = dict(default='present', choices=['present', 'absent', 'stopped', 'started', 'restarted']),
|
||||
)
|
||||
argument_spec = dict(
|
||||
api_host = dict(required=True),
|
||||
api_user = dict(required=True),
|
||||
api_password = dict(no_log=True),
|
||||
vmid = dict(required=False),
|
||||
validate_certs = dict(type='bool', default='no'),
|
||||
node = dict(),
|
||||
pool = dict(),
|
||||
password = dict(no_log=True),
|
||||
hostname = dict(),
|
||||
ostemplate = dict(),
|
||||
disk = dict(type='str', default='3'),
|
||||
cpus = dict(type='int', default=1),
|
||||
memory = dict(type='int', default=512),
|
||||
swap = dict(type='int', default=0),
|
||||
netif = dict(type='dict'),
|
||||
mounts = dict(type='dict'),
|
||||
ip_address = dict(),
|
||||
onboot = dict(type='bool', default='no'),
|
||||
storage = dict(default='local'),
|
||||
cpuunits = dict(type='int', default=1000),
|
||||
nameserver = dict(),
|
||||
searchdomain = dict(),
|
||||
timeout = dict(type='int', default=30),
|
||||
force = dict(type='bool', default='no'),
|
||||
state = dict(default='present', choices=['present', 'absent', 'stopped', 'started', 'restarted']),
|
||||
)
|
||||
)
|
||||
|
||||
if not HAS_PROXMOXER:
|
||||
|
|
|
@ -795,71 +795,71 @@ def stop_vm(module, proxmox, vm, vmid, timeout, force):
|
|||
|
||||
def main():
|
||||
module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
acpi = dict(type='bool', default='yes'),
|
||||
agent = dict(type='bool'),
|
||||
args = dict(type='str', default=None),
|
||||
api_host = dict(required=True),
|
||||
api_user = dict(required=True),
|
||||
api_password = dict(no_log=True),
|
||||
autostart = dict(type='bool', default='no'),
|
||||
balloon = dict(type='int',default=0),
|
||||
bios = dict(choices=['seabios', 'ovmf']),
|
||||
boot = dict(type='str', default='cnd'),
|
||||
bootdisk = dict(type='str'),
|
||||
cores = dict(type='int', default=1),
|
||||
cpu = dict(type='str', default='kvm64'),
|
||||
cpulimit = dict(type='int'),
|
||||
cpuunits = dict(type='int', default=1000),
|
||||
delete = dict(type='str'),
|
||||
description = dict(type='str'),
|
||||
digest = dict(type='str'),
|
||||
force = dict(type='bool', default=None),
|
||||
freeze = dict(type='bool'),
|
||||
hostpci = dict(type='dict'),
|
||||
hotplug = dict(type='str'),
|
||||
hugepages = dict(choices=['any', '2', '1024']),
|
||||
ide = dict(type='dict', default=None),
|
||||
keyboard = dict(type='str'),
|
||||
kvm = dict(type='bool', default='yes'),
|
||||
localtime = dict(type='bool'),
|
||||
lock = dict(choices=['migrate', 'backup', 'snapshot', 'rollback']),
|
||||
machine = dict(type='str'),
|
||||
memory = dict(type='int', default=512),
|
||||
migrate_downtime = dict(type='int'),
|
||||
migrate_speed = dict(type='int'),
|
||||
name = dict(type='str'),
|
||||
net = dict(type='dict'),
|
||||
node = dict(),
|
||||
numa = dict(type='dict'),
|
||||
onboot = dict(type='bool', default='yes'),
|
||||
ostype = dict(default='l26', choices=['other', 'wxp', 'w2k', 'w2k3', 'w2k8', 'wvista', 'win7', 'win8', 'l24', 'l26', 'solaris']),
|
||||
parallel = dict(type='dict'),
|
||||
protection = dict(type='bool'),
|
||||
reboot = dict(type='bool'),
|
||||
revert = dict(),
|
||||
sata = dict(type='dict'),
|
||||
scsi = dict(type='dict'),
|
||||
scsihw = dict(choices=['lsi', 'lsi53c810', 'virtio-scsi-pci', 'virtio-scsi-single', 'megasas', 'pvscsi']),
|
||||
serial = dict(type='dict'),
|
||||
shares = dict(type='int'),
|
||||
skiplock = dict(type='bool'),
|
||||
smbios = dict(type='str'),
|
||||
sockets = dict(type='int', default=1),
|
||||
startdate = dict(type='str'),
|
||||
startup = dict(),
|
||||
state = dict(default='present', choices=['present', 'absent', 'stopped', 'started', 'restarted', 'current']),
|
||||
tablet = dict(type='bool', default='no'),
|
||||
tdf = dict(type='bool'),
|
||||
template = dict(type='bool', default='no'),
|
||||
timeout = dict(type='int', default=30),
|
||||
validate_certs = dict(type='bool', default='no'),
|
||||
vcpus = dict(type='int', default=None),
|
||||
vga = dict(default='std', choices=['std', 'cirrus', 'vmware', 'qxl', 'serial0', 'serial1', 'serial2', 'serial3', 'qxl2', 'qxl3', 'qxl4']),
|
||||
virtio = dict(type='dict', default=None),
|
||||
vmid = dict(type='int', default=None),
|
||||
watchdog = dict(),
|
||||
)
|
||||
argument_spec = dict(
|
||||
acpi = dict(type='bool', default='yes'),
|
||||
agent = dict(type='bool'),
|
||||
args = dict(type='str', default=None),
|
||||
api_host = dict(required=True),
|
||||
api_user = dict(required=True),
|
||||
api_password = dict(no_log=True),
|
||||
autostart = dict(type='bool', default='no'),
|
||||
balloon = dict(type='int',default=0),
|
||||
bios = dict(choices=['seabios', 'ovmf']),
|
||||
boot = dict(type='str', default='cnd'),
|
||||
bootdisk = dict(type='str'),
|
||||
cores = dict(type='int', default=1),
|
||||
cpu = dict(type='str', default='kvm64'),
|
||||
cpulimit = dict(type='int'),
|
||||
cpuunits = dict(type='int', default=1000),
|
||||
delete = dict(type='str'),
|
||||
description = dict(type='str'),
|
||||
digest = dict(type='str'),
|
||||
force = dict(type='bool', default=None),
|
||||
freeze = dict(type='bool'),
|
||||
hostpci = dict(type='dict'),
|
||||
hotplug = dict(type='str'),
|
||||
hugepages = dict(choices=['any', '2', '1024']),
|
||||
ide = dict(type='dict', default=None),
|
||||
keyboard = dict(type='str'),
|
||||
kvm = dict(type='bool', default='yes'),
|
||||
localtime = dict(type='bool'),
|
||||
lock = dict(choices=['migrate', 'backup', 'snapshot', 'rollback']),
|
||||
machine = dict(type='str'),
|
||||
memory = dict(type='int', default=512),
|
||||
migrate_downtime = dict(type='int'),
|
||||
migrate_speed = dict(type='int'),
|
||||
name = dict(type='str'),
|
||||
net = dict(type='dict'),
|
||||
node = dict(),
|
||||
numa = dict(type='dict'),
|
||||
onboot = dict(type='bool', default='yes'),
|
||||
ostype = dict(default='l26', choices=['other', 'wxp', 'w2k', 'w2k3', 'w2k8', 'wvista', 'win7', 'win8', 'l24', 'l26', 'solaris']),
|
||||
parallel = dict(type='dict'),
|
||||
protection = dict(type='bool'),
|
||||
reboot = dict(type='bool'),
|
||||
revert = dict(),
|
||||
sata = dict(type='dict'),
|
||||
scsi = dict(type='dict'),
|
||||
scsihw = dict(choices=['lsi', 'lsi53c810', 'virtio-scsi-pci', 'virtio-scsi-single', 'megasas', 'pvscsi']),
|
||||
serial = dict(type='dict'),
|
||||
shares = dict(type='int'),
|
||||
skiplock = dict(type='bool'),
|
||||
smbios = dict(type='str'),
|
||||
sockets = dict(type='int', default=1),
|
||||
startdate = dict(type='str'),
|
||||
startup = dict(),
|
||||
state = dict(default='present', choices=['present', 'absent', 'stopped', 'started', 'restarted', 'current']),
|
||||
tablet = dict(type='bool', default='no'),
|
||||
tdf = dict(type='bool'),
|
||||
template = dict(type='bool', default='no'),
|
||||
timeout = dict(type='int', default=30),
|
||||
validate_certs = dict(type='bool', default='no'),
|
||||
vcpus = dict(type='int', default=None),
|
||||
vga = dict(default='std', choices=['std', 'cirrus', 'vmware', 'qxl', 'serial0', 'serial1', 'serial2', 'serial3', 'qxl2', 'qxl3', 'qxl4']),
|
||||
virtio = dict(type='dict', default=None),
|
||||
vmid = dict(type='int', default=None),
|
||||
watchdog = dict(),
|
||||
)
|
||||
)
|
||||
|
||||
if not HAS_PROXMOXER:
|
||||
|
|
|
@ -179,20 +179,20 @@ def delete_template(module, proxmox, node, storage, content_type, template, time
|
|||
|
||||
def main():
|
||||
module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
api_host = dict(required=True),
|
||||
api_user = dict(required=True),
|
||||
api_password = dict(no_log=True),
|
||||
validate_certs = dict(type='bool', default='no'),
|
||||
node = dict(),
|
||||
src = dict(),
|
||||
template = dict(),
|
||||
content_type = dict(default='vztmpl', choices=['vztmpl','iso']),
|
||||
storage = dict(default='local'),
|
||||
timeout = dict(type='int', default=30),
|
||||
force = dict(type='bool', default='no'),
|
||||
state = dict(default='present', choices=['present', 'absent']),
|
||||
)
|
||||
argument_spec = dict(
|
||||
api_host = dict(required=True),
|
||||
api_user = dict(required=True),
|
||||
api_password = dict(no_log=True),
|
||||
validate_certs = dict(type='bool', default='no'),
|
||||
node = dict(),
|
||||
src = dict(),
|
||||
template = dict(),
|
||||
content_type = dict(default='vztmpl', choices=['vztmpl','iso']),
|
||||
storage = dict(default='local'),
|
||||
timeout = dict(type='int', default=30),
|
||||
force = dict(type='bool', default='no'),
|
||||
state = dict(default='present', choices=['present', 'absent']),
|
||||
)
|
||||
)
|
||||
|
||||
if not HAS_PROXMOXER:
|
||||
|
|
|
@ -132,13 +132,13 @@ ALL_COMMANDS.extend(VM_COMMANDS)
|
|||
ALL_COMMANDS.extend(HOST_COMMANDS)
|
||||
|
||||
VIRT_STATE_NAME_MAP = {
|
||||
0 : "running",
|
||||
1 : "running",
|
||||
2 : "running",
|
||||
3 : "paused",
|
||||
4 : "shutdown",
|
||||
5 : "shutdown",
|
||||
6 : "crashed"
|
||||
0 : "running",
|
||||
1 : "running",
|
||||
2 : "running",
|
||||
3 : "paused",
|
||||
4 : "shutdown",
|
||||
5 : "shutdown",
|
||||
6 : "crashed"
|
||||
}
|
||||
|
||||
class VMNotFound(Exception):
|
||||
|
|
|
@ -173,7 +173,7 @@ def _get_glance_client(module, kwargs):
|
|||
token = _ksclient.auth_token
|
||||
endpoint =_get_endpoint(module, _ksclient, kwargs.get('endpoint_type'))
|
||||
kwargs = {
|
||||
'token': token,
|
||||
'token': token,
|
||||
}
|
||||
try:
|
||||
client = glanceclient.Client('1', endpoint, **kwargs)
|
||||
|
@ -194,12 +194,12 @@ def _glance_image_present(module, params, client):
|
|||
|
||||
def _glance_image_create(module, params, client):
|
||||
kwargs = {
|
||||
'name': params.get('name'),
|
||||
'disk_format': params.get('disk_format'),
|
||||
'container_format': params.get('container_format'),
|
||||
'owner': params.get('owner'),
|
||||
'is_public': params.get('is_public'),
|
||||
'copy_from': params.get('copy_from'),
|
||||
'name': params.get('name'),
|
||||
'disk_format': params.get('disk_format'),
|
||||
'container_format': params.get('container_format'),
|
||||
'owner': params.get('owner'),
|
||||
'is_public': params.get('is_public'),
|
||||
'copy_from': params.get('copy_from'),
|
||||
}
|
||||
try:
|
||||
timeout = float(params.get('timeout'))
|
||||
|
|
|
@ -332,19 +332,19 @@ def main():
|
|||
|
||||
argument_spec = openstack_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
tenant_description=dict(required=False),
|
||||
email=dict(required=False),
|
||||
user=dict(required=False),
|
||||
tenant=dict(required=False),
|
||||
password=dict(required=False),
|
||||
role=dict(required=False),
|
||||
state=dict(default='present', choices=['present', 'absent']),
|
||||
endpoint=dict(required=False,
|
||||
tenant_description=dict(required=False),
|
||||
email=dict(required=False),
|
||||
user=dict(required=False),
|
||||
tenant=dict(required=False),
|
||||
password=dict(required=False),
|
||||
role=dict(required=False),
|
||||
state=dict(default='present', choices=['present', 'absent']),
|
||||
endpoint=dict(required=False,
|
||||
default="http://127.0.0.1:35357/v2.0"),
|
||||
token=dict(required=False),
|
||||
login_user=dict(required=False),
|
||||
login_password=dict(required=False),
|
||||
login_tenant_name=dict(required=False)
|
||||
token=dict(required=False),
|
||||
login_user=dict(required=False),
|
||||
login_password=dict(required=False),
|
||||
login_tenant_name=dict(required=False)
|
||||
))
|
||||
# keystone operations themselves take an endpoint, not a keystone auth_url
|
||||
del(argument_spec['auth_url'])
|
||||
|
|
|
@ -428,12 +428,12 @@ def _create_server(module, nova):
|
|||
flavor_id = _get_flavor_id(module, nova)
|
||||
bootargs = [module.params['name'], image_id, flavor_id]
|
||||
bootkwargs = {
|
||||
'nics' : module.params['nics'],
|
||||
'meta' : module.params['meta'],
|
||||
'security_groups': module.params['security_groups'].split(','),
|
||||
#userdata is unhyphenated in novaclient, but hyphenated here for consistency with the ec2 module:
|
||||
'userdata': module.params['user_data'],
|
||||
'config_drive': module.params['config_drive'],
|
||||
'nics' : module.params['nics'],
|
||||
'meta' : module.params['meta'],
|
||||
'security_groups': module.params['security_groups'].split(','),
|
||||
#userdata is unhyphenated in novaclient, but hyphenated here for consistency with the ec2 module:
|
||||
'userdata': module.params['user_data'],
|
||||
'config_drive': module.params['config_drive'],
|
||||
}
|
||||
|
||||
for optional_param in ('region_name', 'key_name', 'availability_zone', 'scheduler_hints'):
|
||||
|
|
|
@ -136,8 +136,8 @@ def _get_neutron_client(module, kwargs):
|
|||
token = _ksclient.auth_token
|
||||
endpoint = _get_endpoint(module, _ksclient)
|
||||
kwargs = {
|
||||
'token': token,
|
||||
'endpoint_url': endpoint
|
||||
'token': token,
|
||||
'endpoint_url': endpoint
|
||||
}
|
||||
try:
|
||||
neutron = client.Client('2.0', **kwargs)
|
||||
|
@ -174,7 +174,7 @@ def _get_port_info(neutron, module, instance_id, internal_network_name=None):
|
|||
subnets = neutron.list_subnets(**kwargs)
|
||||
subnet_id = subnets['subnets'][0]['id']
|
||||
kwargs = {
|
||||
'device_id': instance_id,
|
||||
'device_id': instance_id,
|
||||
}
|
||||
try:
|
||||
ports = neutron.list_ports(**kwargs)
|
||||
|
@ -193,7 +193,7 @@ def _get_port_info(neutron, module, instance_id, internal_network_name=None):
|
|||
|
||||
def _get_floating_ip(module, neutron, fixed_ip_address, network_name):
|
||||
kwargs = {
|
||||
'fixed_ip_address': fixed_ip_address
|
||||
'fixed_ip_address': fixed_ip_address
|
||||
}
|
||||
try:
|
||||
ips = neutron.list_floatingips(**kwargs)
|
||||
|
@ -214,9 +214,9 @@ def _check_ips_network(neutron, net_id, network_name):
|
|||
|
||||
def _create_floating_ip(neutron, module, port_id, net_id, fixed_ip):
|
||||
kwargs = {
|
||||
'port_id': port_id,
|
||||
'floating_network_id': net_id,
|
||||
'fixed_ip_address': fixed_ip
|
||||
'port_id': port_id,
|
||||
'floating_network_id': net_id,
|
||||
'fixed_ip_address': fixed_ip
|
||||
}
|
||||
try:
|
||||
result = neutron.create_floatingip({'floatingip': kwargs})
|
||||
|
@ -251,10 +251,10 @@ def main():
|
|||
|
||||
argument_spec = openstack_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
network_name = dict(required=True),
|
||||
instance_name = dict(required=True),
|
||||
state = dict(default='present', choices=['absent', 'present']),
|
||||
internal_network_name = dict(default=None),
|
||||
network_name = dict(required=True),
|
||||
instance_name = dict(required=True),
|
||||
state = dict(default='present', choices=['absent', 'present']),
|
||||
internal_network_name = dict(default=None),
|
||||
))
|
||||
module = AnsibleModule(argument_spec=argument_spec)
|
||||
|
||||
|
|
|
@ -125,8 +125,8 @@ def _get_neutron_client(module, kwargs):
|
|||
token = _ksclient.auth_token
|
||||
endpoint = _get_endpoint(module, _ksclient)
|
||||
kwargs = {
|
||||
'token': token,
|
||||
'endpoint_url': endpoint
|
||||
'token': token,
|
||||
'endpoint_url': endpoint
|
||||
}
|
||||
try:
|
||||
neutron = client.Client('2.0', **kwargs)
|
||||
|
@ -191,9 +191,9 @@ def main():
|
|||
|
||||
argument_spec = openstack_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
ip_address = dict(required=True),
|
||||
instance_name = dict(required=True),
|
||||
state = dict(default='present', choices=['absent', 'present'])
|
||||
ip_address = dict(required=True),
|
||||
instance_name = dict(required=True),
|
||||
state = dict(default='present', choices=['absent', 'present'])
|
||||
))
|
||||
module = AnsibleModule(argument_spec=argument_spec)
|
||||
|
||||
|
|
|
@ -167,8 +167,8 @@ def _get_neutron_client(module, kwargs):
|
|||
token = _ksclient.auth_token
|
||||
endpoint = _get_endpoint(module, _ksclient)
|
||||
kwargs = {
|
||||
'token': token,
|
||||
'endpoint_url': endpoint
|
||||
'token': token,
|
||||
'endpoint_url': endpoint
|
||||
}
|
||||
try:
|
||||
neutron = client.Client('2.0', **kwargs)
|
||||
|
@ -192,8 +192,8 @@ def _set_tenant_id(module):
|
|||
|
||||
def _get_net_id(neutron, module):
|
||||
kwargs = {
|
||||
'tenant_id': _os_tenant_id,
|
||||
'name': module.params['name'],
|
||||
'tenant_id': _os_tenant_id,
|
||||
'name': module.params['name'],
|
||||
}
|
||||
try:
|
||||
networks = neutron.list_networks(**kwargs)
|
||||
|
@ -251,15 +251,15 @@ def main():
|
|||
|
||||
argument_spec = openstack_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
name = dict(required=True),
|
||||
tenant_name = dict(default=None),
|
||||
provider_network_type = dict(default=None, choices=['local', 'vlan', 'flat', 'gre']),
|
||||
provider_physical_network = dict(default=None),
|
||||
provider_segmentation_id = dict(default=None),
|
||||
router_external = dict(default=False, type='bool'),
|
||||
shared = dict(default=False, type='bool'),
|
||||
admin_state_up = dict(default=True, type='bool'),
|
||||
state = dict(default='present', choices=['absent', 'present'])
|
||||
name = dict(required=True),
|
||||
tenant_name = dict(default=None),
|
||||
provider_network_type = dict(default=None, choices=['local', 'vlan', 'flat', 'gre']),
|
||||
provider_physical_network = dict(default=None),
|
||||
provider_segmentation_id = dict(default=None),
|
||||
router_external = dict(default=False, type='bool'),
|
||||
shared = dict(default=False, type='bool'),
|
||||
admin_state_up = dict(default=True, type='bool'),
|
||||
state = dict(default='present', choices=['absent', 'present'])
|
||||
))
|
||||
module = AnsibleModule(argument_spec=argument_spec)
|
||||
|
||||
|
|
|
@ -129,8 +129,8 @@ def _get_neutron_client(module, kwargs):
|
|||
token = _ksclient.auth_token
|
||||
endpoint = _get_endpoint(module, _ksclient)
|
||||
kwargs = {
|
||||
'token': token,
|
||||
'endpoint_url': endpoint
|
||||
'token': token,
|
||||
'endpoint_url': endpoint
|
||||
}
|
||||
try:
|
||||
neutron = client.Client('2.0', **kwargs)
|
||||
|
@ -154,8 +154,8 @@ def _set_tenant_id(module):
|
|||
|
||||
def _get_router_id(module, neutron):
|
||||
kwargs = {
|
||||
'name': module.params['name'],
|
||||
'tenant_id': _os_tenant_id,
|
||||
'name': module.params['name'],
|
||||
'tenant_id': _os_tenant_id,
|
||||
}
|
||||
try:
|
||||
routers = neutron.list_routers(**kwargs)
|
||||
|
@ -167,9 +167,9 @@ def _get_router_id(module, neutron):
|
|||
|
||||
def _create_router(module, neutron):
|
||||
router = {
|
||||
'name': module.params['name'],
|
||||
'tenant_id': _os_tenant_id,
|
||||
'admin_state_up': module.params['admin_state_up'],
|
||||
'name': module.params['name'],
|
||||
'tenant_id': _os_tenant_id,
|
||||
'admin_state_up': module.params['admin_state_up'],
|
||||
}
|
||||
try:
|
||||
new_router = neutron.create_router(dict(router=router))
|
||||
|
|
|
@ -123,8 +123,8 @@ def _get_neutron_client(module, kwargs):
|
|||
token = _ksclient.auth_token
|
||||
endpoint = _get_endpoint(module, _ksclient)
|
||||
kwargs = {
|
||||
'token': token,
|
||||
'endpoint_url': endpoint
|
||||
'token': token,
|
||||
'endpoint_url': endpoint
|
||||
}
|
||||
try:
|
||||
neutron = client.Client('2.0', **kwargs)
|
||||
|
@ -134,7 +134,7 @@ def _get_neutron_client(module, kwargs):
|
|||
|
||||
def _get_router_id(module, neutron):
|
||||
kwargs = {
|
||||
'name': module.params['router_name'],
|
||||
'name': module.params['router_name'],
|
||||
}
|
||||
try:
|
||||
routers = neutron.list_routers(**kwargs)
|
||||
|
@ -191,9 +191,9 @@ def main():
|
|||
|
||||
argument_spec = openstack_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
router_name = dict(required=True),
|
||||
network_name = dict(required=True),
|
||||
state = dict(default='present', choices=['absent', 'present']),
|
||||
router_name = dict(required=True),
|
||||
network_name = dict(required=True),
|
||||
state = dict(default='present', choices=['absent', 'present']),
|
||||
))
|
||||
module = AnsibleModule(argument_spec=argument_spec)
|
||||
if not HAVE_DEPS:
|
||||
|
|
|
@ -132,8 +132,8 @@ def _get_neutron_client(module, kwargs):
|
|||
token = _ksclient.auth_token
|
||||
endpoint = _get_endpoint(module, _ksclient)
|
||||
kwargs = {
|
||||
'token': token,
|
||||
'endpoint_url': endpoint
|
||||
'token': token,
|
||||
'endpoint_url': endpoint
|
||||
}
|
||||
try:
|
||||
neutron = client.Client('2.0', **kwargs)
|
||||
|
@ -171,8 +171,8 @@ def _get_router_id(module, neutron):
|
|||
def _get_subnet_id(module, neutron):
|
||||
subnet_id = None
|
||||
kwargs = {
|
||||
'tenant_id': _os_tenant_id,
|
||||
'name': module.params['subnet_name'],
|
||||
'tenant_id': _os_tenant_id,
|
||||
'name': module.params['subnet_name'],
|
||||
}
|
||||
try:
|
||||
subnets = neutron.list_subnets(**kwargs)
|
||||
|
@ -184,8 +184,8 @@ def _get_subnet_id(module, neutron):
|
|||
|
||||
def _get_port_id(neutron, module, router_id, subnet_id):
|
||||
kwargs = {
|
||||
'tenant_id': _os_tenant_id,
|
||||
'device_id': router_id,
|
||||
'tenant_id': _os_tenant_id,
|
||||
'device_id': router_id,
|
||||
}
|
||||
try:
|
||||
ports = neutron.list_ports(**kwargs)
|
||||
|
@ -222,10 +222,10 @@ def _remove_interface_router(neutron, module, router_id, subnet_id):
|
|||
def main():
|
||||
argument_spec = openstack_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
router_name = dict(required=True),
|
||||
subnet_name = dict(required=True),
|
||||
tenant_name = dict(default=None),
|
||||
state = dict(default='present', choices=['absent', 'present']),
|
||||
router_name = dict(required=True),
|
||||
subnet_name = dict(required=True),
|
||||
tenant_name = dict(default=None),
|
||||
state = dict(default='present', choices=['absent', 'present']),
|
||||
))
|
||||
module = AnsibleModule(argument_spec=argument_spec)
|
||||
if not HAVE_DEPS:
|
||||
|
|
|
@ -168,8 +168,8 @@ def _get_neutron_client(module, kwargs):
|
|||
token = _ksclient.auth_token
|
||||
endpoint = _get_endpoint(module, _ksclient)
|
||||
kwargs = {
|
||||
'token': token,
|
||||
'endpoint_url': endpoint
|
||||
'token': token,
|
||||
'endpoint_url': endpoint
|
||||
}
|
||||
try:
|
||||
neutron = client.Client('2.0', **kwargs)
|
||||
|
@ -227,14 +227,14 @@ def _get_subnet_id(module, neutron):
|
|||
def _create_subnet(module, neutron):
|
||||
neutron.format = 'json'
|
||||
subnet = {
|
||||
'name': module.params['name'],
|
||||
'ip_version': module.params['ip_version'],
|
||||
'enable_dhcp': module.params['enable_dhcp'],
|
||||
'tenant_id': _os_tenant_id,
|
||||
'gateway_ip': module.params['gateway_ip'],
|
||||
'dns_nameservers': module.params['dns_nameservers'],
|
||||
'network_id': _os_network_id,
|
||||
'cidr': module.params['cidr'],
|
||||
'name': module.params['name'],
|
||||
'ip_version': module.params['ip_version'],
|
||||
'enable_dhcp': module.params['enable_dhcp'],
|
||||
'tenant_id': _os_tenant_id,
|
||||
'gateway_ip': module.params['gateway_ip'],
|
||||
'dns_nameservers': module.params['dns_nameservers'],
|
||||
'network_id': _os_network_id,
|
||||
'cidr': module.params['cidr'],
|
||||
}
|
||||
if module.params['allocation_pool_start'] and module.params['allocation_pool_end']:
|
||||
allocation_pools = [
|
||||
|
@ -269,17 +269,17 @@ def main():
|
|||
|
||||
argument_spec = openstack_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
name = dict(required=True),
|
||||
network_name = dict(required=True),
|
||||
cidr = dict(required=True),
|
||||
tenant_name = dict(default=None),
|
||||
state = dict(default='present', choices=['absent', 'present']),
|
||||
ip_version = dict(default='4', choices=['4', '6']),
|
||||
enable_dhcp = dict(default='true', type='bool'),
|
||||
gateway_ip = dict(default=None),
|
||||
dns_nameservers = dict(default=None),
|
||||
allocation_pool_start = dict(default=None),
|
||||
allocation_pool_end = dict(default=None),
|
||||
name = dict(required=True),
|
||||
network_name = dict(required=True),
|
||||
cidr = dict(required=True),
|
||||
tenant_name = dict(default=None),
|
||||
state = dict(default='present', choices=['absent', 'present']),
|
||||
ip_version = dict(default='4', choices=['4', '6']),
|
||||
enable_dhcp = dict(default='true', type='bool'),
|
||||
gateway_ip = dict(default=None),
|
||||
dns_nameservers = dict(default=None),
|
||||
allocation_pool_start = dict(default=None),
|
||||
allocation_pool_end = dict(default=None),
|
||||
))
|
||||
module = AnsibleModule(argument_spec=argument_spec)
|
||||
if not HAVE_DEPS:
|
||||
|
|
|
@ -64,8 +64,8 @@ def main():
|
|||
module.exit_json(
|
||||
changed=False,
|
||||
ansible_facts=dict(
|
||||
auth_token=cloud.auth_token,
|
||||
service_catalog=cloud.service_catalog))
|
||||
auth_token=cloud.auth_token,
|
||||
service_catalog=cloud.service_catalog))
|
||||
except shade.OpenStackCloudException as e:
|
||||
module.fail_json(msg=str(e))
|
||||
|
||||
|
|
|
@ -345,9 +345,9 @@ def _system_state_change(module, project_quota_output):
|
|||
"""
|
||||
|
||||
changes_required, quota_change_request = _system_state_change_details(
|
||||
module,
|
||||
project_quota_output
|
||||
)
|
||||
module,
|
||||
project_quota_output
|
||||
)
|
||||
|
||||
if changes_required:
|
||||
return True
|
||||
|
@ -452,9 +452,9 @@ def main():
|
|||
module.exit_json(changed=_system_state_change(module, project_quota_output))
|
||||
|
||||
changes_required, quota_change_request = _system_state_change_details(
|
||||
module,
|
||||
project_quota_output
|
||||
)
|
||||
module,
|
||||
project_quota_output
|
||||
)
|
||||
|
||||
if changes_required:
|
||||
for quota_type in quota_change_request.keys():
|
||||
|
|
|
@ -215,10 +215,10 @@ def main():
|
|||
zone, pre_update_recordset)
|
||||
if changed:
|
||||
zone = cloud.update_recordset(
|
||||
zone, name + '.' + zone,
|
||||
records=records,
|
||||
description=description,
|
||||
ttl=ttl)
|
||||
zone, name + '.' + zone,
|
||||
records=records,
|
||||
description=description,
|
||||
ttl=ttl)
|
||||
module.exit_json(changed=changed, recordset=recordset)
|
||||
|
||||
elif state == 'absent':
|
||||
|
|
|
@ -212,9 +212,9 @@ def main():
|
|||
masters, pre_update_zone)
|
||||
if changed:
|
||||
zone = cloud.update_zone(
|
||||
name, email=email,
|
||||
description=description,
|
||||
ttl=ttl, masters=masters)
|
||||
name, email=email,
|
||||
description=description,
|
||||
ttl=ttl, masters=masters)
|
||||
module.exit_json(changed=changed, zone=zone)
|
||||
|
||||
elif state == 'absent':
|
||||
|
|
|
@ -202,7 +202,7 @@ def act_on_sshkeys(target_state, module, packet_conn):
|
|||
raise Exception(_msg)
|
||||
matching_sshkeys = []
|
||||
new_key_response = packet_conn.create_ssh_key(
|
||||
newkey['label'], newkey['key'])
|
||||
newkey['label'], newkey['key'])
|
||||
changed = True
|
||||
|
||||
matching_sshkeys.append(new_key_response)
|
||||
|
|
|
@ -260,9 +260,9 @@ except ImportError:
|
|||
def create_virtual_instance(module):
|
||||
|
||||
instances = vsManager.list_instances(
|
||||
hostname = module.params.get('hostname'),
|
||||
domain = module.params.get('domain'),
|
||||
datacenter = module.params.get('datacenter')
|
||||
hostname = module.params.get('hostname'),
|
||||
domain = module.params.get('domain'),
|
||||
datacenter = module.params.get('datacenter')
|
||||
)
|
||||
|
||||
if instances:
|
||||
|
@ -283,24 +283,24 @@ def create_virtual_instance(module):
|
|||
tags = ','.join(map(str, module.params.get('tags')))
|
||||
|
||||
instance = vsManager.create_instance(
|
||||
hostname = module.params.get('hostname'),
|
||||
domain = module.params.get('domain'),
|
||||
cpus = module.params.get('cpus'),
|
||||
memory = module.params.get('memory'),
|
||||
hourly = module.params.get('hourly'),
|
||||
datacenter = module.params.get('datacenter'),
|
||||
os_code = module.params.get('os_code'),
|
||||
image_id = module.params.get('image_id'),
|
||||
local_disk = module.params.get('local_disk'),
|
||||
disks = module.params.get('disks'),
|
||||
ssh_keys = module.params.get('ssh_keys'),
|
||||
nic_speed = module.params.get('nic_speed'),
|
||||
private = module.params.get('private'),
|
||||
public_vlan = module.params.get('public_vlan'),
|
||||
private_vlan = module.params.get('private_vlan'),
|
||||
dedicated = module.params.get('dedicated'),
|
||||
post_uri = module.params.get('post_uri'),
|
||||
tags = tags)
|
||||
hostname = module.params.get('hostname'),
|
||||
domain = module.params.get('domain'),
|
||||
cpus = module.params.get('cpus'),
|
||||
memory = module.params.get('memory'),
|
||||
hourly = module.params.get('hourly'),
|
||||
datacenter = module.params.get('datacenter'),
|
||||
os_code = module.params.get('os_code'),
|
||||
image_id = module.params.get('image_id'),
|
||||
local_disk = module.params.get('local_disk'),
|
||||
disks = module.params.get('disks'),
|
||||
ssh_keys = module.params.get('ssh_keys'),
|
||||
nic_speed = module.params.get('nic_speed'),
|
||||
private = module.params.get('private'),
|
||||
public_vlan = module.params.get('public_vlan'),
|
||||
private_vlan = module.params.get('private_vlan'),
|
||||
dedicated = module.params.get('dedicated'),
|
||||
post_uri = module.params.get('post_uri'),
|
||||
tags = tags)
|
||||
|
||||
if instance is not None and instance['id'] > 0:
|
||||
return True, instance
|
||||
|
@ -349,30 +349,30 @@ def cancel_instance(module):
|
|||
def main():
|
||||
|
||||
module = AnsibleModule(
|
||||
argument_spec=dict(
|
||||
instance_id=dict(),
|
||||
hostname=dict(),
|
||||
domain=dict(),
|
||||
datacenter=dict(choices=DATACENTERS),
|
||||
tags=dict(),
|
||||
hourly=dict(type='bool', default=True),
|
||||
private=dict(type='bool', default=False),
|
||||
dedicated=dict(type='bool', default=False),
|
||||
local_disk=dict(type='bool', default=True),
|
||||
cpus=dict(type='int', choices=CPU_SIZES),
|
||||
memory=dict(type='int', choices=MEMORY_SIZES),
|
||||
disks=dict(type='list', default=[25]),
|
||||
os_code=dict(),
|
||||
image_id=dict(),
|
||||
nic_speed=dict(type='int', choices=NIC_SPEEDS),
|
||||
public_vlan=dict(),
|
||||
private_vlan=dict(),
|
||||
ssh_keys=dict(type='list', default=[]),
|
||||
post_uri=dict(),
|
||||
state=dict(default='present', choices=STATES),
|
||||
wait=dict(type='bool', default=True),
|
||||
wait_time=dict(type='int', default=600)
|
||||
)
|
||||
argument_spec=dict(
|
||||
instance_id=dict(),
|
||||
hostname=dict(),
|
||||
domain=dict(),
|
||||
datacenter=dict(choices=DATACENTERS),
|
||||
tags=dict(),
|
||||
hourly=dict(type='bool', default=True),
|
||||
private=dict(type='bool', default=False),
|
||||
dedicated=dict(type='bool', default=False),
|
||||
local_disk=dict(type='bool', default=True),
|
||||
cpus=dict(type='int', choices=CPU_SIZES),
|
||||
memory=dict(type='int', choices=MEMORY_SIZES),
|
||||
disks=dict(type='list', default=[25]),
|
||||
os_code=dict(),
|
||||
image_id=dict(),
|
||||
nic_speed=dict(type='int', choices=NIC_SPEEDS),
|
||||
public_vlan=dict(),
|
||||
private_vlan=dict(),
|
||||
ssh_keys=dict(type='list', default=[]),
|
||||
post_uri=dict(),
|
||||
state=dict(default='present', choices=STATES),
|
||||
wait=dict(type='bool', default=True),
|
||||
wait_time=dict(type='int', default=600)
|
||||
)
|
||||
)
|
||||
|
||||
if not HAS_SL:
|
||||
|
|
|
@ -408,9 +408,9 @@ class PyVmomiDeviceHelper(object):
|
|||
@staticmethod
|
||||
def is_scsi_controller(device):
|
||||
return isinstance(device, vim.vm.device.VirtualLsiLogicController) or \
|
||||
isinstance(device, vim.vm.device.ParaVirtualSCSIController) or \
|
||||
isinstance(device, vim.vm.device.VirtualBusLogicController) or \
|
||||
isinstance(device, vim.vm.device.VirtualLsiLogicSASController)
|
||||
isinstance(device, vim.vm.device.ParaVirtualSCSIController) or \
|
||||
isinstance(device, vim.vm.device.VirtualBusLogicController) or \
|
||||
isinstance(device, vim.vm.device.VirtualLsiLogicSASController)
|
||||
|
||||
def create_scsi_disk(self, scsi_ctl, disk_index=None):
|
||||
diskspec = vim.vm.device.VirtualDeviceSpec()
|
||||
|
|
|
@ -91,8 +91,8 @@ class VMwareLocalUserManager(object):
|
|||
try:
|
||||
local_account_manager_states = {
|
||||
'absent': {
|
||||
'present': self.state_remove_user,
|
||||
'absent': self.state_exit_unchanged,
|
||||
'present': self.state_remove_user,
|
||||
'absent': self.state_exit_unchanged,
|
||||
},
|
||||
'present': {
|
||||
'present': self.state_update_user,
|
||||
|
|
|
@ -178,8 +178,8 @@ def main():
|
|||
if not module.check_mode:
|
||||
# If this isn't a dry run, create or modify the site
|
||||
result.update(
|
||||
webfaction.create_website(
|
||||
*positional_args
|
||||
webfaction.create_website(
|
||||
*positional_args
|
||||
) if not existing_site else webfaction.update_website (
|
||||
*positional_args
|
||||
)
|
||||
|
|
|
@ -366,18 +366,18 @@ def parse_check(module):
|
|||
if module.params.get('check_id') or module.params.get('script') or module.params.get('ttl') or module.params.get('http'):
|
||||
|
||||
return ConsulCheck(
|
||||
module.params.get('check_id'),
|
||||
module.params.get('check_name'),
|
||||
module.params.get('check_node'),
|
||||
module.params.get('check_host'),
|
||||
module.params.get('script'),
|
||||
module.params.get('interval'),
|
||||
module.params.get('ttl'),
|
||||
module.params.get('notes'),
|
||||
module.params.get('http'),
|
||||
module.params.get('timeout'),
|
||||
module.params.get('service_id'),
|
||||
)
|
||||
module.params.get('check_id'),
|
||||
module.params.get('check_name'),
|
||||
module.params.get('check_node'),
|
||||
module.params.get('check_host'),
|
||||
module.params.get('script'),
|
||||
module.params.get('interval'),
|
||||
module.params.get('ttl'),
|
||||
module.params.get('notes'),
|
||||
module.params.get('http'),
|
||||
module.params.get('timeout'),
|
||||
module.params.get('service_id'),
|
||||
)
|
||||
|
||||
|
||||
def parse_service(module):
|
||||
|
@ -578,7 +578,7 @@ def main():
|
|||
register_with_consul(module)
|
||||
except ConnectionError as e:
|
||||
module.fail_json(msg='Could not connect to consul agent at %s:%s, error was %s' % (
|
||||
module.params.get('host'), module.params.get('port'), str(e)))
|
||||
module.params.get('host'), module.params.get('port'), str(e)))
|
||||
except Exception as e:
|
||||
module.fail_json(msg=str(e))
|
||||
|
||||
|
|
|
@ -223,7 +223,7 @@ def load_rules_for_token(module, consul_api, token):
|
|||
except Exception as e:
|
||||
module.fail_json(
|
||||
msg="Could not load rule list from retrieved rule data %s, %s" % (
|
||||
token, e))
|
||||
token, e))
|
||||
|
||||
return json_to_rules(module, loaded)
|
||||
|
||||
|
@ -357,7 +357,7 @@ def main():
|
|||
execute(module)
|
||||
except ConnectionError as e:
|
||||
module.fail_json(msg='Could not connect to consul agent at %s:%s, error was %s' % (
|
||||
module.params.get('host'), module.params.get('port'), str(e)))
|
||||
module.params.get('host'), module.params.get('port'), str(e)))
|
||||
except Exception as e:
|
||||
module.fail_json(msg=str(e))
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue