Skip to content

Commit 19a28df

Browse files
committed
Use unix socket for httpd -> Foreman communication
1 parent 568da1e commit 19a28df

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

playbooks/deploy.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@
3333
foreman_db_password: "CHANGEME"
3434
foreman_oauth_consumer_key: abcdefghijklmnopqrstuvwxyz123456
3535
foreman_oauth_consumer_secret: abcdefghijklmnopqrstuvwxyz123456
36+
foreman_listen_stream: /run/foreman.sock
3637
foreman_url: "https://{{ ansible_fqdn }}"
38+
httpd_foreman_backend: "unix://{{ foreman_listen_stream }}|http://%{HTTP_HOST/"
3739
httpd_server_ca_certificate: "{{ ca_certificate }}"
3840
httpd_client_ca_certificate: "{{ ca_certificate }}"
3941
httpd_server_certificate: "{{ server_certificate }}"

roles/foreman/templates/foreman.socket.j2

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ Description=Foreman socket
33

44
[Socket]
55
ListenStream={{ foreman_listen_stream }}
6+
SocketUser=apache
7+
SocketMode=0600
8+
9+
NoDelay=false
10+
ReusePort=true
11+
Backlog=1024
612

713
[Install]
814
WantedBy=sockets.target

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: http://localhost:3000/

roles/httpd/templates/foreman-ssl-vhost.conf.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@
7070
ProxyPass /pulp !
7171
ProxyPass /icons !
7272
ProxyPass /server-status !
73-
ProxyPass / {{ httpd_foreman_backend }}/ retry=0 timeout=900
74-
ProxyPassReverse / {{ httpd_foreman_backend }}/
73+
ProxyPass / {{ httpd_foreman_backend }} retry=0 timeout=900
74+
ProxyPassReverse / {{ httpd_foreman_backend }}
7575

7676
AddDefaultCharset UTF-8
7777
</VirtualHost>

0 commit comments

Comments
 (0)