Skip to content

Commit d0a3284

Browse files
committed
Adding MINIO_SERVER_URL environment variable, so TLS certificates without IP Subject Alternative Names
1 parent ddfc84d commit d0a3284

File tree

6 files changed

+20
-4
lines changed

6 files changed

+20
-4
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ Available variables are listed below along with default values (see `defaults\ma
8181
minio_cert: "{{ lookup('file','certificates/{{ inventory_hostname }}_public.crt') }}"
8282
8383
```
84+
85+
`minio_url_server` might be needed in case MinIO Server TLS certificates do not contain any IP Subject Alternative Names (SAN). See [MINIO_SERVER_URL environment variable definition](https://min.io/docs/minio/linux/reference/minio-server/minio-server.html#envvar.MINIO_SERVER_URL).
86+
87+
```yml
88+
minio_server_url: "https://minio.ricsanfre.com:{{ minio_server_port }}"
89+
```
90+
91+
8492
- Buckets to be created
8593

8694
Variable `minio_buckets` create the list of provided buckets, and applying a specifc policy. For creating the buckets, a modified version of Ansible Module from Alexis Facques is used (https://github.com/alexisfacques/ansible-module-s3-minio-bucket)
@@ -232,6 +240,7 @@ It also create some buckets and users with proper ACLs
232240
minio_root_user: "miniadmin"
233241
minio_root_password: "supers1cret0"
234242
minio_enable_tls: true
243+
minio_server_url: "https://{{ server_hostname }}:{{ minio_server_port }}"
235244
minio_buckets:
236245
- name: bucket1
237246
policy: read-write
@@ -265,7 +274,6 @@ Where `generate_selfsigned_cert.yml` contain the tasks for generating a Private
265274
path: "certificates/{{ inventory_hostname }}_cert.csr"
266275
privatekey_path: "certificates/{{ inventory_hostname }}_private.key"
267276
common_name: "{{ server_hostname }}"
268-
subject_alt_name: "IP:{{ ansible_default_ipv4.address }}"
269277
270278
- name: Create certificates for keystore
271279
openssl_certificate:

defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ minio_root_password: ""
4646
minio_enable_tls: false
4747
minio_key: ""
4848
minio_cert: ""
49+
minio_server_url: ""
4950

5051
# Buckets
5152
minio_buckets: []

molecule/tls/converge.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
become: true
55
gather_facts: true
66
vars:
7-
server_hostname: minio.picluster.ricsanfre.com
7+
server_hostname: minio.ricsanfre.com
88
ssl_key_size: 4096
99
ssl_certificate_provider: selfsigned
1010

@@ -25,6 +25,7 @@
2525
minio_root_user: "miniadmin"
2626
minio_root_password: "supers1cret0"
2727
minio_enable_tls: true
28+
minio_server_url: "https://{{ server_hostname }}:{{ minio_server_port }}"
2829
minio_validate_certificate: false
2930
minio_buckets:
3031
- name: bucket1

molecule/tls/molecule.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ lint: |
88
driver:
99
name: docker
1010
platforms:
11-
- name: instance
11+
- name: minio.ricsanfre.com
1212
image: "ricsanfre/docker-${MOLECULE_DISTRO:-ubuntu}-ansible:${MOLECULE_RELEASE:-latest}"
1313
command: ${MOLECULE_DOCKER_COMMAND:-""}
1414
volumes:

molecule/tls/tasks/generate_selfsigned_cert.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
path: "certificates/{{ inventory_hostname }}_cert.csr"
1111
privatekey_path: "certificates/{{ inventory_hostname }}_private.key"
1212
common_name: "{{ server_hostname }}"
13-
subject_alt_name: "IP:{{ ansible_default_ipv4.address }}"
13+
# subject_alt_name: "IP:{{ ansible_default_ipv4.address }}"
1414

1515
- name: Create certificates for keystore
1616
openssl_certificate:

templates/minio.env.j2

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@ MINIO_SITE_REGION="{{ minio_site_region }}"
2222
{% endif %}
2323

2424
{{ minio_server_env_extra }}
25+
26+
{% if minio_server_url | length > 0 %}
27+
# Minio server URL
28+
MINIO_SERVER_URL="{{ minio_server_url }}"
29+
30+
{% endif %}

0 commit comments

Comments
 (0)