I’ve noticed that there is nothing in the default policies that updates /var/cfengine/modules (in particular …/packages/apt_get) from the policy server’s masterfiles.
Searching the group’s history, I found that Nick Anderson wrote (7/27/15):
>>> BS (Bruce Schultz)> One problem is that modules typically live in
>>> >$(sys.workdir)/modules ... is there any technical reason that they
>>> >could not be in services/modules instead?
>>>
>>>In the past when I have wanted to ship modules inside of masterfiles, I
>>>just add a policy to copy from masterfiles into /var/cfengine/modules on
>>>the policy hub. The default update policy copies /var/cfengine/modules
>>>from the hub to /var/cfengine/modules on the remote agents.
I can’t find any other rationale for why the ${sys.workdir}/modules area would not be updated.
And this location is hardcoded in package_module.c:
static char *GetPackageModuleRealPath(const char *package_module_name)
{
return StringFormat("%s%c%s%c%s%c%s", GetWorkDir(), FILE_SEPARATOR,
"modules", FILE_SEPARATOR, "packages", FILE_SEPARATOR,
package_module_name);
}
The /var/cfengine/modules/packages directory is initially created and populated by the packaging scripts (~cfengine/buildscripts/packaging/common/cfengine-non-hub/postinstall.sh) based on $PREFIX/share/CoreBase/modules/packages, which I’d say is just as reasonable as the copying of masterfiles from there.
But why doesn’t update.cf take care of this directory?
--Joe
Dear Joe,
The modules/ directory in workdir is intended for CFEngine's own modules, which ship with CFEngine, not user-defined modules.
That's why there is no update policy for that directory. It is provided by the package and is not expected to change.
Best
Aleksey
--
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to help-cfengine+unsubscribe@googlegroups.com.
To post to this group, send email to help-c...@googlegroups.com.
Visit this group at https://groups.google.com/group/help-cfengine.
For more options, visit https://groups.google.com/d/optout.
Ok, that (somewhat) makes sense, except that https://docs.cfengine.com/lts/reference-standard-library-package_modules.html#the-package-module says that “The package module resides in the /var/cfengine/modules/packages both on the hub and the clients, and out of the box CFEngine is set up to synchronize this directory among its clients” which looks to me like it should be updated.
With the package module path hardcoded as /var/cfengine/modules/packages, there is no way to provide user-defined packaging modules (such as pip, npm, and others that are available in the old packages promises) in a supported fashion?
--Joe
To unsubscribe from this group and stop receiving emails from it, send an email to help-cfengin...@googlegroups.com.
To post to this group, send email to help-c...@googlegroups.com.
Visit this group at https://groups.google.com/group/help-cfengine.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to help-cfengin...@googlegroups.com.
Dear David,
CFEngine suggests users put customization to the policy code into "services/" directory (as in, site-specific computing services); however in practice what I often see is people put their organizations code into a top-level directory like "acme/", so for example "acme/modules/".
Yours,
Aleksey
>> email to help-cfengine+unsubscribe@googlegroups.com.
>> To post to this group, send email to help-c...@googlegroups.com.
>> Visit this group at https://groups.google.com/group/help-cfengine.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "help-cfengine" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> To post to this group, send email to help-c...@googlegroups.com.
> Visit this group at https://groups.google.com/group/help-cfengine.
> For more options, visit https://groups.google.com/d/optout.
The cfe_internal_update_policy_files_update_modules files promise in
cfe_internal/update/update_policy.cf should take care of syncing the
modules directory from the hub by default.
https://github.com/cfengine/masterfiles/blob/master/cfe_internal/update/update_policy.cf#L104-#L110
On Sep 21, 2016 11:22 AM, "Moore, Joe" <joe....@siemens.com> wrote:
I’ve noticed that there is nothing in the default policies that updates /var/cfengine/modules (in particular …/packages/apt_get) from the policy server’s masterfiles.