Skip to content

Commit

Permalink
Merge pull request ansible-collections#728 from tremble/rename/iam_cert
Browse files Browse the repository at this point in the history
Rename iam_cert to iam_server_certificate for consistency

SUMMARY
iam_cert (and what used to be known as iam_cert_facts) only deal with "server" certificates (AWS also has a CA cert offering in IAM)
with the big 2.9 _fact rename iam_cert_facts was renamed to iam_server_certificate_info.
(more tests and a migration to boto3 to follow)
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
iam_cert
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>
Reviewed-by: None <None>
  • Loading branch information
ansible-zuul[bot] committed Sep 23, 2021
2 parents f9654cf + df28789 commit 0954679
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 6 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/728-iam_cert.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
deprecated_features:
- iam_cert - the iam_cert module has been renamed to iam_server_certificate for consistency with the companion iam_server_certificate_info module.
The usage of the module has not changed. The iam_cert alias will be removed in version 4.0.0 (https://github.com/ansible-collections/community.aws/pull/728).
11 changes: 10 additions & 1 deletion meta/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ action_groups:
- elb_target_group_facts
- iam_mfa_device_facts
- iam_role_facts
- iam_cert_facts
- iam_server_certificate_facts
- lambda_facts
- rds_instance_facts
Expand Down Expand Up @@ -171,6 +172,7 @@ action_groups:
- iam_role
- iam_role_info
- iam_saml_federation
- iam_server_certificate
- iam_server_certificate_info
- iam_user
- iam_user_info
Expand Down Expand Up @@ -448,7 +450,7 @@ plugin_routing:
deprecation:
removal_date: 2021-12-01
warning_text: >-
iam_cert_facts was renamed in Ansible 2.9 to iam_cert_info.
iam_cert_facts was renamed in Ansible 2.9 to iam_server_certificate_info.
Please update your tasks.
iam_mfa_device_facts:
deprecation:
Expand All @@ -462,6 +464,13 @@ plugin_routing:
warning_text: >-
iam_role_facts was renamed in Ansible 2.9 to iam_role_info.
Please update your tasks.
iam_cert:
redirect: community.aws.iam_server_certificate
deprecation:
removal_version: 4.0.0
warning_text: >-
iam_cert has been renamed to iam_server_certificate for consistency.
Please update your tasks.
iam_server_certificate_facts:
deprecation:
removal_date: 2021-12-01
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

DOCUMENTATION = '''
---
module: iam_cert
module: iam_server_certificate
version_added: 1.0.0
short_description: Manage server certificates for use on ELBs and CloudFront
description:
Expand Down Expand Up @@ -85,23 +85,23 @@

EXAMPLES = '''
- name: Basic server certificate upload from local file
community.aws.iam_cert:
community.aws.iam_server_certificate:
name: very_ssl
state: present
cert: "{{ lookup('file', 'path/to/cert') }}"
key: "{{ lookup('file', 'path/to/key') }}"
cert_chain: "{{ lookup('file', 'path/to/certchain') }}"
- name: Basic server certificate upload
community.aws.iam_cert:
community.aws.iam_server_certificate:
name: very_ssl
state: present
cert: path/to/cert
key: path/to/key
cert_chain: path/to/certchain
- name: Server certificate upload using key string
community.aws.iam_cert:
community.aws.iam_server_certificate:
name: very_ssl
state: present
path: "/a/cert/path/"
Expand All @@ -110,7 +110,7 @@
cert_chain: body_of_myverytrustedchain
- name: Basic rename of existing certificate
community.aws.iam_cert:
community.aws.iam_server_certificate:
name: very_ssl
new_name: new_very_ssl
state: present
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/targets/iam_server_certificate/aliases
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cloud/aws

iam_server_certificate_info
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dependencies:
- prepare_tests
- setup_remote_tmp_dir
34 changes: 34 additions & 0 deletions tests/integration/targets/iam_server_certificate/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
# iam_server_certificate integration tests
#
# Current module limitations:
#
- module_defaults:
group/aws:
aws_access_key: '{{ aws_access_key }}'
aws_secret_key: '{{ aws_secret_key }}'
security_token: '{{ security_token | default(omit) }}'
region: '{{ aws_region }}'
block:
# Check that the alias works
- iam_cert: {}
ignore_errors: true
register: iam_cert_alias

- iam_server_certificate: {}
ignore_errors: true
register: no_args

- assert:
that:
- iam_cert_alias is failed
- no_args is failed
- no_args.msg == iam_cert_alias.msg
- no_args.msg.startswith('missing required arguments')

always:
- debug: msg=test

################################################
# TEARDOWN STARTS HERE
################################################

0 comments on commit 0954679

Please sign in to comment.