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

inventory aws_ec2 - assume role using iam_role_arn parameter to describe regions #624

Merged

Conversation

abikouo
Copy link
Contributor

@abikouo abikouo commented Jan 19, 2022

SUMMARY

This is a proposal to solve #566

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

aws_ec2

@softwarefactory-project-zuul
Copy link
Contributor

@abikouo
Copy link
Contributor Author

abikouo commented Jan 19, 2022

recheck

@softwarefactory-project-zuul
Copy link
Contributor

@abikouo
Copy link
Contributor Author

abikouo commented Jan 20, 2022

recheck

@softwarefactory-project-zuul
Copy link
Contributor

@abikouo
Copy link
Contributor Author

abikouo commented Jan 20, 2022

recheck

@softwarefactory-project-zuul
Copy link
Contributor

@abikouo
Copy link
Contributor Author

abikouo commented Jan 21, 2022

recheck

@softwarefactory-project-zuul
Copy link
Contributor

@ansibullbot ansibullbot added community_review feature This issue/PR relates to a feature request has_issue inventory inventory plugin needs_triage plugins plugin (any type) labels Jan 27, 2022
Copy link
Contributor

@alinabuzachis alinabuzachis left a comment

Choose a reason for hiding this comment

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

@abikouo Thank you for taking time to work on this. LGTM. I was just wondering if you could add a unit test.

@abikouo
Copy link
Contributor Author

abikouo commented Feb 7, 2022

recheck

@softwarefactory-project-zuul
Copy link
Contributor

@abikouo
Copy link
Contributor Author

abikouo commented Feb 16, 2022

@abikouo Thank you for taking time to work on this. LGTM. I was just wondering if you could add a unit test.

Hi @alinabuzachis this is not a good candidate for unit testing as this will need to create a lot of mock objects to simply capture an exception, I would rather go for integration testing but I am missing authorization to create an IAM role, for the time being, this can be merged like this.

@softwarefactory-project-zuul
Copy link
Contributor

@abikouo
Copy link
Contributor Author

abikouo commented Feb 16, 2022

recheck

@softwarefactory-project-zuul
Copy link
Contributor

@abikouo
Copy link
Contributor Author

abikouo commented Feb 23, 2022

recheck

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@alinabuzachis
Copy link
Contributor

@abikouo I guess there is an issue with the requirements for units in general.

2022-02-23 09:24:51.345399 \| controller \| ==================================== ERRORS ====================================
--
1965 | 2022-02-23 09:24:51.345403 \| controller \| ________________________ ERROR collecting test session _________________________
1966 | 2022-02-23 09:24:51.345407 \| controller \| ImportError while importing test module '/usr/share/ansible/collections/ansible_collections/amazon/aws/tests/unit/plugins/modules/test_ec2_vpc_dhcp_option.py'.
1967 | 2022-02-23 09:24:51.345411 \| controller \| Hint: make sure your test modules/packages have valid Python names.
1968 | 2022-02-23 09:24:51.345414 \| controller \| Traceback:
1969 | 2022-02-23 09:24:51.345417 \| controller \| /usr/lib64/python3.8/importlib/__init__.py:127: in import_module
1970 | 2022-02-23 09:24:51.345420 \| controller \|     return _bootstrap._gcd_import(name[level:], package, level)
1971 | 2022-02-23 09:24:51.345424 \| controller \| /tmp/ansible-test-fppp5phd/ansible/utils/collection_loader/_collection_finder.py:402: in load_module
1972 | 2022-02-23 09:24:51.345427 \| controller \|     exec(code_obj, module.__dict__)
1973 | 2022-02-23 09:24:51.345430 \| controller \| tests/unit/plugins/modules/test_ec2_vpc_dhcp_option.py:10: in <module>
1974 | 2022-02-23 09:24:51.345433 \| controller \|     from ansible_collections.amazon.aws.tests.unit.utils.amazon_placebo_fixtures import placeboify  # pylint: disable=unused-import
1975 | 2022-02-23 09:24:51.345437 \| controller \| E   ImportError: cannot import name 'placeboify' from 'ansible_collections.amazon.aws.tests.unit.utils.amazon_placebo_fixtures' (/usr/share/ansible/collections/ansible_collections/amazon/aws/tests/unit/utils/amazon_placebo_fixtures.py)
1976 | 2022-02-23 09:24:51.345440 \| controller \| - generated xml file: /usr/share/ansible/collections/ansible_collections/amazon/aws/tests/output/junit/python3.8-modules-units.xml -
1977 | 2022-02-23 09:24:51.345443 \| controller \| =========================== short test summary info ============================
1978 | 2022-02-23 09:24:51.345447 \| controller \| SKIPPED [1] tests/unit/plugins/modules/test_aws_s3.py:16: could not import 'boto3': No module named 'urllib3.packages.six'
1979 | 2022-02-23 09:24:51.345450 \| controller \| SKIPPED [1] tests/unit/utils/amazon_placebo_fixtures.py:10: could not import 'boto3': No module named 'urllib3.packages.six'
1980 | 2022-02-23 09:24:51.345454 \| controller \| ERROR ../../../../../../local/lib/python3.8/site-packages/ansible_test/_data
1981 | 2022-02-23 09:24:51.345457 \| controller \| ==================== 3 passed, 2 skipped, 1 error in 0.60s =====================
1982 | 2022-02-23 09:24:51.378895 \| controller \| ERROR: Command "pytest --forked -r a -n auto --color no -p no:cacheprovider -c /usr/local/lib/python3.8/site-packages/ansible_test/_data/pytest.ini --junit-xml /usr/share/ansible/collections/ansible_collections/amazon/aws/tests/output/junit/python3.8-modules-units.xml --strict-markers tests/unit/plugins/modules/test_aws_s3.py tests/unit/plugins/modules/test_cloudformation.py tests/unit/plugins/modules/test_ec2_group.py tests/unit/plugins/modules/test_ec2_vpc_dhcp_option.py" returned exit status 1.
1983 | 2022-02-23 09:24:52.009133 \| controller \| ERROR
1984 | 2022-02-23 09:24:52.009385 \| controller \| {
1985 | 2022-02-23 09:24:52.009424 \| controller \|   "delta": "0:00:01.556021",
1986 | 2022-02-23 09:24:52.009453 \| controller \|   "end": "2022-02-23 09:24:51.480333",
1987 | 2022-02-23 09:24:52.009479 \| controller \|   "msg": "non-zero return code",
1988 | 2022-02-23 09:24:52.009505 \| controller \|   "rc": 1,
1989 | 2022-02-23 09:24:52.009531 \| controller \|   "start": "2022-02-23 09:24:49.924312"
1990 | 2022-02-23 09:24:52.009555 \| controller \| }

