Add contents_gpg to file.managed #67443
Replies: 13 comments
-
Hi, I very happy to see this new functionality getting attention. Still I feel the approach looks a bit entangled/complex. I think the original need was to allow sensitive, and possibly binary, data to be stored as files into (and served from) pillar, like ssh keys for instance or x509 keys. From a user/usability perspective, as evoked in #1543, an intuitive mean would be To sum up, I guess I suggest to support files as another built-in source for pillar data, just as yaml data. With this approach, we'd probably win renderer flexibility, environment support, and maybe other functionality that I can't think of. I guess |
Beta Was this translation helpful? Give feedback.
-
The idea of using the file_tree external pillar is to allow for ACLs so that a file can not be readable and able to be decrypted by any minion that doesn't need to have that information. Trading convenience for added security, so to speak. To do it in the way you suggest means that the file is just part of the |
Beta Was this translation helpful? Give feedback.
-
Having followed #1543, I'm well aware that sensitive data should be in pillar :) What in my proposition suggests
I stated:
I think I duplicated #3790. How about:
which would be available as pillar |
Beta Was this translation helpful? Give feedback.
-
It may be possible, this would be something that would need to be implemented in the common code that compiles both pillar top files and top files for states. |
Beta Was this translation helpful? Give feedback.
-
What if we renamed the "template" argument of file.managed to "renderer" and allowed all renderer modules here. That would make the OP's request possible, as well as provide much greater flexibility in what we do with managed files (also considering you could add custom renderer modules). |
Beta Was this translation helpful? Give feedback.
-
@github-abcde Renaming the argument would not work, because not all renderers return a string. There are two types of renderers, data renderers and template renderers. Data renderers return a Python dictionary, while template renderers return a string. What might work is allowing for a pipe syntax similar to what we allow for renderers, so that we can pass the file through multiple template renderers. For example:
Thoughts? |
Beta Was this translation helpful? Give feedback.
-
That looks like it will probably work if something similar is done like in |
Beta Was this translation helpful? Give feedback.
-
Related: #18406 (comment) |
Beta Was this translation helpful? Give feedback.
-
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
Beta Was this translation helpful? Give feedback.
-
Bump stalebot! |
Beta Was this translation helpful? Give feedback.
-
Thank you for updating this issue. It is no longer marked as stale. |
Beta Was this translation helpful? Give feedback.
-
@terminalmage are you still planning to work on this issue, if not I will unassign. |
Beta Was this translation helpful? Give feedback.
-
Probably not in the near future. I've unassigned myself. |
Beta Was this translation helpful? Give feedback.
-
The combination of the
file_tree
ext_pillar andcontents_pillar
argument tofile.managed
allow for binary files to be deployed in pillar data. However, to deploy gpg-encrypted contents, a new argumentcontents_gpg
should be added that, ifTrue
, pass the contents through thegpg
renderer to decrypt them.Refs: #1543
CC: @fbretel
Beta Was this translation helpful? Give feedback.
All reactions