Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor inventory plugin connection handling #1271

Conversation

tremble
Copy link
Contributor

@tremble tremble commented Nov 16, 2022

SUMMARY

Further refactors inventory plugin connection handling:

  • Expands AWSPluginBase client() and resource() to allow overriding parameters
  • renames _boto3_conn to all_clients to better describe what it's doing (_boto3_conn is used elswhere for singluar clients)
  • assumes the IAM role once
  • updates plugin parameters to match other plugins/modules
  • updates RDS description wrapper to avoid reordering arguments
  • avoids maintaining a full inventory scoped rewrite of client/resource code
  • avoids maintaining a full inventory scoped handling of boto3/botocore version handling
ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

plugins/inventory/aws_ec2.py
plugins/inventory/aws_rds.py
plugins/plugin_utils/base.py
plugins/plugin_utils/inventory.py

ADDITIONAL INFORMATION

@github-actions
Copy link

github-actions bot commented Nov 16, 2022

Docs Build 📝

Thank you for contribution!✨

This PR has been merged and your docs changes will be incorporated when they are next published.

@ansibullbot ansibullbot added community_review feature This issue/PR relates to a feature request inventory inventory plugin needs_triage plugins plugin (any type) tests tests labels Nov 16, 2022
@softwarefactory-project-zuul

This comment was marked as resolved.

@ansibullbot ansibullbot added the new_plugin New plugin label Nov 16, 2022
@softwarefactory-project-zuul

This comment was marked as resolved.

@tremble tremble force-pushed the refacter/inventories/connection branch from b932b4a to 4ecfe66 Compare November 16, 2022 15:11
@tremble tremble force-pushed the refacter/inventories/connection branch from 4ecfe66 to 39c2ccd Compare November 16, 2022 15:16
@tremble tremble marked this pull request as ready for review November 16, 2022 15:26
@tremble tremble requested review from abikouo, alinabuzachis and jillr and removed request for abikouo November 16, 2022 15:26
@softwarefactory-project-zuul

This comment was marked as resolved.

@tremble tremble force-pushed the refacter/inventories/connection branch from 39c2ccd to 5a5796f Compare November 16, 2022 15:42
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

✔️ ansible-galaxy-importer SUCCESS in 4m 36s
✔️ build-ansible-collection SUCCESS in 5m 12s
ansible-test-sanity-aws-ansible-python38 FAILURE in 11m 17s (non-voting)
✔️ ansible-test-sanity-aws-ansible-2.12-python38 SUCCESS in 10m 20s
✔️ ansible-test-sanity-aws-ansible-2.13-python38 SUCCESS in 9m 01s
✔️ ansible-test-sanity-aws-ansible-2.14 SUCCESS in 9m 29s
✔️ ansible-test-units-amazon-aws-python36 SUCCESS in 7m 15s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 7m 08s
✔️ ansible-test-units-amazon-aws-python39 SUCCESS in 6m 08s
✔️ cloud-tox-py3 SUCCESS in 3m 21s
✔️ ansible-test-changelog SUCCESS in 2m 19s
✔️ ansible-test-splitter SUCCESS in 2m 29s
✔️ integration-amazon.aws-1 SUCCESS in 14m 58s
⚠️ integration-amazon.aws-2 SKIPPED
⚠️ integration-amazon.aws-3 SKIPPED
⚠️ integration-amazon.aws-4 SKIPPED
⚠️ integration-amazon.aws-5 SKIPPED
⚠️ integration-amazon.aws-6 SKIPPED
⚠️ integration-amazon.aws-7 SKIPPED
⚠️ integration-amazon.aws-8 SKIPPED
⚠️ integration-amazon.aws-9 SKIPPED
⚠️ integration-amazon.aws-10 SKIPPED
⚠️ integration-amazon.aws-11 SKIPPED
⚠️ integration-amazon.aws-12 SKIPPED
⚠️ integration-amazon.aws-13 SKIPPED
⚠️ integration-amazon.aws-14 SKIPPED
⚠️ integration-amazon.aws-15 SKIPPED
⚠️ integration-amazon.aws-16 SKIPPED
⚠️ integration-amazon.aws-17 SKIPPED
⚠️ integration-amazon.aws-18 SKIPPED
⚠️ integration-amazon.aws-19 SKIPPED
⚠️ integration-amazon.aws-20 SKIPPED
⚠️ integration-amazon.aws-21 SKIPPED
⚠️ integration-amazon.aws-22 SKIPPED
⚠️ integration-community.aws-1 SKIPPED
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED
⚠️ integration-community.aws-14 SKIPPED
⚠️ integration-community.aws-15 SKIPPED
⚠️ integration-community.aws-16 SKIPPED
⚠️ integration-community.aws-17 SKIPPED
⚠️ integration-community.aws-18 SKIPPED
⚠️ integration-community.aws-19 SKIPPED
⚠️ integration-community.aws-20 SKIPPED
⚠️ integration-community.aws-21 SKIPPED
⚠️ integration-community.aws-22 SKIPPED

