DEBOPS.MCLI(5)

NAME
debops.mcli - Install MinIO Client using Ansible

SYNOPSIS

debops service/mcli [--limit group,host,...] [--diff] [--check] [--tags tag1,tag2,...] [--skip-tags tag1,tag2,...] [<ansible-playbook options>] ...

DESCRIPTION

MinIO <https://min.io/> is an Open Source Amazon Simple Storage Service (S3) compatible object storage service. The MinIO Client <https://docs.min.io/docs/minio-client-complete-guide> application is used to interface with MinIO and perform various administrative tasks, including extended configuration of the service.

The debops.mcli Ansible role installs MinIO Client binary on a Debian or Ubuntu host either by downloading and verifying it from the upstream repository directly, or cloning the source code and building it locally.

The MinIO Client binary will be installed as the mcli binary instead of the mc binary preferred by upstream to avoid clashing with the mc Debian package which provides Midnight Commander. This solution is suggested by upstream <https://github.com/minio/mc/blob/master/CONFLICT.md> as well.

You can use the debops.minio Ansible role to install and configure the MinIO service itself.

GETTING STARTED

  Default installation and upgrades

The role will install the latest MinIO Client release available by default. After that, the selected release will be "locked" via the Ansible local facts, and normal execution of the debops.mcli role will not upgrade an existing installation.

To perform an upgrade, you can use the following command:

debops service/mcli -l <host|group> -t role::golang \
                    -e 'mcli__upstream_upgrade=true'

This command will execute the debops.golang Ansible role in the context of the service/mcli playbook and perform the upgrade of MinIO Client binary if a new release is found.

If you want to perform upgrades automatically when the role is executed when they are available, you can set the mcli__upstream_upgrade variable to True in the Ansible inventory.

The previously downloaded MinIO Client releases are currently not removed automatically, therefore make sure that you clean up the ~_golang/go/src/ directory managed by the debops.golang role from time to time.

  Dependent role usage

The debops.mcli role is focused on configuration of the MinIO Client install parameters, and relies on other DebOps roles for the actual installation:

•   The debops.golang role is used to download and verify MinIO Client binary, or clone the MinIO Client source code and build the binary locally.

•   The debops.keyring role is used by the debops.golang role to fetch and import the MinIO Client GPG signing key used to verify the MinIO Client binaries or source code.

    See the provided Ansible playbook for the order of the roles and usage of the dependent role variables. Without the mentioned DebOps roles and services managed by them, debops.mcli role alone will not deploy the MinIO Client correctly.

  Example inventory

To configure MinIO Client on a host, it needs to be added to the [debops_service_mcli] Ansible inventory group:

[debops_service_mcli]
hostname

  Example playbook

If you are using this role without DebOps, here's an example Ansible playbook that uses the debops.mcli role:

---
- name: Manage MinIO Client (mcli) installation
  collections: [ 'debops.debops', 'debops.roles01',
                 'debops.roles02', 'debops.roles03' ]
  hosts: [ 'debops_service_mcli' ]
  become: True
  environment: '{{ inventory__environment | d({})
                   | combine(inventory__group_environment | d({}))
                   | combine(inventory__host_environment  | d({})) }}'
  pre_tasks:
    - name: Prepare mcli environment
      import_role:
        name: 'mcli'
        tasks_from: 'main_env'
      tags: [ 'role::mcli', 'role::keyring', 'role::golang' ]
  roles:
    - role: keyring
      tags: [ 'role::keyring', 'skip::keyring', 'role::golang' ]
      keyring__dependent_gpg_user: '{{ golang__keyring__dependent_gpg_user }}'
      keyring__dependent_gpg_keys:
        - '{{ golang__keyring__dependent_gpg_keys }}'
      golang__dependent_packages:
        - '{{ mcli__golang__dependent_packages }}'
    - role: apt_preferences
      tags: [ 'role::apt_preferences', 'skip::apt_preferences' ]
      apt_preferences__dependent_list:
        - '{{ golang__apt_preferences__dependent_list }}'
    - role: golang
      tags: [ 'role::golang', 'skip::golang' ]
      golang__dependent_packages:
        - '{{ mcli__golang__dependent_packages }}'
    - role: mcli
      tags: [ 'role::mcli', 'skip::mcli' ]

  Ansible tags

You can use Ansible --tags or --skip-tags parameters to limit what tasks are performed during Ansible run. This can be used after a host was first configured to speed up playbook execution, when you are sure that most of the configuration is already in the desired state.

Available role tags:

role::mcli
    Main role tag, should be used in the playbook to execute all of the role tasks as well as role dependencies.

  Other resources

List of other useful resources related to the debops.mcli Ansible role:

•   MinIO documentation <https://docs.min.io/>

AUTHOR
Maciej Delmanowski

COPYRIGHT
2014-2022, Maciej Delmanowski, Nick Janetakis, Robin Schneider and others