|
| 1 | +--- |
| 2 | +- name: Create minio files directory |
| 3 | + ansible.builtin.file: |
| 4 | + state: directory |
| 5 | + path: "{{ minio_dir }}" |
| 6 | + owner: root |
| 7 | + group: root |
| 8 | + mode: "0755" |
| 9 | + |
| 10 | +- name: Create minio data directory |
| 11 | + ansible.builtin.file: |
| 12 | + state: directory |
| 13 | + path: "{{ minio_data_dir }}" |
| 14 | + owner: root |
| 15 | + group: root |
| 16 | + mode: "0755" |
| 17 | + |
| 18 | +- name: Place the serverapplication configfiles |
| 19 | + ansible.builtin.template: |
| 20 | + src: "{{ item }}.j2" |
| 21 | + dest: /opt/openconext/minio/{{ item }} |
| 22 | + owner: root |
| 23 | + group: root |
| 24 | + mode: "0644" |
| 25 | + with_items: |
| 26 | + - config.env |
| 27 | + notify: Restart minio |
| 28 | + |
| 29 | +- name: Create and start the server container |
| 30 | + community.docker.docker_container: |
| 31 | + name: minio |
| 32 | + image: quay.io/minio/minio:{{ minio_version }} |
| 33 | + pull: true |
| 34 | + restart_policy: "always" |
| 35 | + state: started |
| 36 | + env: |
| 37 | + MINIO_CONFIG_ENV_FILE: "/etc/config.env" |
| 38 | + networks: |
| 39 | + - name: "loadbalancer" |
| 40 | + mounts: |
| 41 | + - source: "{{ minio_data_dir }}" |
| 42 | + target: "{{ minio_data_dir_oncontainer }}" |
| 43 | + type: bind |
| 44 | + - source: "{{ minio_dir }}/config.env" |
| 45 | + target: /etc/config.env |
| 46 | + type: bind |
| 47 | + command: server --console-address ":9090" {{ minio_data_dir_oncontainer }} |
| 48 | + labels: |
| 49 | + traefik.http.routers.minio.rule: "Host(`minio.{{ base_domain }}`)" |
| 50 | + traefik.http.routers.minio.tls: "true" |
| 51 | + traefik.http.routers.minio.service: "minio" |
| 52 | + traefik.http.services.minio.loadbalancer.server.port: "9090" |
| 53 | + traefik.http.routers.minioapi.rule: "Host(`minioapi.{{ base_domain }}`)" |
| 54 | + traefik.http.routers.minioapi.tls: "true" |
| 55 | + traefik.http.routers.minioapi.service: "minioapi" |
| 56 | + traefik.http.services.minioapi.loadbalancer.server.port: "9000" |
| 57 | + traefik.enable: "true" |
| 58 | + healthcheck: |
| 59 | + test: |
| 60 | + [ |
| 61 | + "CMD", |
| 62 | + "curl", |
| 63 | + "--fail", |
| 64 | + "http://localhost:9000/minio/health/live" |
| 65 | + ] |
| 66 | + interval: 10s |
| 67 | + timeout: 10s |
| 68 | + retries: 3 |
| 69 | + start_period: 10s |
| 70 | + register: miniocontainer |
0 commit comments