diff --git a/CHANGELOG.md b/CHANGELOG.md index 778da3ab5ae..793c5a84348 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,9 @@ Ansible Changes By Release module is deprecated and slated to go away in 2.8. The functionality has been moved to `ansible.utils.unsafe_proxy` to avoid a circular import. +#### Deprecated Modules: +* ec2_facts (removed in 2.7), replaced by ec2_metadata_facts + ### Minor Changes * removed previously deprecated config option `hostfile` and env var `ANSIBLE_HOSTS` * removed unused and deprecated config option `pattern` @@ -109,6 +112,7 @@ Ansible Changes By Release - aix_lvol - amazon + * ec2_metadata_facts * ec2_vpc_endpoint * iam_cert_facts * lightsail diff --git a/lib/ansible/modules/cloud/amazon/_ec2_facts.py b/lib/ansible/modules/cloud/amazon/_ec2_facts.py new file mode 120000 index 00000000000..2e5b1b9b3cd --- /dev/null +++ b/lib/ansible/modules/cloud/amazon/_ec2_facts.py @@ -0,0 +1 @@ +ec2_metadata_facts.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/amazon/ec2_facts.py b/lib/ansible/modules/cloud/amazon/ec2_metadata_facts.py similarity index 98% rename from lib/ansible/modules/cloud/amazon/ec2_facts.py rename to lib/ansible/modules/cloud/amazon/ec2_metadata_facts.py index 6eb7b3314a0..e915f7bf05f 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_facts.py +++ b/lib/ansible/modules/cloud/amazon/ec2_metadata_facts.py @@ -23,7 +23,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.0', DOCUMENTATION = ''' --- -module: ec2_facts +module: ec2_metadata_facts short_description: Gathers facts (instance metadata) about remote hosts within ec2 version_added: "1.0" author: @@ -34,12 +34,12 @@ description: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html. The module must be called from within the EC2 instance itself. notes: - - Parameters to filter on ec2_facts may be added later. + - Parameters to filter on ec2_metadata_facts may be added later. ''' EXAMPLES = ''' -# Gather EC2 facts -- ec2_facts: +# Gather EC2 metadata facts +- ec2_metadata_facts: - debug: msg: "This instance is a t1.micro" @@ -539,10 +539,13 @@ def main(): supports_check_mode=True, ) - ec2_facts = Ec2Metadata(module).run() - ec2_facts_result = dict(changed=False, ansible_facts=ec2_facts) + if module._name == 'ec2_facts': + module.deprecate("The 'ec2_facts' module is being renamed 'ec2_metadata_facts'", version=2.7) - module.exit_json(**ec2_facts_result) + ec2_metadata_facts = Ec2Metadata(module).run() + ec2_metadata_facts_result = dict(changed=False, ansible_facts=ec2_metadata_facts) + + module.exit_json(**ec2_metadata_facts_result) if __name__ == '__main__':