Table of Contents

In this post, we look at how we can interface with MinIO and download a file from it.

Ansible has the aws_s3 module which does exactly what we need and can be used to interface with minio.

Example to get a file from minio:

- name: download from minio
  aws_s3:
    s3_url: "{{m_host}}"
    bucket: "{{m_bucket}}"
    object: "{{m_object}}"
    dest: "{{m_dest}}"
    mode: get
    aws_access_key: "{{m_access_key}}"
    aws_secret_key: "{{m_secret_key}}"

Important: you’re minio url might be https and therefore require SSL, however, if you don’t want to have to supply a cert, set the validate_certs attribute to: validate_certs: no

Top Tip #1: if you specify a non-existent folder on the dest attribute, you will get a SSL error which is completely irrelevant to the actual error!

Top Tip #2 you should encrypt your secret and access keys. Use Ansible Vault! See this tutorial

Reagrds,

John