mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Add aws_caller_facts module and use it in setup-iam.yml (#36683)
* Add aws_caller_facts module and use it in setup-iam.yml This removes the dependency on having the command line AWS tools installed.
This commit is contained in:
@@ -25,13 +25,12 @@
|
||||
when: iam_group is not defined
|
||||
|
||||
- name: Get aws account ID
|
||||
command: aws sts get-caller-identity --output text --query 'Account' "{{ '--profile=' ~ profile if profile else '' }}"
|
||||
changed_when: False
|
||||
register: aws_account_command
|
||||
aws_caller_facts:
|
||||
register: aws_caller_facts
|
||||
|
||||
- name: Set aws_account_fact
|
||||
set_fact:
|
||||
aws_account: "{{ aws_account_command.stdout }}"
|
||||
aws_account: "{{ aws_caller_facts.account }}"
|
||||
|
||||
|
||||
- name: Ensure Managed IAM policies exist
|
||||
|
||||
Reference in New Issue
Block a user