infra/ansible/roles/minio/tasks/main.yml

65 lines
1.3 KiB
YAML
Raw Normal View History

2023-07-10 23:12:14 +00:00
---
- name: create minio group
group:
name: minio
state: present
- name: create minio user
user:
name: minio
group: minio
system: True
shell: /usr/sbin/nologin
- name: ensure minio cert dir
file:
path: /etc/minio/certs
state: directory
owner: minio
group: minio
mode: 0750
- name: ensure minio owns minio path
file:
path: '{{ minio_volume }}'
state: directory
owner: minio
group: minio
mode: 0750
- name: ensure minio systemd file
copy:
src: minio.service
dest: /etc/systemd/system/minio.service
owner: root
group: root
notify:
- reload systemd
- restart minio
- name: template minio config
template:
src: minio.j2
dest: /etc/default/minio
owner: root
group: minio
mode: 0640
notify: restart minio
- name: download minio
get_url:
url: 'https://dl.minio.io/server/minio/release/linux-amd64/archive/minio.{{ minio_version }}'
dest: /usr/local/bin/minio
owner: root
group: root
mode: 0755
checksum: "sha256:https://dl.minio.io/server/minio/release/linux-amd64/archive/minio.{{ minio_version}}.sha256sum"
notify: restart minio
- name: enable and start minio
systemd:
name: minio
state: started
enabled: True
daemon_reload: True