According to the docs aws modules should be run against localhost:

https://docs.ansible.com/ansible/latest/scenario_guides/guide_aws.html

Please try that.


Also running ansible as root is both unnecessary and unsafe. So once you
got things to work at all, take it a step further and fix that as well.


Dick


On Thu, 16 Apr 2020 at 05:33, Serin Abraham <[email protected]> wrote:

> root@master:~/playbook# cat create_s3.yml
> ---
> - hosts: ubuntu
>   remote_user: root
>   vars_files:
>   - keys.yml
>   tasks:
>   - name: create a s3 bucket
>     aws_s3:
>       aws_access_key: "{{ AWS_ACCESS_KEY_ID }}"
>       aws_secret_key: "{{ AWS_SECRET_ACCESS_KEY }}"
>       ec2_region: "{{ AWS_REGION }}"
>       bucket: serin
>       mode: create
>       permission: public-read
>
>   - name: upload a file to s3
>     aws_s3:
>       aws_access_key: "{{ AWS_ACCESS_KEY_ID }}"
>       aws_secret_key: "{{ AWS_SECRET_ACCESS_KEY }}"
>       ec2_region: "{{ AWS_REGION }}"
>       bucket: serin
>       mode: put
>       object: /serin.txt
>       src: /root/playbook/serin.txt
>       permission: public-read
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/4fe9a9b1-bd70-4739-a188-f72bdd84abbd%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/4fe9a9b1-bd70-4739-a188-f72bdd84abbd%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
-- 
Sent from a mobile device - please excuse the brevity, spelling and
punctuation.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwMmhkhJeYU3PwP3e%2B_AGxXCrAA7bVtiWXP2%3DRtqFcBGOw%40mail.gmail.com.

Reply via email to