You can set global environmental variables using the "environment"
attribute of the agent control body part.
For example, run this:
{{{
body common control
{
bundlesequence => { "one" };
}
############################################
body agent control
{
environment => { "A=123", "B=456", "PGK_PATH=/tmp"};
}
############################################
bundle agent one
{
commands:
"/usr/bin/env";
}
}}}
Best,
-at
On Tue, Sep 6, 2011 at 3:14 PM, <[email protected]> wrote:
> Forum: CFEngine Help
> Subject: Call bash commands in cfengine
> Author: jimmiez
> Link to topic: https://cfengine.com/forum/read.php?3,23374,23374#msg-23374
>
> Hi cfegineers,
>
> I added some global env variables in /etc/profile and tried to call "source
> /etc/profile" to apply the change immediately. But it cfengine reported:
> 'Proposed executable file "source" doesn't exist'. Anyone know how to make it
> work in cfengine? Or any better way to set global env values?
>
> Below is part of my code that didn't work:
>
> ...
> bundle agent set_profile
> {
> commands:
> "source /etc/profile"
> contain => in_shell_and_silent;
> }
> ...
>
> Thanks a lot!
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine