Created
August 14, 2020 00:15
-
-
Save rssnyder/c8cf5fc8adba0e7a818895026dc9675d to your computer and use it in GitHub Desktop.
Ansible YAML to install minio on linux-amd64
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: minio | |
become: yes | |
tasks: | |
- name: install ufw | |
apt: | |
name: ufw | |
state: latest | |
update_cache: yes | |
- name: Enable UFW | |
ufw: | |
state: enabled | |
- name: Set logging | |
ufw: | |
logging: 'on' | |
- name: Allow all access to tcp port 22 | |
ufw: | |
rule: allow | |
port: '22' | |
proto: tcp | |
- name: Allow all access to minio | |
ufw: | |
rule: allow | |
port: "{{ port }}" | |
proto: tcp | |
- name: Deny all others | |
ufw: | |
default: deny | |
- name: Add the minio user | |
user: | |
name: minio-user | |
- name: Download minio | |
get_url: | |
url: https://dl.min.io/server/minio/release/linux-amd64/minio | |
dest: /usr/local/bin/minio | |
owner: minio-user | |
group: minio-user | |
mode: '0700' | |
- name: Generate minio access key | |
shell: head /dev/urandom | tr -dc A-Za-z0-9 | head -c 16 ; echo '' | |
register: minio_key | |
- name: Generate minio access key | |
shell: head /dev/urandom | tr -dc 'A-Za-z0-9!"#$%&'\''()*+,-./:;<=>?@[\]^_`{|}~' | head -c 32 ; echo '' | |
register: minio_secret | |
- name: Set minio options | |
template: | |
src: templates/minio.conf.j2 | |
dest: "/etc/default/minio" | |
owner: minio-user | |
group: minio-user | |
mode: '0600' | |
- name: Download minio service file | |
get_url: | |
url: https://raw.githubusercontent.com/minio/minio-service/master/linux-systemd/minio.service | |
dest: /etc/systemd/system/minio.service | |
owner: minio-user | |
group: minio-user | |
mode: '0700' | |
- name: Enable minio | |
systemd: | |
enabled: yes | |
name: minio | |
- name: Start minio | |
systemd: | |
state: started | |
name: minio |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You will need to set
storage_dir
andport
as facts for your hosts.