Platform/OS
Linux, macOS, Windows
Category
Infrastructure as Code
Ansible
Ansible (Red Hat) is an open-source automation platform. It stores playbooks, roles, artifacts, and dynamic inventory directly in S3-compatible buckets with full versioning, access control, and encryption support. It lets you manage and update many computers and servers from one central place. In everyday terms, it works like a smart remote control that can install software, change settings, or fix problems across dozens or hundreds of machines without you touching each one manually.
It uses S3-compatible object storage as a reliable shared library to keep playbooks, configuration files, and scripts so every computer can quickly grab the latest instructions it needs. This storage makes Ansible more powerful by letting teams safely share and version-control their automation recipes from anywhere without worrying about losing files. Overall it saves huge amounts of time and reduces mistakes by turning repetitive IT chores into simple, repeatable actions powered by rock-solid cloud storage.
Connection / Setup
- Create an account and log in to DiskSpace
- Click I'm ready to set up my storage
- Enter Bucket Name following the instructions
- Click Create Bucket and wait for it to be generated
- Find your Endpoint URL, Access Key, and Secret Key in the S3 Client Configuration section for use below
Connecting Ansible to DiskSpace.sh (S3-compatible storage)
Follow these steps to configure Ansible to use DiskSpace.sh as your S3-compatible object storage backend.
Connection Steps:
- Install the required collection if not already present:
ansible-galaxy collection install amazon.aws - Create or update your
ansible.cfgor environment variables with the credentials below. - Use the
aws_s3ors3modules with the configuration shown.
Credential Fields
Region: Can be left empty or set to
us-east-1
Path Style Requests (Required)
DiskSpace.sh requires path-style requests. The format is:
https://s3.diskspace.sh/bucket-name/key
Example Configuration
[defaults]
aws_access_key = YOUR_ACCESS_KEY_ID
aws_secret_key = YOUR_SECRET_ACCESS_KEY
[aws]
s3_url = https://s3.diskspace.sh
s3_use_path_style = true
region = us-east-1
Example Ansible Task
- name: Upload file to DiskSpace.sh
amazon.aws.s3_object:
bucket: my-bucket
object: path/to/file.txt
src: ./file.txt
mode: put
endpoint_url: https://s3.diskspace.sh
aws_access_key: "{{ lookup('env', 'AWS_ACCESS_KEY_ID') }}"
aws_secret_key: "{{ lookup('env', 'AWS_SECRET_ACCESS_KEY') }}"
use_path_style: true
region: us-east-1
Troubleshooting
- Ensure
use_path_style: true(ors3_use_path_style = true) is set - Do not include the bucket name in the endpoint URL
- If you receive signature errors, verify your Access Key and Secret Key
- Set
region: us-east-1if you experience region-related issues - Use the latest version of the
amazon.awscollection