added minio salt state
This commit is contained in:
parent
7e2226b257
commit
2f632e8615
14
minio/files/minio.service.jinja
Normal file
14
minio/files/minio.service.jinja
Normal file
@ -0,0 +1,14 @@
|
||||
[Unit]
|
||||
Description=MinIO podman container
|
||||
|
||||
[Service]
|
||||
Restart=on-failure
|
||||
ExecStartPre=/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
|
||||
ExecStart=/usr/bin/podman run --conmon-pidfile /%t/%n-pid --cidfile /%t/%n-cid --detach -p "9000:9000" -e "MINIO_ACCESS_KEY={{ pillar['minio']['accesskey'] }}" -v "/srv/minio:/data" -e "MINIO_SECRET_KEY={{ pillar['minio']['secretkey'] }}" minio/minio server /data
|
||||
ExecStop=/usr/bin/sh -c "/usr/bin/podman rm -f `cat /%t/%n-cid`"
|
||||
KillMode=none
|
||||
Type=forking
|
||||
PIDFile=/%t/%n-pid
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
3
minio/init.sls
Normal file
3
minio/init.sls
Normal file
@ -0,0 +1,3 @@
|
||||
include:
|
||||
- minio.prereq
|
||||
- minio.systemd
|
10
minio/prereq.sls
Normal file
10
minio/prereq.sls
Normal file
@ -0,0 +1,10 @@
|
||||
Create local MinIO storage:
|
||||
file.directory:
|
||||
- name: /srv/minio
|
||||
- user: root
|
||||
- group: root
|
||||
- mode: "0755"
|
||||
|
||||
Install podman:
|
||||
pkg.installed:
|
||||
- name: podman
|
20
minio/systemd.sls
Normal file
20
minio/systemd.sls
Normal file
@ -0,0 +1,20 @@
|
||||
Create minio systemd service:
|
||||
file.managed:
|
||||
- name: /etc/systemd/system/minio.service
|
||||
- source: salt://minio/files/minio.service.jinja
|
||||
- template: jinja
|
||||
- user: root
|
||||
- group: root
|
||||
- mode: "0660"
|
||||
|
||||
SystemD daemon reload:
|
||||
cmd.run:
|
||||
- name: systemctl --system daemon-reload
|
||||
- onchanges:
|
||||
- file: Create minio systemd service
|
||||
|
||||
start MinIO:
|
||||
service.running:
|
||||
- name: minio.service
|
||||
- onchanges:
|
||||
- cmd: SystemD daemon reload
|
Reference in New Issue
Block a user