-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* sys: no longer need to restart svc, reloads certs on req etcd-io/etcd@4e21f87
- Loading branch information
1 parent
b82135e
commit 25adeae
Showing
3 changed files
with
41 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
variable "on_calendar" {} | ||
|
||
data "ignition_systemd_unit" "cert-fetch-service" { | ||
name = "cert-fetch.service" | ||
|
||
content = <<EOS | ||
[Unit] | ||
Description=Fetch new certificates from cfssl server | ||
[Service] | ||
Type=oneshot | ||
ExecStart=/opt/bin/cfssl-new-cert | ||
[Install] | ||
WantedBy=multi-user.target | ||
EOS | ||
} | ||
|
||
data "ignition_systemd_unit" "cert-fetch-timer" { | ||
name = "cert-fetch.timer" | ||
|
||
content = <<EOS | ||
[Unit] | ||
Description=Fetch new certificates from cfssl server | ||
[Timer] | ||
OnCalendar=${var.on_calendar} | ||
AccuracySec=1s | ||
RandomizedDelaySec=60min | ||
[Install] | ||
WantedBy=timers.target | ||
EOS | ||
} | ||
|
||
output "systemd_units" { | ||
value = [ | ||
"${data.ignition_systemd_unit.cert-fetch-service.id}", | ||
"${data.ignition_systemd_unit.cert-fetch-timer.id}", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters