mirror of
https://github.com/atosatto/ansible-minio.git
synced 2024-11-22 11:25:11 +01:00
Create data directories
Create data directories automatically. * Add flag to disable automatic creation.
This commit is contained in:
parent
b373160051
commit
341e3003a8
@ -16,6 +16,7 @@ minio_server_addr: ":9091"
|
||||
|
||||
# Minio server data directories
|
||||
minio_server_datadirs: [ ]
|
||||
minio_server_make_datadirs: true
|
||||
|
||||
# Additional minio server CLI options
|
||||
minio_server_opts: ""
|
||||
|
@ -3,4 +3,4 @@
|
||||
- hosts: all
|
||||
roles:
|
||||
- { role: ansible-minio,
|
||||
minio_server_datadirs: [ "/tmp" ] }
|
||||
minio_server_datadirs: [ "/minio-test" ] }
|
||||
|
@ -24,9 +24,20 @@
|
||||
template:
|
||||
src: minio.init.j2
|
||||
dest: "{{ initd_conf_dir }}/minio"
|
||||
mode: 0755
|
||||
mode: 0750
|
||||
when: ansible_service_mgr != "systemd"
|
||||
|
||||
- name: create data storage directories
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
recurse: true
|
||||
owner: "{{ minio_user }}"
|
||||
group: "{{ minio_group }}"
|
||||
mode: 0750
|
||||
when: minio_server_make_datadirs
|
||||
with_items: "{{ minio_server_datadirs }}"
|
||||
|
||||
- name: enable and start the minio service
|
||||
service:
|
||||
name: minio
|
||||
|
@ -25,6 +25,18 @@ def test_minio_installed(File, AnsibleDefaults, minio_bin_var):
|
||||
assert oct(f.mode) == '0755'
|
||||
|
||||
|
||||
@pytest.mark.parametrize("dirs", [
|
||||
"/test-minio"
|
||||
])
|
||||
def test_directories(host, dirs):
|
||||
d = host.file(dirs)
|
||||
assert d.is_directory
|
||||
assert d.exists
|
||||
assert d.user == AnsibleDefaults['minio_user']
|
||||
assert d.group == AnsibleDefaults['minio_group']
|
||||
assert oct(d.mode) == '0750'
|
||||
|
||||
|
||||
def test_minio_service(Service):
|
||||
|
||||
s = Service('minio')
|
||||
|
Loading…
Reference in New Issue
Block a user