Replies: 3 comments
-
Scanning the policy, I saw this directory creation promise:
I think you should add a trailing dot so that it's very explicitly a directory.
Next I saw this:
/me get's on soap-box to rail against the I do not like this body:
Then I got to your question:
They could be variables instead of values there, then the variables they use could hinge on different contexts, but for what you are doing here, parameters would probably be what you are looking for. It seems like you should be able to set the attribute based on a variable (you can do this for usebundle values), but it doesn't work, the agent complains about the unresolved variable being undefined.
I thought that you might be able to do some dynamic inheritance, but no, that doesn't work either.
I wondered about that as well, but no, it seems like you can't do dynamic body names. It complains if it's quoted and it complains about not being defined if it's not quoted. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your comment Nick. I missed the The comment about classes is on point. I'm afraid 100% of our policies look like that... so that will take a while to convert. (note: our repo was converted from cfengine2, and it probably more than 30y old. Our git repo "only" goes back to 2011). Thanks for answering my question. I probably go for multiple version of this and add |
Beta Was this translation helpful? Give feedback.
-
closing this, because per my question and ensuing discussion this does not seem possible. Thanks all! |
Beta Was this translation helpful? Give feedback.
-
Hi,
If got the following code (based of https://northerntech.atlassian.net/browse/CFE-4225):
which is most often called like this:
Now you see those
mog(0644, root, root)
andmog(0755, root, root)
is there any way to make that configurable other than adding them to the bundle's parameters?Or should I make a prototype like:
bundle agent sync_cp_annotated_files(files,from,to,pattern, mogfile, mogdir)
and then use them asperms => $(mogfile);
(if that works at all)I looked at
with
which may or may not do what I need here, but that seems to be limited to variable passing.(unrelated I may drop the directory creation from this bundle, with would leave only one
mog
to be configured - this may make things easier).Thanks,
Miek
Beta Was this translation helpful? Give feedback.
All reactions