aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/minio-server
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2018-12-21 10:59:27 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2018-12-21 10:59:27 +0100
commita4bcb2caba43bf10700025f936d21717fa737977 (patch)
tree6e789e75c48308277947a6f13748de38ac4269da /ansible/roles/minio-server
parent36183579aa48bd9207237ac69d666f0f222cfc1d (diff)
downloadinfra-a4bcb2caba43bf10700025f936d21717fa737977.tar.gz
infra-a4bcb2caba43bf10700025f936d21717fa737977.tar.bz2
infra-a4bcb2caba43bf10700025f936d21717fa737977.tar.xz
infra-a4bcb2caba43bf10700025f936d21717fa737977.zip
o Adding minio.
Diffstat (limited to 'ansible/roles/minio-server')
-rw-r--r--ansible/roles/minio-server/handlers/main.yml5
-rw-r--r--ansible/roles/minio-server/tasks/main.yml37
2 files changed, 42 insertions, 0 deletions
diff --git a/ansible/roles/minio-server/handlers/main.yml b/ansible/roles/minio-server/handlers/main.yml
new file mode 100644
index 0000000..77157cb
--- /dev/null
+++ b/ansible/roles/minio-server/handlers/main.yml
@@ -0,0 +1,5 @@
+- name: systemd restart minio
+ become: yes
+ systemd:
+ service: minio
+ state: restarted
diff --git a/ansible/roles/minio-server/tasks/main.yml b/ansible/roles/minio-server/tasks/main.yml
new file mode 100644
index 0000000..2b2602c
--- /dev/null
+++ b/ansible/roles/minio-server/tasks/main.yml
@@ -0,0 +1,37 @@
+- become: yes
+ tags:
+ - minio-server
+ block:
+ - name: /etc/minio directory
+ file:
+ dest: /etc/minio
+ state: directory
+
+ - name: environment file
+ no_log: yes
+ copy:
+ dest: /etc/minio/env
+ content: |
+ MINIO_ACCESS_KEY={{ minio__access_key }}
+ MINIO_SECRET_KEY={{ minio__secret_key }}
+
+ - name: Install systemd service
+ notify: systemd restart minio
+ copy:
+ dest: /etc/systemd/system/minio.service
+ content: |
+ [Unit]
+ After=network.target
+
+ [Service]
+ ExecStart=/usr/local/bin/minio server --config-dir /etc/minio /dropbox/minio
+
+ [Install]
+ WantedBy=multi-user.target
+
+ - name: systemd enable minio
+ become: yes
+ systemd:
+ service: minio
+ state: restarted
+ enabled: yes