aboutsummaryrefslogtreecommitdiff
path: root/ansible
diff options
context:
space:
mode:
Diffstat (limited to 'ansible')
-rw-r--r--ansible/host_vars/malabaricus/minio-secret.yml13
-rw-r--r--ansible/host_vars/malabaricus/minio.yml3
-rw-r--r--ansible/minio.yml3
-rw-r--r--ansible/roles/minio-server/defaults/main.yml2
-rw-r--r--ansible/roles/minio-server/tasks/main.yml43
5 files changed, 57 insertions, 7 deletions
diff --git a/ansible/host_vars/malabaricus/minio-secret.yml b/ansible/host_vars/malabaricus/minio-secret.yml
new file mode 100644
index 0000000..5a03a18
--- /dev/null
+++ b/ansible/host_vars/malabaricus/minio-secret.yml
@@ -0,0 +1,13 @@
+$ANSIBLE_VAULT;1.1;AES256
+63396232623465333162353734366431373230363438316637396465326337383834313463343731
+6532633063393762613637326438663332626264353834310a326163303831356164353261643966
+66313632636434303634303432663230333531343363643865373039633532356266643037653433
+6338303332633762380a376435383931646563356230376663656362316537646635653666633837
+65396335323431653930323931626666656534626230323962363861343630396666663765623534
+62376331313834653532613439323863363265396565306263376264666638336563316430396137
+66316166363030323336356563613061656362613136316336313362336335633163396434653035
+36656133393161376266663162376161343935376665386635316533643064303030626665333632
+61663739353764636434366535366266383836656634393264346265626561363134613332633531
+66356636646431643835646230633038396665316336643436383333643938623233376565613739
+32336161666161626636646433313732303462633263363232623435386465376333646133333933
+61376662636239363463
diff --git a/ansible/host_vars/malabaricus/minio.yml b/ansible/host_vars/malabaricus/minio.yml
index 0289be1..0711856 100644
--- a/ansible/host_vars/malabaricus/minio.yml
+++ b/ansible/host_vars/malabaricus/minio.yml
@@ -1 +1,4 @@
minio_bin__minio_state: present
+
+minio_server__data:
+ - /data1/minio
diff --git a/ansible/minio.yml b/ansible/minio.yml
index ceaa44d..20faae9 100644
--- a/ansible/minio.yml
+++ b/ansible/minio.yml
@@ -2,10 +2,9 @@
- birgitte
- malabaricus
roles:
- - minio-bin
- minio-server
- hosts:
- - all
+ - all !malabaricus # no binaries for arm
roles:
- minio-bin
diff --git a/ansible/roles/minio-server/defaults/main.yml b/ansible/roles/minio-server/defaults/main.yml
new file mode 100644
index 0000000..fd2b966
--- /dev/null
+++ b/ansible/roles/minio-server/defaults/main.yml
@@ -0,0 +1,2 @@
+minio_server__user: minio
+minio_server__group: minio
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