mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
ec2_eip connect method references module var that is not passed in
This commit is contained in:
parent
4bfbee6939
commit
0ae9128c7b
1 changed files with 6 additions and 7 deletions
|
@ -102,7 +102,7 @@ else:
|
||||||
boto_found = True
|
boto_found = True
|
||||||
|
|
||||||
|
|
||||||
def connect(ec2_url, ec2_secret_key, ec2_access_key, region):
|
def connect(ec2_url, ec2_secret_key, ec2_access_key, region, module):
|
||||||
""" Return an ec2 connection"""
|
""" Return an ec2 connection"""
|
||||||
# allow environment variables to be used if ansible vars aren't set
|
# allow environment variables to be used if ansible vars aren't set
|
||||||
if not ec2_url and 'EC2_URL' in os.environ:
|
if not ec2_url and 'EC2_URL' in os.environ:
|
||||||
|
@ -258,14 +258,13 @@ def main():
|
||||||
if not boto_found:
|
if not boto_found:
|
||||||
module.fail_json(msg="boto is required")
|
module.fail_json(msg="boto is required")
|
||||||
|
|
||||||
# def get_ec2_creds(module):
|
|
||||||
# return ec2_url, ec2_access_key, ec2_secret_key, region
|
|
||||||
ec2_url, ec2_access_key, ec2_secret_key, region = get_ec2_creds(module)
|
ec2_url, ec2_access_key, ec2_secret_key, region = get_ec2_creds(module)
|
||||||
|
|
||||||
ec2 = connect(ec2_url=ec2_url,
|
ec2 = connect(ec2_url,
|
||||||
ec2_access_key=ec2_access_key,
|
ec2_access_key,
|
||||||
ec2_secret_key=ec2_secret_key,
|
ec2_secret_key,
|
||||||
region=region)
|
region,
|
||||||
|
module)
|
||||||
|
|
||||||
instance_id = module.params.get('instance_id')
|
instance_id = module.params.get('instance_id')
|
||||||
public_ip = module.params.get('public_ip')
|
public_ip = module.params.get('public_ip')
|
||||||
|
|
Loading…
Reference in a new issue