Re: per-promise 'inform => "false"'?
"'Vratislav Podzimek' via help-cfengine" <[email protected]> Fri, 14 Jul 2023 12:15:02 +0200
| Newsgroups | gmane.comp.sysutils.cfengine.general |
|---|---|
| Message-ID | <[email protected]> |
On Fri, 2023-07-14 at 02:54 -0700, [email protected] wrote: > Many thanks, NIck. Appreciated. > > No we're not running with inform as default. So that part of my message was not as considered as > it should have been, and took us down a cul-de-sac. Apologies. > > Nevertheless, when we run cf-agent manually, we habitually run with "-I". I suppose this > qualifies as local convention. > > For reference here is the problematic part (bundle slightly reduced here) where we dump all > classes, several hundred of them, into a state file: > > --------------------------------------------------------------- > bundle agent dls_reports > { > vars: > "allclasses" slist => classesmatching(".*"); > > files: > cfengine_3:: > "$(sys.workdir)/state/allclasses.txt" > create => "true", > perms => mog("0644", "root", "root"), > edit_defaults => empty, > edit_line => insert_lines(@(allclasses)); > } > --------------------------------------------------------------- > > Try that in a test framework. Up to and including version 3.15.5, "cf-agent -I ..." (manually at > the console) is decently quiet at this point (a single diagnostic line telling us the file has > been edited). But at 3.18 its output swamps us! A note here -- the insert_lines promise doesn't produce the info: lines if the promise is idempotent (i.e. if it makes no changes when run multiple times). Which version exactly are you running? Because since 3.18.1 there should be no info: messages if no changes are made to the file. OTOH, a single line of difference causes all of the individual lines to be logged, I think. One tip -- it might be useful to do sort() on the slist to ensure better consistency of the results. -- Vratislav -- 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/db068685a2b589be211b95306fdefa9cf9a920c7.camel%40northern.tech.
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEENAH7ns+FyuCe6j1XmyV2peQQR/QFAmSxICYACgkQmyV2peQQ R/TL2Q/+KHbiHRA9fCAWkjm3AhdV5bi7+pVrfLUEzGf0MXqyTe1RGZUbI4BL49N8 mzkStTL7p/pz6/LlycgGDjB1GGDNzRMgMsqI0EEjWNXJOCc51TajAHnwL2xfz41l 59xQRPnEkrhQs0RNuM8yUoP39zRDFx8D45ZY7tKAoVfTatdYq2P13PrJ/EQSHG0+ e8xQnTQi8FygfYE2Sjh7IXHaaWapybvJ4DTomC5nhIeazVeYGxZQgl2mq5udti0X Sm5cW8MzWB77tdu4faE5RZI8ddrRWg+s2urDrAOUHTXwrshBoX4KwP2RmPN8bryY 9FbULWU7TsC+yImvW3ZIH/jPd8KA7x3q5j2/d+1g842UaEHmuD0PsRxQhMFs3JWo 56gkJ7fI7Xcojqb6FE4FqD3SU8y/Dx5BsPenqaiLhHc+CgqQ8wKlAJJK8QLXn2lc 9O25FbWwOiojT3brT1Lj+yD8Mh7oLVIUPJ0r6mE63lN2e5QOrn4kjN1K3tmjEKwE reSrv3uPTfYZERqo5mq/aL4qvayNnp86DxKIit+5ICPD6zFUHkuzLjnuLCTtTWeN W5uR4iis5nFq/u5kpICRpcdtfQnXRShkN7bn/mNeBd8JXM66k51j5/NXVrc5KM9q 7Clvg22fS5m8HMIokjohuTa2NN2PU2kJGBbaIlr+EBm5X3fFOM8= =g2hQ -----END PGP SIGNATURE-----