Skip to content

Commit

Permalink
added support to configure the minio config directory (atosatto#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
rslllstefan authored Dec 1, 2021
1 parent 08d9102 commit 0a48b02
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ Name and group of the user running the minio server.
minio_server_envfile: /etc/default/minio
```
You can specify the location of your existing config using --config-dir (default: ${HOME}/.minio)
```yaml
minio_config_dir: "/etc/minio"
```
Path to the file containing the minio server configuration ENV variables.
```yaml
Expand Down
4 changes: 4 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ minio_group: minio
# Path to the file containing the ENV variables for the MinIO server
minio_server_envfile: /etc/default/minio

# Directory to store minio config. Will default to minio_user/.minio if not defined
minio_config_dir: ""

# Minio server ip/fqdn and port. This makes up the server_addr below
minio_server_ip: ""
minio_server_port: "9091"

# MinIO server listen address
minio_server_addr: "{{ minio_server_ip }}:{{ minio_server_port}}"

Expand Down
13 changes: 13 additions & 0 deletions tasks/install-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
minio_server_opts: "--console-address {{ minio_console_addr }} {{ minio_server_opts }}"
when: minio_console_addr | length > 1

- name: "Append the MinIO config directory var to minio_server_opts"
set_fact:
minio_server_opts: "--config-dir {{ minio_config_dir}} {{ minio_server_opts }}"
when: minio_config_dir | length > 0

- name: Create MinIO group
group:
name: "{{ minio_group }}"
Expand Down Expand Up @@ -84,6 +89,14 @@
when: ansible_service_mgr != "systemd"
notify: restart minio

- name: Create the MinIO config dir
file:
path: "{{ minio_config_dir }}"
owner: "{{ minio_user }}"
group: "{{ minio_group }}"
state: directory
when: minio_config_dir is defined

- name: Enable and start the MinIO service
service:
name: minio
Expand Down

0 comments on commit 0a48b02

Please sign in to comment.