From add2ec06719a0c73c14ba909200cbead222f9138 Mon Sep 17 00:00:00 2001 From: Mark Chappell Date: Thu, 19 May 2022 14:07:45 +0200 Subject: [PATCH] Update plugin docs to explicitly list python, boto3 and botocore version requirements in line with collection requirements --- docs/docsite/rst/dev_guidelines.rst | 1 - plugins/doc_fragments/aws_boto3.py | 19 +++++++++++++++++++ plugins/inventory/aws_ec2.py | 4 +--- plugins/inventory/aws_rds.py | 4 +--- plugins/lookup/aws_account_attribute.py | 5 +---- plugins/lookup/aws_secret.py | 5 +---- plugins/lookup/aws_ssm.py | 6 ++---- 7 files changed, 25 insertions(+), 19 deletions(-) create mode 100644 plugins/doc_fragments/aws_boto3.py diff --git a/docs/docsite/rst/dev_guidelines.rst b/docs/docsite/rst/dev_guidelines.rst index 6b77e218eb8..f23324b1afe 100644 --- a/docs/docsite/rst/dev_guidelines.rst +++ b/docs/docsite/rst/dev_guidelines.rst @@ -232,7 +232,6 @@ and that the more esoteric connection options are documented. For example: DOCUMENTATION = ''' module: my_module # some lines omitted here - requirements: [ 'botocore', 'boto3' ] extends_documentation_fragment: - amazon.aws.aws - amazon.aws.ec2 diff --git a/plugins/doc_fragments/aws_boto3.py b/plugins/doc_fragments/aws_boto3.py new file mode 100644 index 00000000000..0696abc297a --- /dev/null +++ b/plugins/doc_fragments/aws_boto3.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- + +# Copyright: (c) 2022, Ansible Project +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + + +class ModuleDocFragment(object): + + # Minimum requirements for the collection + DOCUMENTATION = r''' +options: {} +requirements: + - python >= 3.6 + - boto3 >= 1.17.0 + - botocore >= 1.20.0 +''' diff --git a/plugins/inventory/aws_ec2.py b/plugins/inventory/aws_ec2.py index d6bf911e0ae..0e2aead1fd7 100644 --- a/plugins/inventory/aws_ec2.py +++ b/plugins/inventory/aws_ec2.py @@ -7,12 +7,10 @@ DOCUMENTATION = ''' name: aws_ec2 short_description: EC2 inventory source - requirements: - - boto3 - - botocore extends_documentation_fragment: - inventory_cache - constructed + - amazon.aws.aws_boto3 - amazon.aws.aws_credentials description: diff --git a/plugins/inventory/aws_rds.py b/plugins/inventory/aws_rds.py index ed0abc69fed..1e2683630b7 100644 --- a/plugins/inventory/aws_rds.py +++ b/plugins/inventory/aws_rds.py @@ -54,11 +54,9 @@ extends_documentation_fragment: - inventory_cache - constructed + - amazon.aws.aws_boto3 - amazon.aws.aws_credentials - requirements: - - boto3 - - botocore author: Sloane Hertel (@s-hertel) ''' diff --git a/plugins/lookup/aws_account_attribute.py b/plugins/lookup/aws_account_attribute.py index bb4d9c3b82f..525938d285c 100644 --- a/plugins/lookup/aws_account_attribute.py +++ b/plugins/lookup/aws_account_attribute.py @@ -7,11 +7,8 @@ name: aws_account_attribute author: - Sloane Hertel (@s-hertel) -requirements: - - python >= 3.6 - - boto3 - - botocore >= 1.20.0 extends_documentation_fragment: +- amazon.aws.aws_boto3 - amazon.aws.aws_credentials - amazon.aws.aws_region diff --git a/plugins/lookup/aws_secret.py b/plugins/lookup/aws_secret.py index e29433601e0..e5e51706787 100644 --- a/plugins/lookup/aws_secret.py +++ b/plugins/lookup/aws_secret.py @@ -8,11 +8,8 @@ name: aws_secret author: - Aaron Smith (!UNKNOWN) -requirements: - - python >= 3.6 - - boto3 - - botocore >= 1.20.0 extends_documentation_fragment: +- amazon.aws.aws_boto3 - amazon.aws.aws_credentials - amazon.aws.aws_region diff --git a/plugins/lookup/aws_ssm.py b/plugins/lookup/aws_ssm.py index e99f772e79a..fd02b377949 100644 --- a/plugins/lookup/aws_ssm.py +++ b/plugins/lookup/aws_ssm.py @@ -13,10 +13,6 @@ - Bill Wang (!UNKNOWN) - Marat Bakeev (!UNKNOWN) - Michael De La Rue (!UNKNOWN) -requirements: - - python >= 3.6 - - boto3 - - botocore >= 1.20.0 short_description: Get the value for a SSM parameter or all parameters under a path. description: - Get the value for an Amazon Simple Systems Manager parameter or a hierarchy of parameters. @@ -71,6 +67,8 @@ type: string choices: ['error', 'skip', 'warn'] version_added: 2.0.0 +extends_documentation_fragment: +- amazon.aws.aws_boto3 ''' EXAMPLES = '''