Hi Сергей Жеревчук,
I usually pass my policy as a json file which I store under the files directory, please see my directory structure below:
files/
policies/
policy.json
main.yml
In my playbook I reference the file like so:
- name: Create and attach IAM policy to IAM role
iam_policy:
iam_type: role
aws_access_key: "{{ aws_access_key_id }}"
aws_secret_key: "{{ aws_secret_access_key }}"
iam_name: iam-role
policy_name: new-policy-name
state: present
policy_document: "files/policies/linux-standard.json"
This works for me :)
I hope that helps.