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.

Reply via email to