-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite service layout & add sftp support #24
base: main
Are you sure you want to change the base?
Conversation
In Puppet the following is true: Array('string') == Array(['string']) == ['string'] This can be used to make sure variables are always arrays. Then it's simple to concat these using + to avoid a call to flatten. With this it's ensured there are no undef values, so this can be safely dropped.
This changes the service layout to install common services: * [email protected] and [email protected] * [email protected] and [email protected] * [email protected] and [email protected] Then for every repository an instance can be configured and enabled. The instances are configured using systemd drop in files, which means it's easier to see which repositories actually override parameters. It also introduces a restic system user (and group), which through the use of the CAP_DAC_READ_SEARCH capability is still able to read all files if needed. The config files are read as environment files from /etc/restic, rather than /etc/default. Using EnvironmentFile is the most secure option, since every user can read the systemd service files. The /etc/restic directory is better to keep everything in one place. /etc/default is also not common on Red Hat based operating systems.
CentOS 7 is not listed because the restic package isn't in EPEL7.
This does not yet add support for passing a username, but this can be configured via the user's SSH config.
@ekohl thanks for the PR and sorry for the late reply. I did not expect other to work on that repo :D Would it be possible to split the PR into separate PRs? Like fixing examples, adding sftp, and rework service. |
I like the approach. Since you are doing a huge breaking change it would be nice to add a migration path for those who are currently using the module. |
Is this new approach still something being considered? |
I'll admit that I haven't had time to look at this further. |
Vote for this PR =) |
Within the Foreman project there was a need to have backups and while writing my own module I found yours. It largely solves my need, but I prefer a different style that uses native systemd functionality. Instead of relying on concat resources, it uses drop in files.
Then I added sftp support, since that's what we use in our infra.
Currently the tests are broken because I haven't had time to look at them. I also don't use the PDK so it's been a bit painful. The acceptance tests were ran using Beaker and Vox Pupuli's acceptance setup.
For now this is mostly here so I can at least track a PR while I start using this in production.
Fixes #23