2023-10-25 22:26:17 +02:00
|
|
|
---
|
|
|
|
- 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
|
2024-11-10 15:50:30 +01:00
|
|
|
no_log: "{{ no_debug | default('true') }}"
|
2023-10-25 22:26:17 +02:00
|
|
|
|
|
|
|
- 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
|