Skip to content

Commit 3c95a0d

Browse files
committed
Use unix socket for httpd -> Foreman communication
1 parent fa73cc6 commit 3c95a0d

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

roles/foreman/defaults/main.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
22
foreman_container_image: "quay.io/evgeni/foreman-rpm"
33
foreman_container_tag: "nightly"
4-
foreman_listen_stream: localhost:3000
4+
foreman_listen_stream: /run/foreman.sock
5+
foreman_url: "https://{{ ansible_fqdn }}"

roles/foreman/tasks/main.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@
122122

123123
- name: Wait for Foreman service to be accessible
124124
ansible.builtin.uri:
125-
url: 'http://{{ foreman_listen_stream }}/api/v2/ping'
125+
url: '{{ foreman_url }}/api/v2/ping'
126+
validate_certs: false # TODO
126127
until: foreman_status.status == 200
127128
retries: 60
128129
delay: 5
@@ -140,7 +141,8 @@
140141

141142
- name: Wait for Foreman tasks to be ready
142143
ansible.builtin.uri:
143-
url: 'http://{{ foreman_listen_stream }}/api/v2/ping'
144+
url: '{{ foreman_url }}/api/v2/ping'
145+
validate_certs: false # TODO
144146
until: foreman_tasks_status.json['results']['katello']['services']['foreman_tasks']['status'] == 'ok'
145147
retries: 60
146148
delay: 5
@@ -152,6 +154,7 @@
152154
theforeman.foreman.smart_proxy:
153155
name: "{{ ansible_fqdn }}"
154156
url: "https://{{ ansible_fqdn }}:9090"
155-
server_url: "http://{{ foreman_listen_stream }}"
157+
server_url: "{{ foreman_url }}"
158+
validate_certs: false # TODO
156159
username: admin
157160
password: changeme

roles/foreman/templates/settings.yaml.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
:ssl_ca_file: /etc/foreman/katello-default-ca.crt
44
:ssl_priv_key: /etc/foreman/client_key.pem
55

6+
:foreman_url: {{ foreman_url }}
7+
68
:rails_cache_store:
79
:type: redis
810
:urls:

roles/foreman_proxy/templates/settings.yaml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
:trusted_hosts:
88
- {{ ansible_fqdn }}
99

10-
:foreman_url: http://{{ ansible_fqdn }}:3000
10+
:foreman_url: https://{{ ansible_fqdn }}
1111

1212
:foreman_ssl_ca: /etc/foreman-proxy/foreman_ssl_ca.pem
1313
:foreman_ssl_cert: /etc/foreman-proxy/foreman_ssl_cert.pem

roles/httpd/defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
httpd_ssl_dir: /etc/pki/httpd
22
httpd_pulp_api_backend: http://localhost:24817
33
httpd_pulp_content_backend: http://localhost:24816
4-
httpd_foreman_backend: http://localhost:3000
4+
httpd_foreman_backend: unix:///run/foreman.sock

0 commit comments

Comments
 (0)