Skip to content
This repository has been archived by the owner on Apr 21, 2019. It is now read-only.

luacat/lib: resource function for adding/removing lines from config files #29

Closed
zombiezen opened this issue Jan 5, 2017 · 0 comments
Closed
Milestone

Comments

@zombiezen
Copy link
Owner

The use case for this is files like /etc/hosts or /etc/ssh/ssh_known_hosts: files where just creating or removing a file in a foo.d directory isn't sufficient. The set of requirements are:

  • Must be able to add lines to a file that don't have a keyed identifier.
  • Must be able to idempotently remove lines from a file that contains a keyed identifier.
  • The keyed identifier may be at the beginning or end of a line. At the moment, the particular use cases have non-whitespace characters as identifiers, but the rest of the desired line may contain whitespace.

If at all possible, I would like to not add new catalog schema to support this feature. I'm hoping that the combination of luacat plus being able to execute arbitrary bash is powerful enough to support this feature. It may also be interesting to try to develop a means for testing luacat scripts as part of feature development on this, but not a must-have.

@zombiezen zombiezen added this to the 0.2 milestone Jan 5, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant