Ansible
Learn how to configure Ansible for use with Filebase.

What is Ansible?

Ansible is an open-source automation tool that automates processes such as application deployment, resource provisioning, software installs, and daily tasks. Ansible is available on UNIX-like systems, such as macOS X and Linux distributions.
Read below to learn how to use Ansible with Filebase.

Prerequisites:

Use the following commands to interact with Filebase using Ansible:

Create a Bucket:

ansible -i inv_local localhost -m aws_s3 -a "bucket=NEW_FILEBASE_BUCKET_NAME s3_url=https://s3.filebase.com mode=create region=us-east-1 aws_access_key=FILEBASE_ACCESS_KEY aws_secret_key=FILEBASE_SECRET_KEY"

List all objects inside a bucket:

ansible -i inv_local localhost -m aws_s3 -a "bucket=FILEBASE_BUCKET_NAME s3_url=https://s3.filebase.com mode=list region=us-east-1 aws_access_key=FILEBASE_ACCESS_KEY aws_secret_key=FILEBASE_SECRET_KEY"

Download Files from a Bucket:

ansible -i inv_local localhost -m aws_s3 -a "bucket=FILEBASE_BUCKET_NAME s3_url=https://s3.filebase.com mode=get region=us-east-1 aws_access_key=FILEBASE_ACCESS_KEY aws_secret_key=FILEBASE_SECRET_KEY object=FILEBASE_BUCKET_NAME/OBJECT_NAME dest=/path/to/download/to"

Upload Files to a Bucket:

ansible -i inv_local localhost -m aws_s3 -a "bucket=FILEBASE_BUCKET_NAME s3_url=https://s3.filebase.com mode=put region=us-east-1 aws_access_key=FILEBASE_ACCESS_KEY aws_secret_key=FILEBASE_SECRET_KEY object=FILEBASE_BUCKET_NAME/OBJECT_NAME src=/path/to/object/to/upload/”

Delete All Files from a Bucket:

ansible -i inv_local localhost -m aws_s3 -a "bucket=FILEBASE_BUCKET_NAME s3_url=https://s3.filebase.com mode=delete region=us-east-1 aws_access_key=FILEBASE_ACCESS_KEY aws_secret_key=FILEBASE_SECRET_KEY"

Delete Specific Objects Inside a Bucket

ansible -i inv_local localhost -m aws_s3 -a ""bucket=FILEBASE_BUCKET_NAME s3_url=https://s3.filebase.com mode=delete region=us-east-1 aws_access_key=FILEBASE_ACCESS_KEY aws_secret_key=FILEBASE_SECRET_KEY object=Object.png"
If you have any questions, please join our Discord server, or send us an email at [email protected]
Copy link
On this page
What is Ansible?
Create a Bucket:
List all objects inside a bucket:
Download Files from a Bucket:
Upload Files to a Bucket:
Delete All Files from a Bucket:
Delete Specific Objects Inside a Bucket