Re: Newbie questions

Jakub Wardyn <[email protected]> Mon, 4 Aug 2025 09:28:05 -0700 (PDT)
Newsgroups gmane.comp.sysutils.cfengine.general
Message-ID <[email protected]>
------=_Part_416548_629286433.1754324885862
Content-Type: multipart/alternative; 
	boundary="----=_Part_416549_803883565.1754324885862"

------=_Part_416549_803883565.1754324885862
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Thank you for your quick responses and suggestions!

I managed to move forward a bit, but there's a lot of "friction".
Quick try of compiling CFEngine on Alpine Linux failed, so I just settled=
=20
on the "symlink hack" for now.
I also know more or less how to hook up to the MPF so it runs my policies.

Got quick two questions:
1. Can strings in CFEngine be split up into multiline without defining=20
additional variables, and without adding unintended whitespaces?
E.g. In C++ I'd do something like this:
```
const char* string =3D "This is my first line,"
" this is another line";
```
Which evaluates to "This is my first line, this is another line"
2. Can I build my own bundles/functions which return values? I've seen that=
=20
bundles can modify variables and define class in the parent scope, but that=
=20
seems quite horrible. I mean something like this:
```
vars:
    "my_value" string =3D> do_http_request("some arguments here");
```
where "do_http_request" is some wrapper around Curl that I can write on my=
=20
own,
can't use url_get, because the binary on Alpine is compiled without curl=20
support, and I would rather not bother with that,
and instead do what I would do in other languages: abstract the mundane=20
task of calling curl into something less repetitive.
On Sunday, August 3, 2025 at 7:30:39=E2=80=AFPM UTC+2 brontolinux wrote:

> Hi Jakub
>
> You need this book: https://cf-learn.info/
>
> I had the same struggles you have. This book made all the difference.=20
> Worth every cent.
>
> Ciao
> -- bronto
>
> PS: I am in the list of testimonials, but it doesn't mean I earn=20
> anything if you buy the book or you don't. I do think that Diego's book=
=20
> is the best CFEngine book ever written.
>
>

--=20
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 e=
mail to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/help-cfengi=
ne/b85aa62e-dc41-4f55-824a-8a62ab1c1f4bn%40googlegroups.com.

------=_Part_416549_803883565.1754324885862
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Thank you for your quick responses and suggestions!<br /><br />I managed to=
 move forward a bit, but there's a lot of "friction".<br />Quick try of com=
piling CFEngine on Alpine Linux failed, so I just settled on the "symlink h=
ack" for now.<br />I also know more or less how to hook up to the MPF so it=
 runs my policies.<br /><br />Got quick two questions:<br />1. Can strings =
in CFEngine be split up into multiline without defining additional variable=
s, and without adding unintended whitespaces?<br />E.g. In C++ I'd do somet=
hing like this:<br />```<br />const char* string =3D "This is my first line=
,"<br />" this is another line";<br />```<br />Which evaluates to "This is =
my first line, this is another line"<br />2. Can I build my own bundles/fun=
ctions which return values? I've seen that bundles can modify variables and=
 define class in the parent scope, but that seems quite horrible. I mean so=
mething like this:<br />```<br />vars:<br />=C2=A0=C2=A0=C2=A0 "my_value" s=
tring =3D&gt; do_http_request("some arguments here");<br />```<br />where "=
do_http_request" is some wrapper around Curl that I can write on my own,<br=
 />can't use url_get, because the binary on Alpine is compiled without curl=
 support, and I would rather not bother with that,<br />and instead do what=
 I would do in other languages: abstract the mundane task of calling curl i=
nto something less repetitive.<br /><div class=3D"gmail_quote"><div dir=3D"=
auto" class=3D"gmail_attr">On Sunday, August 3, 2025 at 7:30:39=E2=80=AFPM =
UTC+2 brontolinux wrote:<br/></div><blockquote class=3D"gmail_quote" style=
=3D"margin: 0 0 0 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding=
-left: 1ex;">Hi Jakub
<br>
<br>You need this book: <a href=3D"https://cf-learn.info/" target=3D"_blank=
" rel=3D"nofollow" data-saferedirecturl=3D"https://www.google.com/url?hl=3D=
en&amp;q=3Dhttps://cf-learn.info/&amp;source=3Dgmail&amp;ust=3D175440411780=
4000&amp;usg=3DAOvVaw1hi8fDMHlUGjj9gVRDZALL">https://cf-learn.info/</a>
<br>
<br>I had the same struggles you have. This book made all the difference.=
=20
<br>Worth every cent.
<br>
<br>Ciao
<br>-- bronto
<br>
<br>PS: I am in the list of testimonials, but it doesn&#39;t mean I earn=20
<br>anything if you buy the book or you don&#39;t. I do think that Diego&#3=
9;s book=20
<br>is the best CFEngine book ever written.
<br>
<br></blockquote></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;help-cfengine&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">help-=
[email protected]</a>.<br />
To view this discussion visit <a href=3D"https://groups.google.com/d/msgid/=
help-cfengine/b85aa62e-dc41-4f55-824a-8a62ab1c1f4bn%40googlegroups.com?utm_=
medium=3Demail&utm_source=3Dfooter">https://groups.google.com/d/msgid/help-=
cfengine/b85aa62e-dc41-4f55-824a-8a62ab1c1f4bn%40googlegroups.com</a>.<br /=
>

------=_Part_416549_803883565.1754324885862--

------=_Part_416548_629286433.1754324885862--