Ansible iam_managed_policy - Manage User Managed IAM policies
$30-250 USD
W trakcie realizacji
Opublikowano ponad 5 lat temu
$30-250 USD
Płatne przy odbiorze
I am trying to create an AWS IAM policy via Ansible playbook. Ref: [login to view URL]
I can successfully create the policy using:
- name: Create IAM Managed Policy
iam_managed_policy:
policy_name: "ManagedPolicy"
policy_description: "A Helpful managed policy"
policy: "{{ lookup('template', '[login to view URL]') }}"
state: present
I can delete the policy with:
# Remove a policy
- name: Create IAM Managed Policy
iam_managed_policy:
policy_name: "ManagedPolicy"
state: absent
But I want to create the policy without having to use policy: "{{ lookup('template', '[login to view URL]') }}".
Instead, I want to use something like the 4th example but I will not work.
# Update a policy and make it the only version and the default version
- name: Create IAM Managed Policy
iam_managed_policy:
policy_name: "ManagedPolicy"
policy: "{ 'Version': '2012-10-17', 'Statement':[{'Effect': 'Allow','Action': '*','Resource': '*'}]}"
only_version: true
state: present
I want to add my value as one long line like the above. Please let me know if this is possible. Otherwise, other than creating the file in the directory I am running my playbook from, please let me know if there is a better way. I can do this from the console and cli already... I want to use Ansilble.