Skip to content

Commit

Permalink
configure-module: support custom storage path
Browse files Browse the repository at this point in the history
Allow to mount a local disk as Minio storage
  • Loading branch information
gsanchietti committed Aug 25, 2023
1 parent b9018d5 commit a5cc1a9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions imageroot/actions/configure-module/20configure
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ user = request.get('user', 'minioadmin')
password = request.get('password', 'minioadmin')
agent.set_env("MINIO_ROOT_USER", user)
agent.set_env("MINIO_ROOT_PASSWORD", password)
storage = request.get('storage', 'minio-data')
agent.set_env("MINIO_STORAGE", storage)

# Make sure everything is saved inside the environment file
# just before starting systemd unit
Expand Down
10 changes: 8 additions & 2 deletions imageroot/actions/configure-module/validate-input.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
"password": "minioadmin",
"host_server": "myminio.nethserver.org",
"host_console": "console.myminio.nethserver.org",
"lets_encrypt": true
"lets_encrypt": true,
"storage": "minio-data"
}
],
"type": "object",
"required": [
"host_server",
"host_console",
"host_console",
"lets_encrypt"
],
"properties": {
Expand Down Expand Up @@ -43,6 +44,11 @@
"type": "string",
"description": "Password of the admin user, default is 'minioadmin'",
"minLength": 1
},
"storage": {
"type": "string",
"description": "Volume name or path to mount as storage'",
"minLength": 1
}
}
}
2 changes: 1 addition & 1 deletion imageroot/systemd/user/minio.service
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ExecStart=/usr/bin/podman run \
--env=MINIO_ROOT_USER=${MINIO_ROOT_USER} \
--env=MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD} \
--env=MINIO_DOMAIN=${MINIO_HOST_SERVER} \
--volume=minio-data:/data \
--volume=${MINIO_STORAGE}:/data \
${MINIO_IMAGE} server /data --console-address ":9001"
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/minio.ctr-id -t 10
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/minio.ctr-id
Expand Down

0 comments on commit a5cc1a9

Please sign in to comment.