The original example from Bas:
bundle agent main
{
methods:
"" usebundle => create_link();
"" usebundle => create_template();
}
The original example from Bas:
bundle agent main
{
methods:
"" usebundle => create_link();
"" usebundle => create_template();
}
Say we have some JSON array of objects:
[
{ "name":"Masin", "location":"Berlin"},
{ "name":"Nick", "location":"LFK", "comment": "https://www.reddit.com/r/Lawrence/comments/13udnwx/what_does_lfk_stand_for" },
{ "name":"Ole","location":"Oslo"}
]
(setq org-roam-dailies-capture-templates | |
`( | |
("j" "Journal") | |
("e" "Email") | |
("ec" "Compose") | |
("er" "Response" ) | |
; Work related templates | |
("w" "Work") | |
@fnat@social.coop https://social.coop/@fnat/114830041609939391 was interested in a workflow where he would write an email in org-mode that gets converted to text to be sent out.
A question from Wolfgang in #CFEngine:matrix.org
I’m confused. I have a bundle that should only run on one specific host. What confuses me is that CFE tries to evaluate the variables. In that bundle, I have something like “uid” int => getuid(“my-user”), but of course this user does not exist on the other systems. However, cfe shows an error saying that it could not get the uid for that user.
CFEngine is eager to resolve variables (classes in common bundles too), for more read about pre-evaluation.
You can use $(const.dollar)
if you are looking to render a literal $( )
into a file, alternatively you can use backticks.
bundle agent example_subshell_cfengine_files_promise
{
files:
"/tmp/using-const.dollar.txt"
content => "#!/bin/env bash $(const.n)echo $(const.dollar)(hostname)",
perms => m( "u+rwx" );
Bundle parameters are optional.
Both in the sense of implementation, but also from the perspective of use.
I did not know (or if I did, i don’t even remember forgetting) that bundle parameters, if present are optional. In that, a bundle that has parameters can be called without parameters . However, if you call with non-zero parameters you must supply all (that part I knew).
bundle agent __main__
{
bundle agent __main__
{
vars:
"stuff" slist => { "some", "thing-s", "that's", "not valid", "variable names"};
"classic_associative_array[$(stuff)]"
string => string_upcase("$(stuff)");
}