mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
parent
d0d1158c5e
commit
e2c0b375d3
23 changed files with 51 additions and 57 deletions
|
@ -297,7 +297,7 @@ def main():
|
|||
|
||||
# First check if we were given a dhcp_options_id
|
||||
if not params['dhcp_options_id']:
|
||||
# No, so create new_options from the parameters
|
||||
# No, so create new_options from the parameters
|
||||
if params['dns_servers'] is not None:
|
||||
new_options['domain-name-servers'] = params['dns_servers']
|
||||
if params['netbios_name_servers'] is not None:
|
||||
|
|
|
@ -387,8 +387,8 @@ def find_vgw(client, module, vpn_gateway_id=None):
|
|||
|
||||
def ensure_vgw_present(client, module):
|
||||
|
||||
# If an existing vgw name and type matches our args, then a match is considered to have been
|
||||
# found and we will not create another vgw.
|
||||
# If an existing vgw name and type matches our args, then a match is considered to have been
|
||||
# found and we will not create another vgw.
|
||||
|
||||
changed = False
|
||||
params = dict()
|
||||
|
@ -472,8 +472,8 @@ def ensure_vgw_present(client, module):
|
|||
|
||||
def ensure_vgw_absent(client, module):
|
||||
|
||||
# If an existing vgw name and type matches our args, then a match is considered to have been
|
||||
# found and we will take steps to delete it.
|
||||
# If an existing vgw name and type matches our args, then a match is considered to have been
|
||||
# found and we will take steps to delete it.
|
||||
|
||||
changed = False
|
||||
params = dict()
|
||||
|
|
|
@ -314,8 +314,8 @@ def main():
|
|||
results['task']=existing
|
||||
else:
|
||||
if not module.check_mode:
|
||||
# it exists, so we should delete it and mark changed.
|
||||
# return info about the cluster deleted
|
||||
# it exists, so we should delete it and mark changed.
|
||||
# return info about the cluster deleted
|
||||
results['task'] = service_mgr.stop_task(
|
||||
module.params['cluster'],
|
||||
module.params['task']
|
||||
|
|
|
@ -145,7 +145,7 @@ def main():
|
|||
exists = len(matching_groups) > 0
|
||||
except boto.exception.JSONResponseError as e:
|
||||
if e.body['Error']['Code'] != 'ClusterSubnetGroupNotFoundFault':
|
||||
#if e.code != 'ClusterSubnetGroupNotFoundFault':
|
||||
# if e.code != 'ClusterSubnetGroupNotFoundFault':
|
||||
module.fail_json(msg=str(e))
|
||||
|
||||
if state == 'absent':
|
||||
|
@ -158,17 +158,17 @@ def main():
|
|||
new_group = conn.create_cluster_subnet_group(group_name, group_description, group_subnets)
|
||||
group = {
|
||||
'name': new_group['CreateClusterSubnetGroupResponse']['CreateClusterSubnetGroupResult']
|
||||
['ClusterSubnetGroup']['ClusterSubnetGroupName'],
|
||||
['ClusterSubnetGroup']['ClusterSubnetGroupName'],
|
||||
'vpc_id': new_group['CreateClusterSubnetGroupResponse']['CreateClusterSubnetGroupResult']
|
||||
['ClusterSubnetGroup']['VpcId'],
|
||||
['ClusterSubnetGroup']['VpcId'],
|
||||
}
|
||||
else:
|
||||
changed_group = conn.modify_cluster_subnet_group(group_name, group_subnets, description=group_description)
|
||||
group = {
|
||||
'name': changed_group['ModifyClusterSubnetGroupResponse']['ModifyClusterSubnetGroupResult']
|
||||
['ClusterSubnetGroup']['ClusterSubnetGroupName'],
|
||||
['ClusterSubnetGroup']['ClusterSubnetGroupName'],
|
||||
'vpc_id': changed_group['ModifyClusterSubnetGroupResponse']['ModifyClusterSubnetGroupResult']
|
||||
['ClusterSubnetGroup']['VpcId'],
|
||||
['ClusterSubnetGroup']['VpcId'],
|
||||
}
|
||||
|
||||
changed = True
|
||||
|
|
|
@ -601,7 +601,7 @@ def main():
|
|||
if mode == 'put':
|
||||
|
||||
# Use this snippet to debug through conditionals:
|
||||
# module.exit_json(msg="Bucket return %s"%bucketrtn)
|
||||
# module.exit_json(msg="Bucket return %s"%bucketrtn)
|
||||
|
||||
# Lets check the src path.
|
||||
pathrtn = path_check(src)
|
||||
|
|
|
@ -450,12 +450,12 @@ def main():
|
|||
except Exception as e:
|
||||
module.fail_json(msg=unexpected_error_msg(e), changed=False)
|
||||
if network:
|
||||
# json_output['d4'] = 'deleting %s' % name
|
||||
# json_output['d4'] = 'deleting %s' % name
|
||||
try:
|
||||
gce.ex_destroy_network(network)
|
||||
except Exception as e:
|
||||
module.fail_json(msg=unexpected_error_msg(e), changed=False)
|
||||
# json_output['d5'] = 'deleted %s' % name
|
||||
# json_output['d5'] = 'deleted %s' % name
|
||||
changed = True
|
||||
|
||||
json_output['changed'] = changed
|
||||
|
|
|
@ -181,12 +181,12 @@ def main():
|
|||
pem_file=dict(type='path'),
|
||||
project_id=dict(),
|
||||
),
|
||||
mutually_exclusive=[
|
||||
mutually_exclusive=[
|
||||
[ 'instance_name', 'instance_pattern' ]
|
||||
],
|
||||
],
|
||||
required_one_of=[
|
||||
[ 'instance_name', 'instance_pattern' ]
|
||||
]
|
||||
]
|
||||
)
|
||||
|
||||
instance_name = module.params.get('instance_name')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue