|
|
@ -54,13 +54,14 @@ import re
|
|
|
|
|
|
|
|
|
|
|
|
socket.setdefaulttimeout(5)
|
|
|
|
socket.setdefaulttimeout(5)
|
|
|
|
|
|
|
|
|
|
|
|
class Ec2Metadata(object):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Ec2Metadata(object):
|
|
|
|
ec2_metadata_uri = 'http://169.254.169.254/latest/meta-data/'
|
|
|
|
ec2_metadata_uri = 'http://169.254.169.254/latest/meta-data/'
|
|
|
|
ec2_sshdata_uri = 'http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key'
|
|
|
|
ec2_sshdata_uri = 'http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key'
|
|
|
|
ec2_userdata_uri = 'http://169.254.169.254/latest/user-data/'
|
|
|
|
ec2_userdata_uri = 'http://169.254.169.254/latest/user-data/'
|
|
|
|
|
|
|
|
|
|
|
|
AWS_REGIONS = ('ap-northeast-1',
|
|
|
|
AWS_REGIONS = ('ap-northeast-1',
|
|
|
|
|
|
|
|
'ap-northeast-2',
|
|
|
|
'ap-southeast-1',
|
|
|
|
'ap-southeast-1',
|
|
|
|
'ap-southeast-2',
|
|
|
|
'ap-southeast-2',
|
|
|
|
'eu-central-1',
|
|
|
|
'eu-central-1',
|
|
|
@ -161,6 +162,7 @@ class Ec2Metadata(object):
|
|
|
|
self.add_ec2_region(data)
|
|
|
|
self.add_ec2_region(data)
|
|
|
|
return data
|
|
|
|
return data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
def main():
|
|
|
|
argument_spec = url_argument_spec()
|
|
|
|
argument_spec = url_argument_spec()
|
|
|
|
|
|
|
|
|
|
|
@ -174,6 +176,7 @@ def main():
|
|
|
|
|
|
|
|
|
|
|
|
module.exit_json(**ec2_facts_result)
|
|
|
|
module.exit_json(**ec2_facts_result)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# import module snippets
|
|
|
|
# import module snippets
|
|
|
|
from ansible.module_utils.basic import *
|
|
|
|
from ansible.module_utils.basic import *
|
|
|
|
from ansible.module_utils.urls import *
|
|
|
|
from ansible.module_utils.urls import *
|
|
|
|