Re: Could not load requested further augments from file

"'Nick Anderson' via help-cfengine" <[email protected]> Fri, 16 Aug 2024 15:42:26 -0500
Newsgroups gmane.comp.sysutils.cfengine.general
Message-ID <CAE46pPsBst4h1pdTPfZ__NEUPFvKvweYH-teMPp-RgbiTof3Ww@mail.gmail.com>
Def.jq might itself be special what about def.foo?

On Fri, Aug 16, 2024, 3:10 PM '[email protected]' via help-cfengine <
[email protected]> wrote:

> The docs might be a bit imprecise.
> https://docs.cfengine.com/docs/3.24/reference-language-concepts-augments.html
> says in two separate notes:
>
>
>    - CFEngine variables are *not* expanded unless otherwise noted.
>
>
>    - sys
>    <https://docs.cfengine.com/docs/3.24/reference-special-variables-sys.html> variables
>    are expanded in def.json and all subsequently loaded augments as
>    specified by the augments
>    <https://docs.cfengine.com/docs/3.24/reference-language-concepts-augments.html#augments>
>     key.
>
> ---
>
> I did a little test and it does seem your def.network and sys variables
> should both be expanded so I wonder if it is an access or selinux issue?
>
> Maybe check /var/log/audit/audit.log for cf-serverd related entries?
>
> ---
>
> My test:
>
> $ cat def.json
>
> {
>
>   "vars": {
>
>     "foo": "${def.jq}",
>
>     "bar": "baz"
>
>   }
>
> }
>
>
> $ cat t.cf
>
> bundle agent main
>
> {
>
>   reports:
>
>  "foo is ${default:def.foo}";
>
>  "bar is ${default:def.bar}";
>
>  "def.jq is ${def.jq}";
>
> }
>
>
> result:
>
> R: foo is jq --compact-output --monochrome-output --ascii-output
> --unbuffered --sort-keys
>
> R: bar is baz
>
> R: def.jq is jq --compact-output --monochrome-output --ascii-output
> --unbuffered --sort-keys
> On Friday, August 16, 2024 at 2:57:53 PM UTC-5 Nick Anderson wrote:
>
>> I dont think you can use non sys variables in augments like that becuase
>> augmwnts is loaded before policy is read at all. Check the augments docs (i
>> can't atm, on the move).
>>
>> On Fri, Aug 16, 2024, 1:43 PM Beto <[email protected]> wrote:
>>
>>> As we upgrade from RHEL7 to RHEL8 I'm seeing this in /var/log/messages:
>>>
>>> Aug 16 12:54:06 zombie cf-serverd[1921]: CFEngine(server)  Rereading
>>> policy file '/var/cfengine/inputs/promises.cf'
>>> Aug 16 12:54:06 zombie cf-serverd[1921]:   error: Could not load
>>> requested further augments from file '/srv/sysadmin/etc/
>>> cfengine/augments.json'
>>> Aug 16 12:54:06 zombie cf-serverd[1921]:   error: Could not load
>>> requested further augments from file '$(sys.inputdir)/au
>>> gments/augments_$(def.network).json'
>>> Aug 16 12:54:06 zombie cf-serverd[1921]: CFEngine(server)  Could not
>>> load requested further augments from file '/srv/sysa
>>> dmin/etc/cfengine/augments.json'
>>> Aug 16 12:54:06 zombie cf-serverd[1921]: CFEngine(server)  Could not
>>> load requested further augments from file '$(sys.inp
>>> utdir)/augments/augments_$(def.network).json'
>>>
>>> Not seeing this on RHEL7.
>>>
>>> CFEngine Core 3.24.0
>>> CFEngine Enterprise 3.24.0
>>>
>>> Any ideas?
>>>
>>> --
>>> 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 [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/help-cfengine/857f33e7-4ac3-45f1-8b90-234de4c98bc8n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/help-cfengine/857f33e7-4ac3-45f1-8b90-234de4c98bc8n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/help-cfengine/3e1de5ef-ee2a-4db3-a8e7-5c76fa68ae02n%40googlegroups.com
> <https://groups.google.com/d/msgid/help-cfengine/3e1de5ef-ee2a-4db3-a8e7-5c76fa68ae02n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/help-cfengine/CAE46pPsBst4h1pdTPfZ__NEUPFvKvweYH-teMPp-RgbiTof3Ww%40mail.gmail.com.