-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
salt, build: add certs renewal orchestrate
This orchestrate will be called by the reactor when it will receive an event for an expired certificates. It will run `sls` defined under `certs_renewal` pillar entry for each expired certificate. Refs: #1887
- Loading branch information
1 parent
f2e1b52
commit 6d59b36
Showing
2 changed files
with
17 additions
and
0 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
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,15 @@ | ||
{%- set target_pillar = salt.saltutil.runner( | ||
'pillar.show_pillar', kwarg={'minion': pillar.orchestrate.target} | ||
) %} | ||
{%- set sls = [] %} | ||
|
||
{%- for cert in target_pillar.certs_renewal %} | ||
{%- if cert["name"] in pillar.orchestrate.certificates %} | ||
{%- do sls.extend(cert["sls"]) %} | ||
{%- endif %} | ||
{%- endfor %} | ||
|
||
Renew expired certificates: | ||
salt.state: | ||
- tgt: {{ pillar.orchestrate.target }} | ||
- sls: {{ sls | unique | json }} |