homeserver/friedhof/mgrote_minio/tasks/main.yml

63 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 }}"
ansible.builtin.shell: /sbin/nologin
state: present
create_home: false
- name: ensure needed directories are present
ansible.builtin.file:
path: "{{ item }}"
state: directory
owner: "{{ minio_user }}"
group: "{{ minio_user }}"
with_items:
- "{{ minio_volumes_base_dir }}"
- "{{ minio_config_dir }}"
- name: download binary
ansible.builtin.get_url:
url: "{{ minio_download_url }}"
dest: "{{ minio_bin_path }}/minio"
mode: "0744"
owner: "{{ minio_user }}"
group: "{{ minio_user }}"
- name: template default config
become: true
ansible.builtin.template:
src: "default.j2"
dest: "/etc/default/minio"
owner: "{{ minio_user }}"
group: "{{ minio_user }}"
notify: (re)start service
no_log: "{{ no_debug | default('true') }}"
- name: template systemd-unit
become: true
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: true
ansible.builtin.systemd:
daemon_reload: true
- name: enable systemd service
become: true
ansible.builtin.systemd:
name: minio
enabled: true