Skip to content

Commit

Permalink
Use load balancer hostname for SSH
Browse files Browse the repository at this point in the history
  • Loading branch information
andykrohg authored and jharmison-redhat committed Feb 17, 2021
1 parent cc7d089 commit 1bcf6f4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions roles/gitea-ocp/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@
set_fact:
_gitea_actual_route: "{{ r_route.resources[0].spec.host }}"

- name: Get External IP for SSH
k8s_info:
api_version: v1
kind: Service
name: "{{ _gitea_name }}"
namespace: "{{ _gitea_namespace }}"
register: gitea_service
when: _gitea_external_ip

- name: Set Route dependant OpenShift Objects for Gitea to {{ _gitea_state }}
k8s:
state: "{{ _gitea_state }}"
Expand Down
2 changes: 1 addition & 1 deletion roles/gitea-ocp/templates/config_map.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ data:

[server]
ROOT_URL = {{ 'http' if not _gitea_ssl|bool else 'https' }}://{{ _gitea_actual_route|default(_gitea_expose_uri) }}
SSH_DOMAIN = {{ _gitea_actual_route|default(_gitea_expose_uri) }}
SSH_DOMAIN = {{ gitea_service.resources[0].status.loadBalancer.ingress[0].hostname | default(_gitea_expose_uri) }}
DOMAIN = {{ _gitea_actual_route|default(_gitea_expose_uri) }}
HTTP_PORT = 3000
SSH_PORT = 2022
Expand Down

0 comments on commit 1bcf6f4

Please sign in to comment.