…ssume the role before trying to call DescribeRegions
@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@alinabuzachis
Copy link
Contributor

recheck

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@alinabuzachis alinabuzachis added backport-3 PR should be backported to the stable-3 branch backport-2 PR should be backported to the stable-2 branch labels Mar 22, 2022
@abikouo abikouo added the mergeit Merge the PR (SoftwareFactory) label Mar 22, 2022
@abikouo abikouo requested a review from markuman March 22, 2022 10:07
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 56e6e69 into ansible-collections:main Mar 22, 2022
@patchback
Copy link

patchback bot commented Mar 22, 2022

Backport to stable-2: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-2/56e6e69f0fdfb37c04f69bce0c1659a73c4184da/pr-624

Backported as #725

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Mar 22, 2022
…ibe regions (#624)

inventory aws_ec2 - assume role using iam_role_arn parameter to describe regions

SUMMARY

This is a proposal to solve #566

ISSUE TYPE

Feature Pull Request

COMPONENT NAME

aws_ec2

Reviewed-by: Alina Buzachis <None>
Reviewed-by: Markus Bergholz <[email protected]>
(cherry picked from commit 56e6e69)
@patchback
Copy link

patchback bot commented Mar 22, 2022

Backport to stable-3: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-3/56e6e69f0fdfb37c04f69bce0c1659a73c4184da/pr-624

Backported as #726

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Mar 22, 2022
…ibe regions (#624)

inventory aws_ec2 - assume role using iam_role_arn parameter to describe regions

SUMMARY

This is a proposal to solve #566

ISSUE TYPE

Feature Pull Request

COMPONENT NAME

aws_ec2

Reviewed-by: Alina Buzachis <None>
Reviewed-by: Markus Bergholz <[email protected]>
(cherry picked from commit 56e6e69)
softwarefactory-project-zuul bot pushed a commit that referenced this pull request Mar 22, 2022
…ibe regions (#624) (#725)

[PR #624/56e6e69f backport][stable-2] inventory aws_ec2 - assume role using iam_role_arn parameter to describe regions

This is a backport of PR #624 as merged into main (56e6e69).
SUMMARY

This is a proposal to solve #566

ISSUE TYPE


Feature Pull Request

COMPONENT NAME

aws_ec2
softwarefactory-project-zuul bot pushed a commit that referenced this pull request Mar 23, 2022
…ibe regions (#624) (#726)

[PR #624/56e6e69f backport][stable-3] inventory aws_ec2 - assume role using iam_role_arn parameter to describe regions

This is a backport of PR #624 as merged into main (56e6e69).
SUMMARY

This is a proposal to solve #566

ISSUE TYPE


Feature Pull Request

COMPONENT NAME

aws_ec2
@abikouo abikouo deleted the aws_ec2_iam_role branch October 20, 2023 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-2 PR should be backported to the stable-2 branch backport-3 PR should be backported to the stable-3 branch community_review feature This issue/PR relates to a feature request has_issue inventory inventory plugin mergeit Merge the PR (SoftwareFactory) plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants