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.
Use the following commands to interact with Filebase using Ansible:
Create a New Bucket
Replace the following values:
Bucket: New Filebase bucket name
Aws_access_key: Filebase Access Key
Aws_secret_key: Filebase Secret Key
ansible -i inv_local localhost -m aws_s3 -a "bucket=filebase-bucket s3_url=https://s3.filebase.com mode=create region=us-east-1 aws_access_key=<Filebase-Access-Key> aws_secret_key=<Filebase-Secret-Key>"
Expected Result:
List All Objects in a Bucket
Replace the following values:
Bucket: Filebase bucket name
Aws_access_key: Filebase Access Key
Aws_secret_key: Filebase Secret Key
ansible -i inv_local localhost -m aws_s3 -a "bucket=filebase-bucket s3_url=https://s3.filebase.com mode=list region=us-east-1 aws_access_key=<Filebase-Access-Key> aws_secret_key=<Filebase-Secret-Key>"
Expected Result:
Download Files From a Bucket:
Replace the following values:
Bucket: Filebase bucket name
Aws_access_key: Filebase Access Key
Aws_secret_key: Filebase Secret Key
Object: Name of object to download
Dest: Local download destination path
ansible -i inv_local localhost -m aws_s3 -a "bucket=filebase-bucket 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/image.png dest=/Users/Filebase/image.png"
Expected Result:
Upload Objects To a Bucket:
Replace the following values:
Bucket: Filebase bucket name
Aws_access_key: Filebase Access Key
Aws_secret_key: Filebase Secret Key
Object: Name of object to upload
Src: Local path to source object
ansible -i inv_local localhost -m aws_s3 -a "bucket=filebase-bucket 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=image.png src=/Users/Filebase/image.png"
Expected Result:
Delete All Files From a Bucket
Replace the following values:
Bucket: Filebase bucket name
Aws_access_key: Filebase Access Key
Aws_secret_key: Filebase Secret Key
ansible -i inv_local localhost -m aws_s3 -a "bucket=filebase-bucket s3_url=https://s3.filebase.com mode=delete region=us-east-1 aws_access_key=<Filebase-Access-Key> aws_secret_key=<Filebase-Secret-Key>"
Expected Result:
Delete an Individual Object In a Bucket
Replace the following values:
Bucket: Filebase bucket name
Aws_access_key: Filebase Access Key
Aws_secret_key: Filebase Secret Key
Object: Object to delete
ansible -i inv_local localhost -m aws_s3 -a "bucket=filebase-bucket 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=image.png"
Expected Result:
Last updated