homeserver/roles/mgrote.minio/tasks/main.yml

62 lines
1.4 KiB
YAML
Raw Normal View History

---
- name: ensure group exists
ansible.builtin.group:
name: "{{ minio_group }}"
state: present
- name: ensure user exists
ansible.builtin.user:
name: "{{ minio_user }}"
group: "{{ minio_group }}"
shell: /sbin/nologin
state: present
- name: ensure needed directories are present
file:
path: "{{ item }}"
state: directory
owner: "{{ minio_user }}"
group: "{{ minio_user }}"
with_items:
- "{{ minio_volumes_base_dir }}"
- "{{ minio_config_dir }}"
- name: download binary
get_url:
url: "{{ minio_download_url }}"
dest: "{{ minio_bin_path }}/minio"
mode: 0744
owner: "{{ minio_user }}"
group: "{{ minio_user }}"
- name: template default config
become: yes
ansible.builtin.template:
src: "default.j2"
dest: "/etc/default/minio"
owner: "{{ minio_user }}"
group: "{{ minio_user }}"
notify: (re)start service
no_log: true
- name: template systemd-unit
become: yes
ansible.builtin.template:
src: "minio.service.j2"
dest: "/etc/systemd/system/minio.service"
mode: a+x
owner: "{{ minio_user }}"
group: "{{ minio_user }}"
notify: (re)start service
- name: systemd daemon reload
become: yes
ansible.builtin.systemd:
daemon_reload: true
- name: enable systemd service
become: yes
ansible.builtin.systemd:
name: minio
enabled: true