From 75a7ebe900d1cd3d7bc036d01d88a767f4edbd11 Mon Sep 17 00:00:00 2001 From: Will Thames Date: Thu, 19 Jan 2017 21:25:28 +1000 Subject: [PATCH] Deprecate ec2_vpc module (#20344) * Deprecate ec2_vpc module The deprecation of ec2_vpc module has been discussed for 2 years and is causing duplication of effort as changes are implemented for ec2_vpc rather than for the newer alternatives * Improve module deprecation documentation Update the developing modules documentation with the latest instructions on how to deprecate a module. --- CHANGELOG.md | 2 ++ docs/docsite/rst/dev_guide/developing_modules.rst | 7 +++++++ .../modules/cloud/amazon/{ec2_vpc.py => _ec2_vpc.py} | 7 +++++-- 3 files changed, 14 insertions(+), 2 deletions(-) rename lib/ansible/modules/cloud/amazon/{ec2_vpc.py => _ec2_vpc.py} (99%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17b3b36a8dc..2ae2a46475c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,8 @@ Ansible Changes By Release the new behaviour. In 2.4, the default will be to merge and you can enable the old overwriting behaviour via the config option. In 2.5, multiple --tags options will be merged with no way to go back to the old behaviour. +* Modules + * ec2_vpc will be deprecated in 2.5 ###New Modules: - archive diff --git a/docs/docsite/rst/dev_guide/developing_modules.rst b/docs/docsite/rst/dev_guide/developing_modules.rst index 302ae426af8..860537b4cc8 100644 --- a/docs/docsite/rst/dev_guide/developing_modules.rst +++ b/docs/docsite/rst/dev_guide/developing_modules.rst @@ -869,6 +869,13 @@ Deprecating and making module aliases Starting in 1.8, you can deprecate modules by renaming them with a preceding _, i.e. old_cloud.py to _old_cloud.py. This keeps the module available, but hides it from the primary docs and listing. +When deprecating a module, set the `ANSIBLE_METADATA` `status` to `deprecated`. +In the `DOCUMENTATION` section, add a `deprecated` field along the lines of:: + + deprecated: Deprecated in 2.3. Use M(whatmoduletouseinstead) instead. + +Add the deprecation to CHANGELOG.md + You can also rename modules and keep an alias to the old name by using a symlink that starts with _. This example allows the stat module to be called with fileinfo, making the following examples equivalent:: diff --git a/lib/ansible/modules/cloud/amazon/ec2_vpc.py b/lib/ansible/modules/cloud/amazon/_ec2_vpc.py similarity index 99% rename from lib/ansible/modules/cloud/amazon/ec2_vpc.py rename to lib/ansible/modules/cloud/amazon/_ec2_vpc.py index 5b0cfc51b0e..f4ed7995f6a 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_vpc.py +++ b/lib/ansible/modules/cloud/amazon/_ec2_vpc.py @@ -14,7 +14,7 @@ # You should have received a copy of the GNU General Public License # along with Ansible. If not, see . -ANSIBLE_METADATA = {'status': ['stableinterface'], +ANSIBLE_METADATA = {'status': ['deprecated'], 'supported_by': 'committer', 'version': '1.0'} @@ -25,6 +25,10 @@ short_description: configure AWS virtual private clouds description: - Create or terminates AWS virtual private clouds. This module has a dependency on python-boto. version_added: "1.4" +deprecated: >- + Deprecated in 2.3. Use M(epc_vpc_net) along with supporting modules including + M(ec2_vpc_igw), M(ec2_vpc_route_table), M(ec2_vpc_subnet), M(ec2_vpc_dhcp_options), + M(ec2_vpc_nat_gateway), M(ec2_vpc_nacl). options: cidr_block: description: @@ -400,7 +404,6 @@ def create_vpc(module, vpc_conn): vpc_conn.modify_vpc_attribute(vpc.id, enable_dns_support=dns_support) vpc_conn.modify_vpc_attribute(vpc.id, enable_dns_hostnames=dns_hostnames) - # Process all subnet properties if subnets is not None: if not isinstance(subnets, list):