Open marcelmamula opened 2 months ago
Issue still persists with latest version:
amazon.aws 8.0.1
Log output
TASK [/mnt/c/scripts/community.sap_infrastructure/roles/sap_vm_provision : AWS IAM Role - HA-Role-Pacemaker] ************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible_collections.amazon.aws.plugins.module_utils.iam.AnsibleIAMError: Failed to create instance profile: An error occurred (EntityAlreadyExists) when calling the CreateInstanceProfile operation: Instance Profile HA-Role-Pacemaker already exists.
in a release after 2026-05-01. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
fatal: [pr2hana0 -> localhost]: FAILED! => {"boto3_version": "1.34.97", "botocore_version": "1.34.97", "changed": false, "error": {"code": "EntityAlreadyExists", "message": "Instance Profile HA-Role-Pacemaker already exists.", "type": "Sender"}, "msg": "Failed to create instance profile: An error occurred (EntityAlreadyExists) when calling the CreateInstanceProfile operation: Instance Profile HA-Role-Pacemaker already exists.", "response_metadata": {"http_headers": {"content-length": "301", "content-type": "text/xml", "date": "Wed, 26 Jun 2024 10:34:26 GMT", "x-amzn-requestid": "X-5e4f-4438-a912-f39dcfb56774"}, "http_status_code": 409, "request_id": "X-5e4f-4438-a912-f39dcfb56774", "retry_attempts": 0}}
Summary
I have been using 7.3.0 collection for some time, but it stopped working with upgrade to 7.5.0. amazon.aws.iam_role is no longer able to ignore already existing entries and it fails with
Issue Type
Bug Report
Component Name
amazon.aws.iam_role
Ansible Version
Collection Versions
AWS SDK versions
Configuration
OS / Environment
SLES for SAP 15 SP3 SLES for SAP 15 SP5 openSUSE Tumbleweed
Steps to Reproduce
https://github.com/sap-linuxlab/community.sap_infrastructure/blob/0e67afc14738c8731192ef9f5040496c4a96e9b1/roles/sap_vm_provision/tasks/platform_ansible/aws_ec2_vs/execute_setup_ha.yml#L257
Expected Results
IAM role HA-Role-Pacemaker is created.
Actual Results
Code of Conduct