mirror of
https://github.com/atosatto/ansible-minio.git
synced 2024-11-22 11:25:11 +01:00
Split server install from configuration
This commit is contained in:
parent
15ad3a3604
commit
86e9c2b3f3
@ -38,4 +38,5 @@ minio_secret_key: ""
|
||||
|
||||
# Switches to enable/disable the Minio server and/or Minio client installation.
|
||||
minio_install_server: true
|
||||
minio_configure_server: true
|
||||
minio_install_client: true
|
||||
|
58
tasks/configure-server.yml
Normal file
58
tasks/configure-server.yml
Normal file
@ -0,0 +1,58 @@
|
||||
---
|
||||
- name: Create Minio group
|
||||
group:
|
||||
name: "{{ minio_group }}"
|
||||
state: present
|
||||
|
||||
- name: Create Minio user
|
||||
user:
|
||||
name: "{{ minio_user }}"
|
||||
group: "{{ minio_group }}"
|
||||
system: "yes"
|
||||
shell: "/usr/sbin/nologin"
|
||||
|
||||
- name: Create the Minio 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: Generate the Minio server envfile
|
||||
template:
|
||||
src: minio.env.j2
|
||||
dest: "{{ minio_server_envfile }}"
|
||||
owner: "root"
|
||||
group: "{{ minio_group }}"
|
||||
mode: 0640
|
||||
notify: restart minio
|
||||
|
||||
- name: Create the Minio server systemd config
|
||||
template:
|
||||
src: minio.service.j2
|
||||
dest: "/etc/systemd/system/minio.service"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
when: ansible_service_mgr == "systemd"
|
||||
notify:
|
||||
- reload minio systemd
|
||||
- restart minio
|
||||
|
||||
- name: Create the Minio server init.d config
|
||||
template:
|
||||
src: minio.init.j2
|
||||
dest: "/etc/init.d/minio"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: 0750
|
||||
when: ansible_service_mgr != "systemd"
|
||||
notify: restart minio
|
||||
|
||||
- name: Enable and start the Minio service
|
||||
service:
|
||||
name: minio
|
||||
state: started
|
||||
enabled: true
|
@ -17,28 +17,6 @@
|
||||
set_fact:
|
||||
_minio_server_checksum: "{{ lookup('url', _minio_server_download_url + '.sha256sum').split(' ')[0] }}"
|
||||
|
||||
- name: Create Minio group
|
||||
group:
|
||||
name: "{{ minio_group }}"
|
||||
state: present
|
||||
|
||||
- name: Create Minio user
|
||||
user:
|
||||
name: "{{ minio_user }}"
|
||||
group: "{{ minio_group }}"
|
||||
system: "yes"
|
||||
shell: "/usr/sbin/nologin"
|
||||
|
||||
- name: Create the Minio 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 the Minio server
|
||||
get_url:
|
||||
url: "{{ _minio_server_download_url }}"
|
||||
@ -53,38 +31,3 @@
|
||||
delay: 2
|
||||
notify: restart minio
|
||||
|
||||
- name: Generate the Minio server envfile
|
||||
template:
|
||||
src: minio.env.j2
|
||||
dest: "{{ minio_server_envfile }}"
|
||||
owner: "root"
|
||||
group: "{{ minio_group }}"
|
||||
mode: 0640
|
||||
notify: restart minio
|
||||
|
||||
- name: Create the Minio server systemd config
|
||||
template:
|
||||
src: minio.service.j2
|
||||
dest: "/etc/systemd/system/minio.service"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
when: ansible_service_mgr == "systemd"
|
||||
notify:
|
||||
- reload minio systemd
|
||||
- restart minio
|
||||
|
||||
- name: Create the Minio server init.d config
|
||||
template:
|
||||
src: minio.init.j2
|
||||
dest: "/etc/init.d/minio"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: 0750
|
||||
when: ansible_service_mgr != "systemd"
|
||||
notify: restart minio
|
||||
|
||||
- name: Enable and start the Minio service
|
||||
service:
|
||||
name: minio
|
||||
state: started
|
||||
enabled: true
|
||||
|
@ -10,5 +10,8 @@
|
||||
- include_tasks: install-server.yml
|
||||
when: minio_install_server
|
||||
|
||||
- include_tasks: configure-server.yml
|
||||
when: minio_configure_server
|
||||
|
||||
- include_tasks: install-client.yml
|
||||
when: minio_install_client
|
||||
|
Loading…
Reference in New Issue
Block a user