Skip to content

Commit 568da1e

Browse files
committed
Use systemd socket activation for Foreman
1 parent 13606e3 commit 568da1e

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
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_url: "http://localhost:3000"
4+
foreman_listen_stream: localhost:3000
5+
foreman_url: "http://{{ foreman_listen_stream }}"

roles/foreman/tasks/main.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@
4646
name: foreman-client-key
4747
path: "{{ foreman_client_key }}"
4848

49+
- name: Deploy Foreman socket
50+
ansible.builtin.template:
51+
src: foreman.socket.j2
52+
dest: /etc/systemd/system/foreman.socket
53+
mode: '0644'
54+
4955
- name: Deploy Foreman Container
5056
containers.podman.podman_container:
5157
name: "foreman"
@@ -64,6 +70,8 @@
6470
SEED_ADMIN_PASSWORD: changeme
6571
quadlet_options:
6672
- |
73+
[Unit]
74+
Requires=foreman.socket
6775
[Install]
6876
WantedBy=default.target
6977
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[Unit]
2+
Description=Foreman socket
3+
4+
[Socket]
5+
ListenStream={{ foreman_listen_stream }}
6+
7+
[Install]
8+
WantedBy=sockets.target

0 commit comments

Comments
 (0)