Open signe opened 1 month ago
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey. Please be sure to review our Code of Conduct. Also, check out some of our community resources including:
There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. If you have additional questions, email us at saltproject@vmware.com. We’re glad you’ve joined our community and look forward to doing awesome things with you!
file.keyvalue
currently provides the create_if_missing flag, but controlling the created (or existing) file's ownership or permissions is impossible.As mentioned in the original bug, #63545,
file.serialize
is another option to controlkeyvalue
files and it does allow for owner/perm controls, but it is more suited to managing an entire file and not specific values in the file.serializer.keyvalue
doesn't support the same options thatfile.keyvalue
does (e.g.uncomment
,append...
,prepend...
, etc.), and it is also unable to handle any data that doesn't match the<key><separator><value>
formatting such as line comments.So, you can't have a situation where your expected output is:
file.keyvalue
will correctly handle the file contents, uncommenting lines if necessary, pre/appending, ignoring line comments, etc., but the ownership will be 🤷♀️file.serialize
will create and manage the file with the correct ownership, but the file contents will not be handled correctly. Specifically, pre-existing line comments will cause the deserializer to barf and fail to modify the file at all:With an existing file of:
Results in errors like:
Having to add a separate
file.managed
state to accomplish this is clunky at best, because thefile.managed
andfile.keyvalue
can't exist in the same state without errors:Attempting this
Will result in errors: