Skip to content

Commit c9a4496

Browse files
J0ziAllda
authored andcommitted
IPv4 optional
Signed-off-by: J0zi <[email protected]>
1 parent b12f2b6 commit c9a4496

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ansible/roles/install-kind-cluster/tasks/install_registry.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@
2626
- "{{ registry_hostname }}"
2727
- "localhost"
2828
- "host.containers.internal"
29-
- "{{ ansible_default_ipv4.address }}.sslip.io"
29+
30+
- name: "Add IPv4 if exists"
31+
ansible.builtin.set_fact:
32+
ikc_subjectAltName_values: "{{ ikc_subjectAltName_values | default([]) + [ansible_default_ipv4.address+'.sslip.io'] }}"
33+
when: ansible_default_ipv4.address is defined and ansible_default_ipv4.address|length >0
3034

3135
- name: "Add IPv6 if exists"
3236
ansible.builtin.set_fact:
@@ -42,7 +46,7 @@
4246
ansible.builtin.set_fact:
4347
ikc_subjectAltName: "{{ ikc_subjectAltName_list | join(',') }}"
4448

45-
- name: "Generate certificate in to '{{ registry_cert_dir }}' for host '{{ registry_hostname }}'"
49+
- name: "Generate certificate in to '{{ registry_cert_dir }}' with subjectAltName='{{ ikc_subjectAltName }}'"
4650
ansible.builtin.command: 'openssl req -newkey rsa:4096 -nodes -sha256 -keyout {{ registry_cert_dir }}/domain.key -x509 -days 365 -subj ''/CN=${reg_name}'' -addext "subjectAltName={{ ikc_subjectAltName }}" -out {{ registry_cert_dir }}/domain.crt -batch'
4751
failed_when: false
4852
changed_when: true

0 commit comments

Comments
 (0)