Hi I actually did edit my original post yesterday with everything I am
doing. it is basic stuff, but since I have never really used Ansible much
but for a few adhoc tasks, it is just all I know.
Anyways, I was able to figure out how to create a bucket. doing this: now
this is not using roles. Yes, I do not really understand the structure of
roles yet but I will deal with that later.
How I got it to work cor creating the bucket. Note I was also able to get
the creation to work using the aws_s3 module also , but when I wanted to
add a policy I noticed I had to use the s3_bucket module.
---
# Create an S3 bucket using a policy
#
#
- hosts: localhost
gather_facts: no
connection: local
tasks:
- s3_bucket:
name: mybucket
policy: "{{ lookup( 'file','test_policy.json' )}}"
versioning: yes
tags:
Name: foo
Environment: bar
The json policy in my same CWD.
What I am trying to honestly do is find additional ways to manage our AWS
environment, I am curious if for a decent amount of day to day tasks we
can leverage Ansible.
On Mon, Feb 17, 2020 at 5:43 PM Angel Rengifo Cancino <[email protected]>
wrote:
> Hello:
>
> my role for learning is: s3-create.yml
>> - name: Create S3 Bucket
>> aws_s3:
>> bucket: my-bucket
>> mode: create
>> permission: private-read
>> region: us-east-1
>>
>> This piece of code looks good.
>
>> my playbook:
>> key_name: my-key
>> vpc_subnet_id: subnet-02439
>> roles:
>> - s3-create
>> assign_public_ip: yes
>> group: my-group
>>
>> This short piece of code looks wrong. Is it part of the same playbook or
> role? Did you remove the previous line of the task? Based on these few
> lines and your indentation I can't guess what are you trying to do. What
> module are you using?
>
>
>
>>
> when I run it, I get this:
>>
>> EntePLAY [Test creating ec2 instance with Ansible]
>> ***********************************************************************************
>>
>> TASK [Gathering Facts]
>> ***********************************************************************************************************
>> ok: [localhost]
>>
>> TASK [Start New ec2 Instance]
>> ****************************************************************************************************
>> fatal: [localhost]: FAILED! => {"changed": false, "msg": "Unsupported
>> parameters for (ec2) module: roles Supported parameters include:
>> assign_public_ip, aws_access_key, aws_secret_key, count, count_tag,
>> debug_botocore_endpoint_logs, ebs_optimized, ec2_url, exact_count, group,
>> group_id, id, image, instance_ids, instance_initiated_shutdown_behavior,
>> instance_profile_name, instance_tags, instance_type, kernel, key_name,
>> monitoring, network_interfaces, placement_group, private_ip, profile,
>> ramdisk, region, security_token, source_dest_check, spot_launch_group,
>> spot_price, spot_type, spot_wait_timeout, state, tenancy,
>> termination_protection, user_data, validate_certs, volumes, vpc_subnet_id,
>> wait, wait_timeout, zone"}
>>
>> PLAY RECAP
>> ***********************************************************************************************************************
>> localhost : ok=1 changed=0 unreachable=0
>> failed=1 skipped=0 rescued=0 ignored=0
>> r code here...
>>
>>
>> I guess you're trying to use the ec2_instance module, but we can see your
> hole code, so it's hard to help you
>
> Copy all your relevant lines from aws_s3 and ec2_instance modules here in
> your message so we can understand what's wrong.
>
>
> --
> 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/CAA3McK_Z29tq7uyXz99QZqWh5gPjMiv6nAvzT4SLPjSBuHCPDg%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAA3McK_Z29tq7uyXz99QZqWh5gPjMiv6nAvzT4SLPjSBuHCPDg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
--
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/CAAH6UtpbULQvPa1-Uz%2Bv-dCWr5dDvOrMSUz2WxiqVUoOzN_ZoQ%40mail.gmail.com.