2021-10-23 17:47:57 +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 }}"
|
|
|
|
shell: /sbin/nologin
|
|
|
|
state: present
|
2021-12-15 21:41:53 +01:00
|
|
|
create_home: no
|
2021-10-23 17:47:57 +02:00
|
|
|
|
|
|
|
- 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
|