Skip to content

Commit c13c6c9

Browse files
everton-dematosbrianmcgillion
authored andcommitted
logging: start Alloy after dynamic hostname setter when enabled
Signed-off-by: Everton de Matos <[email protected]>
1 parent 9020c2e commit c13c6c9

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

modules/common/logging/client.nix

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ let
1515
;
1616
cfg = config.ghaf.logging.client;
1717
inherit (config.ghaf.logging) listener;
18+
dynHostEnabled = config.ghaf.identity.vmHostNameSetter.enable or false;
1819
in
1920
{
2021
options.ghaf.logging.client = {
@@ -125,7 +126,10 @@ in
125126
services.alloy.enable = true;
126127

127128
systemd.services.alloy.serviceConfig = {
128-
after = [ "systemd-journald.service" ];
129+
after = [
130+
"systemd-journald.service"
131+
]
132+
++ lib.optionals dynHostEnabled [ "set-dynamic-hostname.service" ];
129133
requires = [ "systemd-journald.service" ];
130134

131135
# Once alloy.service in admin-vm stopped this service will

modules/common/logging/server.nix

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ let
1616
;
1717
inherit (lib.strings) hasPrefix;
1818
cfg = config.ghaf.logging.server;
19+
dynHostEnabled = config.ghaf.identity.vmHostNameSetter.enable or false;
1920
in
2021
{
2122
options.ghaf.logging.server = {
@@ -232,7 +233,10 @@ in
232233
services.alloy.enable = true;
233234

234235
systemd.services.alloy.serviceConfig = {
235-
after = [ "systemd-journald.service" ];
236+
after = [
237+
"systemd-journald.service"
238+
]
239+
++ lib.optionals dynHostEnabled [ "set-dynamic-hostname.service" ];
236240
requires = [ "systemd-journald.service" ];
237241

238242
# If there is no internet connection , shutdown/reboot will take around 100sec

0 commit comments

Comments
 (0)