xoxys.minio/tasks/setup.yml
Robert Kaussow d4709b706f
All checks were successful
continuous-integration/drone/push Build is passing
trigger restart after minio binary download
2020-06-03 23:55:01 +02:00

58 lines
1.5 KiB
YAML

---
- name: Prepare base folder
file:
path: "{{ minio_base_dir }}"
state: directory
owner: "{{ minio_user }}"
group: "{{ minio_user }}"
mode: 0750
become: True
become_user: root
- block:
- name: Prepare folder structure
file:
path: "{{ item }}"
state: directory
loop: "{{ minio_data_dirs }}"
- name: Download Minio binary
get_url:
url: "{{ __minio_server_source }}{{ '/archive/minio.RELEASE.' + minio_server_version if minio_server_version != 'latest' else '/minio' }}"
dest: "{{ minio_base_dir }}/minio"
mode: 0750
notify: __minio_restart
become: True
become_user: "{{ minio_user }}"
- name: Download Minio client
get_url:
url: "{{ __minio_client_source }}{{ '/' + minio_client_version if minio_client_version != 'latest' else '/mc' }}"
dest: "/usr/local/bin/mc"
mode: 0755
become: True
become_user: root
- block:
- name: Copy sysconfig file
template:
src: "etc/sysconfig/minio.j2"
dest: "{{ __minio_sysconfig }}"
mode: 0600
notify: __minio_restart
- name: Copy systemd unit file
template:
src: "etc/systemd/system/minio.service.j2"
dest: "/etc/systemd/system/minio.service"
notify: __minio_restart
- name: Ensure minio service is up and running
systemd:
name: minio
daemon_reload: yes
enabled: yes
state: started
become: True
become_user: root