Skip to content

Commit f828d4d

Browse files
authored
Merge pull request sabre1041#9 from cooktheryan/keycloak
Removing keycloak requirement
2 parents 41f7c02 + 0a90e58 commit f828d4d

File tree

6 files changed

+55
-18
lines changed

6 files changed

+55
-18
lines changed

roles/sigstore_scaffolding/defaults/main.yml

+9-2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ sigstore_trillian_templates:
2828
- manifests/trillian/trillian-logserver.yaml
2929
- manifests/trillian/trillian-logsigner.yaml
3030

31+
ctlog_enabled: true
32+
tuf_enabled: true
33+
34+
trillian_enabled: true
3135
trillian:
3236
mysql:
3337
user: mysql
@@ -74,7 +78,7 @@ remote_ctlog_public_key: "{{ certs_dir }}/{{ ctlog_public_key_filename }}"
7478
remote_rekor_signer: "{{ certs_dir }}/{{ rekor_signer_filename }}"
7579
remote_rekor_public_key: "{{ certs_dir }}/{{ rekor_public_key_filename }}"
7680

77-
81+
rekor_enabled: true
7882
rekor_public_key_retries: 5
7983
rekor_public_key_delay: 10
8084
fulcio_server_config: "{{ kube_configmap_dir }}/fulcio-config.yaml"
@@ -90,13 +94,16 @@ keycloak_certs_config: "{{ kube_configmap_dir }}/keycloak-certs.yaml"
9094
setup_host_dns: true
9195
base_hostname: ""
9296

97+
fulcio_enabled: true
9398
fulcio_ca_passphrase: sigstore
9499
ctlog_ca_passphrase: sigstore
95100
rekor_ca_passphrase: sigstore
96101
ct_logprefix: sigstoreansible
97102

98103
scaffolding_utils_image: quay.io/ablock/sigstore-scaffolding-helper:latest
99104

105+
keycloak_enabled: true
106+
keycloak_url: keycloak.{{ base_hostname }}
100107
keycloak_wait_increment_seconds: 60
101108
keycloak_postgresql_user: "keycloak"
102109
keycloak_postgresql_password: "keycloak"
@@ -132,4 +139,4 @@ trillian_db_image: gcr.io/trillian-opensource-ci/db_server@sha256:22b7fddcb4bafc
132139
tuf_image: quay.io/rcook/tuf/server:latest
133140
netcat_image: quay.io/rcook/netcat:v1.0.0
134141
nginx_image: registry.access.redhat.com/ubi8/nginx-120@sha256:0d4543b4cf26eb46b1632006cc5b24a1925336973eb3ec17cdfb9fec372da5b8
135-
curl_image: registry.access.redhat.com/ubi9/ubi-minimal:latest
142+
curl_image: registry.access.redhat.com/ubi9/ubi-minimal:latest

roles/sigstore_scaffolding/tasks/keycloak/setup.yml

+2-6
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,11 @@
88

99
- name: Set Keycloak Hostname
1010
ansible.builtin.set_fact:
11-
keycloak_hostname: "https://keycloak.{{ base_hostname }}"
12-
13-
- name: Set Keycloak Hostname
14-
ansible.builtin.set_fact:
15-
keycloak_auth_url: "{{ keycloak_hostname }}{{ keycloak_auth_endpoint }}"
11+
keycloak_auth_url: "https://{{ keycloak_url }}{{ keycloak_auth_endpoint }}"
1612

1713
- name: "Wait until Keycloak becomes active and ready"
1814
ansible.builtin.uri:
19-
url: "{{ keycloak_hostname }}/health/ready"
15+
url: "https://{{ keycloak_url }}/health/ready"
2016
method: GET
2117
validate_certs: false
2218
register: keycloak_status

roles/sigstore_scaffolding/tasks/podman.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,28 @@
2020

2121
- name: Configure/Deploy keycloak
2222
ansible.builtin.include_tasks: podman/keycloak.yml
23+
when: keycloak_enabled | bool
2324

2425
- name: Configure/Deploy Trillian
2526
ansible.builtin.include_tasks: podman/trillian.yml
27+
when: trillian_enabled | bool
2628

2729
- name: Setup Trillian Tree ID
2830
ansible.builtin.include_tasks: podman/createtree.yml
31+
when: trillian_enabled | bool
2932

3033
- name: Configure/Deploy Rekor
3134
ansible.builtin.include_tasks: podman/rekor.yml
35+
when: rekor_enabled | bool
3236

3337
- name: Configure/Deploy Fulcio
3438
ansible.builtin.include_tasks: podman/fulcio.yml
39+
when: fulcio_enabled | bool
3540

3641
- name: Configure/Deploy ctlog
3742
ansible.builtin.include_tasks: podman/ctlog.yml
43+
when: ctlog_enabled | bool
3844

