Closed RobHooper closed 1 month ago
Additional task when deploying:
I moved the macro back out to a state file, and promoted the backup Pillar keys to top-level.
Regarding top.sls
, salt expects matches to contain a delimiter flagging an error and ignoring the match if it is missing.
I have worked around this by updating top.sls
to match any content I@backup:*
.
https://github.com/saltstack/salt/blob/29b6843268e9877c28bd283b0aa9d77e4bae948d/salt/matchers/pillar_match.py#L20-L21
In configuring backups for Coalition ( #425 ) I found that the existing site file backup code had been explicitly configured for "redmine". This PR moves the Salt code into a macro so that it can be shared between services.
I chose a macro over a separate
backup.sls
file for a few reasons, firstly, we can re-use theuserdir
variable from the service code. It also makes it easier to match the pillar data to salt, for instance, there is aredmine
value in both butwordpress
is used bycoalition
in thesalt
directory. I am on the fence if this is the ideal solution, happy to change approach if there is a good reason for an alternative structure.