1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

[cloud] Rename ec2_facts to ec2_metadata_facts (#26293)

- Update CHANGELOG with ec2_facts deprecation notice
This commit is contained in:
Vinay Dandekar 2017-07-18 16:11:09 -04:00 committed by Ryan Brown
parent 65da6a0789
commit 5b109506c4
3 changed files with 15 additions and 7 deletions

View file

@ -45,6 +45,9 @@ Ansible Changes By Release
module is deprecated and slated to go away in 2.8. The functionality has been 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. 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 ### Minor Changes
* removed previously deprecated config option `hostfile` and env var `ANSIBLE_HOSTS` * removed previously deprecated config option `hostfile` and env var `ANSIBLE_HOSTS`
* removed unused and deprecated config option `pattern` * removed unused and deprecated config option `pattern`
@ -109,6 +112,7 @@ Ansible Changes By Release
- aix_lvol - aix_lvol
- amazon - amazon
* ec2_metadata_facts
* ec2_vpc_endpoint * ec2_vpc_endpoint
* iam_cert_facts * iam_cert_facts
* lightsail * lightsail

View file

@ -0,0 +1 @@
ec2_metadata_facts.py

View file

@ -23,7 +23,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.0',
DOCUMENTATION = ''' DOCUMENTATION = '''
--- ---
module: ec2_facts module: ec2_metadata_facts
short_description: Gathers facts (instance metadata) about remote hosts within ec2 short_description: Gathers facts (instance metadata) about remote hosts within ec2
version_added: "1.0" version_added: "1.0"
author: author:
@ -34,12 +34,12 @@ description:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html. http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html.
The module must be called from within the EC2 instance itself. The module must be called from within the EC2 instance itself.
notes: notes:
- Parameters to filter on ec2_facts may be added later. - Parameters to filter on ec2_metadata_facts may be added later.
''' '''
EXAMPLES = ''' EXAMPLES = '''
# Gather EC2 facts # Gather EC2 metadata facts
- ec2_facts: - ec2_metadata_facts:
- debug: - debug:
msg: "This instance is a t1.micro" msg: "This instance is a t1.micro"
@ -539,10 +539,13 @@ def main():
supports_check_mode=True, supports_check_mode=True,
) )
ec2_facts = Ec2Metadata(module).run() if module._name == 'ec2_facts':
ec2_facts_result = dict(changed=False, ansible_facts=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__': if __name__ == '__main__':