Browse Source

initial import of basic minio docker role - very much WIP

main
commit
2c660aeb49
  1. 6
      defaults/main.yml
  2. 49
      tasks/main.yml

6
defaults/main.yml

@ -0,0 +1,6 @@
---
minio_docker_network: minio
minio_listen_ip: "127.0.0.1"
minio_port: 9000
minio_console_port: 9001

49
tasks/main.yml

@ -0,0 +1,49 @@
---
# Tasks to install minio as docker container
- name: minio | docker-python
become: true
apt:
name: python3-docker
state: present
- name: minio | docker started
become: true
service:
name: docker
state: started
- name: minio | docker network
become: true
docker_network:
name: "{{ minio_docker_network }}"
state: present
- name: minio | install and start the app container
become: true
docker_container:
image: quay.io/minio/minio:latest
name: minio
networks:
- name: "{{ minio_docker_network }}"
published_ports:
- "{{ minio_listen_ip }}:{{ minio_port }}:{{ minio_port }}"
- "{{ minio_listen_ip }}:{{ minio_console_port }}:{{ minio_console_port }}"
state: started
restart_policy: always
volumes:
- "{{ minio_data_path }}:/data"
env:
MINIO_ROOT_USER: "{{ minio_root_user }}"
MINIO_ROOT_PASSWORD: "{{ minio_root_password }}"
command: "server /data --console-address \":{{ minio_console_port }}\""
register: _minio_container
- name: minio | lookup container IP
command: docker inspect --format '{''{ .NetworkSettings.Networks.{{ minio_docker_network }}.IPAddress}''}' minio
register: _minio_container_ip
- name: minio | return container IP
set_fact:
minio_internal_ip: "{{ _minio_container_ip.stdout }}"
Loading…
Cancel
Save