3945
- name: Configure/Deploy tuf
40-
ansible.builtin.include_tasks: podman/tuf.yml
46+
ansible.builtin.include_tasks: podman/tuf.yml
47+
when: tuf_enabled | bool

roles/sigstore_scaffolding/templates/configs/fulcio-oidc.conf.j2

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"OIDCIssuers": {
3-
"https://keycloak.{{ base_hostname }}{{ keycloak_auth_endpoint }}/realms/{{ keycloak_realm }}": {
3+
"https://{{ keycloak_url }}{{ keycloak_auth_endpoint }}/realms/{{ keycloak_realm }}": {
44
"ClientID": "{{ keycloak_sigstore_client }}",
5-
"IssuerURL": "https://keycloak.{{ base_hostname }}{{ keycloak_auth_endpoint }}/realms/{{ keycloak_realm }}",
5+
"IssuerURL": "https://{{ keycloak_url }}{{ keycloak_auth_endpoint }}/realms/{{ keycloak_realm }}",
66
"Type": "email"
77
}
88
}

roles/sigstore_scaffolding/templates/configs/nginx.conf.j2

+32-5
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ events {
1010
worker_connections 1024;
1111
}
1212

13-
1413
http {
14+
map_hash_bucket_size 128;
15+
map_hash_max_size 128;
16+
server_names_hash_bucket_size 128;
1517
include /etc/nginx/mime.types;
1618
default_type application/octet-stream;
1719

@@ -41,25 +43,50 @@ http {
4143

4244
stream {
4345

46+
map_hash_bucket_size 128;
4447
map $ssl_server_name $targetBackend {
48+
{% if rekor_enabled %}
4549
rekor.{{ base_hostname }} rekor-server-pod:3000;
50+
{% endif %}
51+
{% if tuf_enabled %}
4652
tuf.{{ base_hostname }} tuf-pod:8080;
53+
{% endif %}
54+
{% if fulcio_enabled %}
4755
fulcio.{{ base_hostname }} fulcio-server-pod:5555;
48-
keycloak.{{ base_hostname }} keycloak:8080;
56+
{% endif %}
57+
{% if keycloak_enabled %}
58+
{{ keycloak_url }} keycloak:8080;
59+
{% endif %}
4960
}
5061

5162
map $ssl_server_name $targetCert {
63+
{% if rekor_enabled %}
5264
rekor.{{ base_hostname }} /certs/ingress-rekor.pem;
65+
{% endif %}
66+
{% if tuf_enabled %}
5367
tuf.{{ base_hostname }} /certs/ingress-tuf.pem;
68+
{% endif %}
69+
{% if fulcio_enabled %}
5470
fulcio.{{ base_hostname }} /certs/ingress-fulcio.pem;
55-
keycloak.{{ base_hostname }} /certs/ingress-keycloak.pem;
71+
{% endif %}
72+
{% if keycloak_enabled %}
73+
{{ keycloak_url }} /certs/ingress-keycloak.pem;
74+
{% endif %}
5675
}
5776

5877
map $ssl_server_name $targetCertKey {
78+
{% if rekor_enabled %}
5979
rekor.{{ base_hostname }} /certs/ingress-rekor.key;
80+
{% endif %}
81+
{% if tuf_enabled %}
6082
tuf.{{ base_hostname }} /certs/ingress-tuf.key;
83+
{% endif %}
84+
{% if fulcio_enabled %}
6185
fulcio.{{ base_hostname }} /certs/ingress-fulcio.key;
62-
keycloak.{{ base_hostname }} /certs/ingress-keycloak.key;
86+
{% endif %}
87+
{% if keycloak_enabled %}
88+
{{ keycloak_url }} /certs/ingress-keycloak.key;
89+
{% endif %}
6390
}
6491

6592
server {
@@ -75,4 +102,4 @@ stream {
75102
proxy_pass $targetBackend;
76103
}
77104

78-
}
105+
}

roles/sigstore_scaffolding/templates/manifests/keycloak/keycloak.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ spec:
4646
- name: KC_HEALTH_ENABLED
4747
value: "true"
4848
- name: KC_HOSTNAME_URL
49-
value: "https://keycloak.{{ base_hostname }}"
49+
value: "https://{{ keycloak_url }}"
5050
- name: KC_HOSTNAME_ADMIN_URL
51-
value: "https://keycloak.{{ base_hostname }}"
51+
value: "https://{{ keycloak_url }}"
5252
args:
5353
- start
5454
image: quay.io/keycloak/keycloak@sha256:b8f2a453a17a244a829fdafdb08dd77f719d3622bc3987c76a81771c0913b882

0 commit comments

Comments
 (0)