options: {}
"""

# Formatted for non-module plugins
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth adding a note in the README about this doc_fragment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The scope is currently limited to inventory plugins, so I wasn't going to add one just yet.

@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Ansible, Inc
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be 2015 or 2022?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2022, good catch :)

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

✔️ ansible-galaxy-importer SUCCESS in 4m 14s
✔️ build-ansible-collection SUCCESS in 5m 14s
ansible-test-sanity-aws-ansible-python38 FAILURE in 8m 46s (non-voting)
✔️ ansible-test-sanity-aws-ansible-2.12-python38 SUCCESS in 9m 10s
✔️ ansible-test-sanity-aws-ansible-2.13-python38 SUCCESS in 8m 34s
✔️ ansible-test-sanity-aws-ansible-2.14 SUCCESS in 8m 29s
✔️ ansible-test-units-amazon-aws-python36 SUCCESS in 6m 09s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 5m 54s
✔️ ansible-test-units-amazon-aws-python39 SUCCESS in 6m 30s
✔️ cloud-tox-py3 SUCCESS in 3m 23s
✔️ ansible-test-changelog SUCCESS in 2m 19s
✔️ ansible-test-splitter SUCCESS in 2m 39s
✔️ integration-amazon.aws-1 SUCCESS in 16m 41s
⚠️ integration-amazon.aws-2 SKIPPED
⚠️ integration-amazon.aws-3 SKIPPED
⚠️ integration-amazon.aws-4 SKIPPED
⚠️ integration-amazon.aws-5 SKIPPED
⚠️ integration-amazon.aws-6 SKIPPED
⚠️ integration-amazon.aws-7 SKIPPED
⚠️ integration-amazon.aws-8 SKIPPED
⚠️ integration-amazon.aws-9 SKIPPED
⚠️ integration-amazon.aws-10 SKIPPED
⚠️ integration-amazon.aws-11 SKIPPED
⚠️ integration-amazon.aws-12 SKIPPED
⚠️ integration-amazon.aws-13 SKIPPED
⚠️ integration-amazon.aws-14 SKIPPED
⚠️ integration-amazon.aws-15 SKIPPED
⚠️ integration-amazon.aws-16 SKIPPED
⚠️ integration-amazon.aws-17 SKIPPED
⚠️ integration-amazon.aws-18 SKIPPED
⚠️ integration-amazon.aws-19 SKIPPED
⚠️ integration-amazon.aws-20 SKIPPED
⚠️ integration-amazon.aws-21 SKIPPED
⚠️ integration-amazon.aws-22 SKIPPED
⚠️ integration-community.aws-1 SKIPPED
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED
⚠️ integration-community.aws-14 SKIPPED
⚠️ integration-community.aws-15 SKIPPED
⚠️ integration-community.aws-16 SKIPPED
⚠️ integration-community.aws-17 SKIPPED
⚠️ integration-community.aws-18 SKIPPED
⚠️ integration-community.aws-19 SKIPPED
⚠️ integration-community.aws-20 SKIPPED
⚠️ integration-community.aws-21 SKIPPED
⚠️ integration-community.aws-22 SKIPPED

@tremble tremble added the mergeit Merge the PR (SoftwareFactory) label Nov 22, 2022
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

✔️ ansible-galaxy-importer SUCCESS in 4m 02s
✔️ build-ansible-collection SUCCESS in 5m 07s
✔️ ansible-test-splitter SUCCESS in 2m 22s
✔️ integration-amazon.aws-1 SUCCESS in 16m 41s
⚠️ integration-amazon.aws-2 SKIPPED
⚠️ integration-amazon.aws-3 SKIPPED
⚠️ integration-amazon.aws-4 SKIPPED
⚠️ integration-amazon.aws-5 SKIPPED
⚠️ integration-amazon.aws-6 SKIPPED
⚠️ integration-amazon.aws-7 SKIPPED
⚠️ integration-amazon.aws-8 SKIPPED
⚠️ integration-amazon.aws-9 SKIPPED
⚠️ integration-amazon.aws-10 SKIPPED
⚠️ integration-amazon.aws-11 SKIPPED
⚠️ integration-amazon.aws-12 SKIPPED
⚠️ integration-amazon.aws-13 SKIPPED
⚠️ integration-amazon.aws-14 SKIPPED
⚠️ integration-amazon.aws-15 SKIPPED
⚠️ integration-amazon.aws-16 SKIPPED
⚠️ integration-amazon.aws-17 SKIPPED
⚠️ integration-amazon.aws-18 SKIPPED
⚠️ integration-amazon.aws-19 SKIPPED
⚠️ integration-amazon.aws-20 SKIPPED
⚠️ integration-amazon.aws-21 SKIPPED
⚠️ integration-amazon.aws-22 SKIPPED
⚠️ integration-community.aws-1 SKIPPED
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED
⚠️ integration-community.aws-14 SKIPPED
⚠️ integration-community.aws-15 SKIPPED
⚠️ integration-community.aws-16 SKIPPED
⚠️ integration-community.aws-17 SKIPPED
⚠️ integration-community.aws-18 SKIPPED
⚠️ integration-community.aws-19 SKIPPED
⚠️ integration-community.aws-20 SKIPPED
⚠️ integration-community.aws-21 SKIPPED
⚠️ integration-community.aws-22 SKIPPED

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit beeeccb into ansible-collections:main Nov 22, 2022
@tremble tremble deleted the refacter/inventories/connection branch February 15, 2023 09:06
abikouo pushed a commit to abikouo/amazon.aws that referenced this pull request Sep 18, 2023
Rename s3 modules

SUMMARY
In line with the naming guidelines, removes the aws_ prefix from aws_s3_bucket_info and aws_s3_cors
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
plugins/modules/aws_s3_bucket_info.py
plugins/modules/aws_s3_cors.py
plugins/modules/s3_bucket_info.py
plugins/modules/s3_cors.py
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>
abikouo pushed a commit to abikouo/amazon.aws that referenced this pull request Sep 18, 2023
Rename s3 modules

SUMMARY
In line with the naming guidelines, removes the aws_ prefix from aws_s3_bucket_info and aws_s3_cors
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
plugins/modules/aws_s3_bucket_info.py
plugins/modules/aws_s3_cors.py
plugins/modules/s3_bucket_info.py
plugins/modules/s3_cors.py
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Sep 29, 2023
Rename s3 modules

SUMMARY
In line with the naming guidelines, removes the aws_ prefix from aws_s3_bucket_info and aws_s3_cors
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
plugins/modules/aws_s3_bucket_info.py
plugins/modules/aws_s3_cors.py
plugins/modules/s3_bucket_info.py
plugins/modules/s3_cors.py
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@dd8b18e
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Oct 2, 2023
Rename s3 modules

SUMMARY
In line with the naming guidelines, removes the aws_ prefix from aws_s3_bucket_info and aws_s3_cors
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
plugins/modules/aws_s3_bucket_info.py
plugins/modules/aws_s3_cors.py
plugins/modules/s3_bucket_info.py
plugins/modules/s3_cors.py
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@dd8b18e
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Oct 2, 2023
Rename s3 modules

SUMMARY
In line with the naming guidelines, removes the aws_ prefix from aws_s3_bucket_info and aws_s3_cors
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
plugins/modules/aws_s3_bucket_info.py
plugins/modules/aws_s3_cors.py
plugins/modules/s3_bucket_info.py
plugins/modules/s3_cors.py
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@dd8b18e
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Oct 2, 2023
Rename s3 modules

SUMMARY
In line with the naming guidelines, removes the aws_ prefix from aws_s3_bucket_info and aws_s3_cors
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
plugins/modules/aws_s3_bucket_info.py
plugins/modules/aws_s3_cors.py
plugins/modules/s3_bucket_info.py
plugins/modules/s3_cors.py
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@dd8b18e
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Oct 6, 2023
Rename s3 modules

SUMMARY
In line with the naming guidelines, removes the aws_ prefix from aws_s3_bucket_info and aws_s3_cors
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
plugins/modules/aws_s3_bucket_info.py
plugins/modules/aws_s3_cors.py
plugins/modules/s3_bucket_info.py
plugins/modules/s3_cors.py
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@dd8b18e
abikouo pushed a commit to abikouo/amazon.aws that referenced this pull request Oct 24, 2023
Rename s3 modules

SUMMARY
In line with the naming guidelines, removes the aws_ prefix from aws_s3_bucket_info and aws_s3_cors
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
plugins/modules/aws_s3_bucket_info.py
plugins/modules/aws_s3_cors.py
plugins/modules/s3_bucket_info.py
plugins/modules/s3_cors.py
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community_review feature This issue/PR relates to a feature request has_issue inventory inventory plugin mergeit Merge the PR (SoftwareFactory) needs_triage new_plugin New plugin plugins plugin (any type) tests tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants