ansible-minio/tasks/server.yml
2018-06-25 15:03:31 +02:00

59 lines
1.3 KiB
YAML

---
- name: create minio group
group:
name: "{{ minio_group }}"
state: present
- name: create minio user
user:
name: "{{ minio_user }}"
group: "{{ minio_group }}"
shell: /bin/bash
- name: create data storage directories
file:
path: "{{ item }}"
state: directory
owner: "{{ minio_user }}"
group: "{{ minio_group }}"
mode: 0750
when: minio_server_make_datadirs
with_items: "{{ minio_server_datadirs }}"
- name: download minio server
get_url:
url: "{{ minio_server_download_url }}"
dest: "{{ minio_server_bin }}"
owner: "root"
group: "root"
mode: 0755
register: _download_server
until: _download_server is succeeded
retries: 5
delay: 2
- name: generate the minio server envfile
template:
src: minio.env.j2
dest: "{{ minio_server_envfile }}"
notify: restart minio
- name: create the minio server systemd config
template:
src: minio.service.j2
dest: "/etc/systemd/system/minio.service"
when: ansible_service_mgr == "systemd"
- name: create the minio server init.d config
template:
src: minio.init.j2
dest: "/etc/init.d/minio"
mode: 0750
when: ansible_service_mgr != "systemd"
- name: enable and start the minio service
service:
name: minio
state: started
enabled: true