Skip to content

Commit

Permalink
update playbook
Browse files Browse the repository at this point in the history
  • Loading branch information
harshavardhana committed Aug 22, 2020
1 parent 15ad3a3 commit 0daa2f6
Show file tree
Hide file tree
Showing 22 changed files with 103 additions and 230 deletions.
38 changes: 0 additions & 38 deletions .travis.yml

This file was deleted.

71 changes: 0 additions & 71 deletions .travis/releaser.sh

This file was deleted.

2 changes: 1 addition & 1 deletion .yamllint
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
extends: default

ignore: |
.tox/
.travis/
.travis.yml
meta/

rules:

# Disable line-length and truthy values reporting
line-length: disable
truthy: disable
Expand Down
1 change: 1 addition & 0 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Maintainers of this repository:

* Harshavardhana <[email protected]> @harshavardhana
* Andrea Tosatto <[email protected]> @atosatto
* Pawel Krupa <[email protected]> @paulfantom
* Ben Kochie <[email protected]> @SuperQ
49 changes: 23 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<p><img src="https://avatars0.githubusercontent.com/u/695951?s=200&v=4" alt="minio logo" title="minio" align="right" height="60" /></p>

# Ansible Role: Minio
# Ansible Role: MinIO

[![Build Status](https://travis-ci.org/atosatto/ansible-minio.svg?branch=master)](https://travis-ci.org/atosatto/ansible-minio)
[![License](https://img.shields.io/badge/license-MIT%20License-brightgreen.svg)](https://opensource.org/licenses/MIT)
[![Ansible Role](https://img.shields.io/badge/ansible%20role-atosatto.minio-blue.svg)](https://galaxy.ansible.com/atosatto/minio/)
[![GitHub tag](https://img.shields.io/github/tag/atosatto/ansible-minio.svg)](https://github.com/atosatto/ansible-minio/tags)

Install and configure the [Minio](https://minio.io/) S3 compatible object storage server
on RHEL/CentOS and Debian/Ubuntu.
Install and configure the [MinIO](https://minio.io/) S3 compatible object storage server on RHEL/CentOS and Debian/Ubuntu.

## Requirements

Expand All @@ -23,15 +22,14 @@ minio_server_bin: /usr/local/bin/minio
minio_client_bin: /usr/local/bin/mc
```
Installation path of the Minio server and client binaries.
Installation path of the MinIO server and client binaries.
```yaml
minio_server_release: ""
minio_client_release: ""
minio_server_release: "RELEASE.2020-08-18T19-41-00Z"
minio_client_release: "RELEASE.2020-08-20T00-23-01Z"
```
Release to install for both server and client; lastest if the default.
Can be 'RELEASE.2019-06-27T21-13-50Z' for instance.
Release to install for both server and client; lastest if the default. Can be 'RELEASE.2020-08-18T19-41-00Z' for instance.
```yaml
minio_user: minio
Expand All @@ -51,7 +49,7 @@ Path to the file containing the minio server configuration ENV variables.
minio_server_addr: ":9091"
```
The Minio server listen address.
The MinIO server listen address.
```yaml
minio_server_datadirs:
Expand All @@ -67,66 +65,65 @@ minio_server_make_datadirs: true
Create directories from `minio_server_datadirs`

```yaml
minio_server_cluster_nodes: [ ]
minio_server_args: [ ]
```

Set a list of nodes to create a [distributed cluster](https://docs.minio.io/docs/distributed-minio-quickstart-guide).

In this mode, ansible will create your server datadirs, but use this list for the server startup. Note you will need a number of disks to satisfy Minio's distributed storage requirements.
In this mode, ansible will create your server datadirs, but use this list for the server startup. Note you will need a number of disks to satisfy MinIO's distributed storage requirements.

Example:

```yaml
minio_server_datadirs:
- '/minio-data'
- ...
minio_server_cluster_nodes:
- 'https://server1/minio-data'
- 'https://server2/minio-data'
- 'https://server3/minio-data'
- ...
minio_server_args:
- 'https://server{1...3}/minio-data'
```

Additional environment variables to be set in MinIO server environment

```yaml
minio_server_env_extra: ""
minio_server_env_extra: |
MINIO_REGION_NAME=us-east-1
MINIO_API_REQUESTS_MAX=1600
```

Additional environment variables to be set in Minio server environment
Additional CLI options that must be appended to the minio server start command.

```yaml
minio_server_opts: ""
```

Additional CLI options that must be appended to the minio server start command.

MinIO root access and secret keys.

```yaml
minio_access_key: ""
minio_secret_key: ""
```

Minio access and secret keys.

Switches to disable minio server and/or minio client installation.
```yaml
minio_install_server: true
minio_install_client: true
```

Switches to disable minio server and/or minio client installation.

## Dependencies

None.

## Example Playbook

```yaml
- name: "Install Minio"
- name: "Install MinIO"
hosts: all
become: yes
roles:
- { role: atosatto.minio }
vars:
minio_server_datadirs: [ "/minio-test" ]
minio_server_datadirs: [ "/minio1" ]
```

## Changelog
Expand Down
35 changes: 19 additions & 16 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,44 @@
---

# Minio binaries path
# MinIO binaries path
minio_server_bin: /usr/local/bin/minio
minio_client_bin: /usr/local/bin/mc

# Minio release to install. default if lastet
minio_server_release: ""
minio_client_release: ""
# MinIO release to install. default if latest
minio_server_release: "RELEASE.2020-08-18T19-41-00Z"

# Runtime user and group for the Minio server service
minio_client_release: "RELEASE.2020-08-20T00-23-01Z"

# Runtime user and group for the MinIO server service
minio_user: minio
minio_group: minio

# Path to the file containing the ENV variables for the Minio server
# Path to the file containing the ENV variables for the MinIO server
minio_server_envfile: /etc/default/minio

# Minio server listen address
# MinIO server listen address
minio_server_addr: ":9091"

# Minio server data directories
# MinIO server data directories
minio_server_datadirs:
- /var/lib/minio
minio_server_make_datadirs: true

# Minio server cluster node list.
minio_server_cluster_nodes: [ ]
# MinIO server args list.
minio_server_args:
- /var/lib/minio

# Additional environment variables to be set in minio server environment
minio_server_env_extra: ""
minio_server_env_extra: |
MINIO_REGION_NAME=us-east-1
# Additional Minio server CLI options
# Additional MinIO server CLI options
minio_server_opts: ""

# Minio access and secret keys
minio_access_key: ""
minio_secret_key: ""
# MinIO access and secret keys
minio_access_key: "minio"
minio_secret_key: "minio123"

# Switches to enable/disable the Minio server and/or Minio client installation.
# Switches to enable/disable the MinIO server and/or MinIO client installation.
minio_install_server: true
minio_install_client: true
6 changes: 3 additions & 3 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
galaxy_info:
author: Andrea Tosatto
description: Install and configure the Minio S3 compatible object storage server on RHEL/CentOS and Debian/Ubuntu
min_ansible_version: 2.1
description: Install and configure the MinIO S3 compatible object storage server on RHEL/CentOS and Debian/Ubuntu
min_ansible_version: 2.9
license: MIT
issue_tracker_url: https://github.com/atosatto/ansible-minio/issues
issue_tracker_url: https://github.com/minio/ansible-minio/issues

platforms:
- name: EL
Expand Down
9 changes: 3 additions & 6 deletions molecule/alternative/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ platforms:

provisioner:
name: ansible
lint:
name: ansible-lint
options:
diff: True
v: True
Expand All @@ -48,14 +46,13 @@ provisioner:
prepare: ../resources/prepare.yml
destroy: ../resources/destroy.yml

lint:
name: yamllint
lint: |
set -e
yamllint .
verifier:
name: testinfra
options:
vvv: True
additional_files_or_dirs:
- ../resources/tests/
lint:
name: flake8
2 changes: 2 additions & 0 deletions molecule/alternative/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
- "/srv/data2"
- "/srv/data3"
- "/srv/data4"
minio_server_args:
- "/srv/data{1...4}"
6 changes: 3 additions & 3 deletions molecule/alternative/tests/test_minio_alternative.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ def test_minio_server_env_file(host, AnsibleDefaults):
assert f.exists
assert f.user == 'root'
assert f.group == AnsibleDefaults['minio_group']
assert oct(f.mode) == '0640'
assert oct(f.mode) == '0o640'


@pytest.mark.parametrize('minio_datadir', [
'/srv/data1',
'/srv/data2',
'/srv/data3',
'/srv/data4'
'/srv/data4',
])
def test_minio_server_data_directories(host, AnsibleDefaults, minio_datadir):

Expand All @@ -37,7 +37,7 @@ def test_minio_server_data_directories(host, AnsibleDefaults, minio_datadir):
assert d.exists
assert d.user == AnsibleDefaults['minio_user']
assert d.group == AnsibleDefaults['minio_group']
assert oct(d.mode) == '0750'
assert oct(d.mode) == '0o750'


def test_minio_server_webserver(host):
Expand Down
Loading

0 comments on commit 0daa2f6

Please sign in to comment.