aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/minio-server/tasks
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2018-12-21 13:11:52 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2018-12-21 13:11:52 +0100
commit9325449dbe8c9590d6391bb1603f8f6377c181ae (patch)
tree9e47884f3e98c47ad241689dbb275c0780e46a4b /ansible/roles/minio-server/tasks
parent98e24f4ebba276815488b393cb6937e12a21c1d2 (diff)
downloadinfra-9325449dbe8c9590d6391bb1603f8f6377c181ae.tar.gz
infra-9325449dbe8c9590d6391bb1603f8f6377c181ae.tar.bz2
infra-9325449dbe8c9590d6391bb1603f8f6377c181ae.tar.xz
infra-9325449dbe8c9590d6391bb1603f8f6377c181ae.zip
minio malabaricus
Diffstat (limited to 'ansible/roles/minio-server/tasks')
-rw-r--r--ansible/roles/minio-server/tasks/main.yml43
1 files changed, 38 insertions, 5 deletions
diff --git a/ansible/roles/minio-server/tasks/main.yml b/ansible/roles/minio-server/tasks/main.yml
index 2b2602c..f2df91d 100644
--- a/ansible/roles/minio-server/tasks/main.yml
+++ b/ansible/roles/minio-server/tasks/main.yml
@@ -1,19 +1,47 @@
- become: yes
tags:
- minio-server
+ vars:
+ config_dir: /etc/minio
+ env_path: /etc/minio/env
+ user: "{{ minio_server__user }}"
+ group: "{{ minio_server__group }}"
block:
- name: /etc/minio directory
file:
- dest: /etc/minio
+ dest: "{{ env_path | dirname }}"
state: directory
- name: environment file
no_log: yes
copy:
- dest: /etc/minio/env
+ dest: "{{ env_path }}"
content: |
- MINIO_ACCESS_KEY={{ minio__access_key }}
- MINIO_SECRET_KEY={{ minio__secret_key }}
+ MINIO_ACCESS_KEY={{ minio_server__access_key }}
+ MINIO_SECRET_KEY={{ minio_server__secret_key }}
+
+ - file:
+ path: "{{ config_dir }}/certs"
+ owner: "{{ user }}"
+ group: "{{ group }}"
+ state: directory
+ recurse: yes
+
+ - group:
+ name: "{{ group }}"
+ system: yes
+
+ - user:
+ name: "{{ user }}"
+ group: "{{ group }}"
+ system: yes
+
+ - file:
+ path: "{{ item }}"
+ owner: "{{ user }}"
+ group: "{{ group }}"
+ state: directory
+ with_items: "{{ minio_server__data }}"
- name: Install systemd service
notify: systemd restart minio
@@ -24,10 +52,14 @@
After=network.target
[Service]
- ExecStart=/usr/local/bin/minio server --config-dir /etc/minio /dropbox/minio
+ ExecStart=/usr/local/bin/minio server --config-dir {{ config_dir }} {{ minio_server__data | join(' ') }}
+ EnvironmentFile={{ env_path }}
+ User={{ user }}
+ Group={{ group }}
[Install]
WantedBy=multi-user.target
+# '
- name: systemd enable minio
become: yes
@@ -35,3 +67,4 @@
service: minio
state: restarted
enabled: yes
+ daemon_reload: yes