Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

s3_object fails to create empty bucket as per ansible example #1799

Closed
1 task done
modono299 opened this issue Oct 12, 2023 · 1 comment
Closed
1 task done

s3_object fails to create empty bucket as per ansible example #1799

modono299 opened this issue Oct 12, 2023 · 1 comment

Comments

@modono299
Copy link

modono299 commented Oct 12, 2023

Summary

When I try to create an empty bucket using s3_object specifying mode: create I get an error that object needs to be set
https://docs.ansible.com/ansible/latest/collections/amazon/aws/s3_object_module.html#examples

Issue Type

Bug Report

Component Name

s3_object

Ansible Version

$ ansible --version
ansible [core 2.15.5]
  config file = /home/thisuser/s3-test/ansible.cfg
  configured module search path = [' /home/thisuser/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/thisuser/.venvs/s3-test/lib/python3.10/site-packages/ansible
  ansible collection location = /home/thisuser/s3-test/collections
  executable location = /home/thisuser/.venvs/s3-test/bin/ansible
  python version = 3.10.6 (main, Mar 10 2023, 10:55:28) [GCC 11.3.0] (/home/thisuser/.venvs/s3-test/bin/python3)
  jinja version = 3.1.2
  libyaml = True

Collection Versions

$ ansible-galaxy collection list
ansible-galaxy collection list

# /home/thisuser/.venvs/s3-test/lib/python3.10/site-packages/ansible_collections
Collection                    Version
----------------------------- -------
amazon.aws                    6.4.0  
community.aws                 6.3.0  

# /home/thisuser/s3-test/collections/ansible_collections
Collection                    Version
----------------------------- -------
amazon.aws                    6.5.0
community.aws                 6.3.0

AWS SDK versions

$ pip show boto boto3 botocore
WARNING: Package(s) not found: boto
Name: boto3
Version: 1.28.62
Summary: The AWS SDK for Python
Home-page: https://github.com/boto/boto3
Author: Amazon Web Services
Author-email: 
License: Apache License 2.0
Location: /home/thisuser/.venvs/s3-test/lib/python3.10/site-packages
Requires: botocore, jmespath, s3transfer
Required-by: 
---
Name: botocore
Version: 1.31.62
Summary: Low-level, data-driven core of boto 3.
Home-page: https://github.com/boto/botocore
Author: Amazon Web Services
Author-email: 
License: Apache License 2.0
Location: /home/thisuser/.venvs/s3-test/lib/python3.10/site-packages
Requires: jmespath, python-dateutil, urllib3
Required-by: boto3, s3transfer

Configuration

$ ansible-config dump --only-changed
COLLECTIONS_PATHS(/home/thisuser/s3-test/ansible.cfg) = ['/home/thisuser/s3-test/collections']
CONFIG_FILE() = /home/thisuser/s3-test/ansible.cfg
DEFAULT_HOST_LIST(/home/thisuser/s3-test/ansible.cfg) = ['/home/thisuser/s3-test/environments/staging/hosts.yml']
DEFAULT_ROLES_PATH(/home/thisuser/s3-test/ansible.cfg) = ['/home/thisuser/s3-test/roles']

OS / Environment

Ubuntu 22 ( wsl)

Steps to Reproduce

- name: Create an empty bucket
  amazon.aws.s3_object:
    bucket: mybucket
    mode: create
    permission: public-read

Expected Results

I expect that the empty s3 bucket is created without an error message for object to be set

Actual Results

    "msg": "mode is create but all of the following are missing: object"

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@tremble
Copy link
Contributor

tremble commented Oct 12, 2023

Thanks for taking the time to submit this issue.

s3_object no longer supports creating/deleting buckets. Support was removed in 6.0.0. The example is outdated, please use the s3_bucket module to create buckets. https://docs.ansible.com/ansible/latest/collections/amazon/aws/s3_bucket_module.html#examples

I've opened #1800 to correct the documentation.

@tremble tremble closed this as completed Oct 12, 2023
abikouo pushed a commit to abikouo/amazon.aws that referenced this issue Oct 24, 2023
…llections#1799)

* Add sanity, linters, changelog and units workflows

Signed-off-by: Alina Buzachis <[email protected]>

* Delete black.yml

Signed-off-by: Alina Buzachis <[email protected]>

* Update references

Signed-off-by: Alina Buzachis <[email protected]>

* Remove linters job

Signed-off-by: Alina Buzachis <[email protected]>

* Add missing tox.ini file

Signed-off-by: Alina Buzachis <[email protected]>

* Apply black on plugins/modules/cloudfront_distribution.py

Signed-off-by: Alina Buzachis <[email protected]>

* Update tox.ini

Signed-off-by: Alina Buzachis <[email protected]>

* Fix units

Signed-off-by: Alina Buzachis <[email protected]>

---------

Signed-off-by: Alina Buzachis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants