${sys.flavor} or lsb_release?

41 views
Skip to first unread message

Martin Simons

unread,
Dec 19, 2014, 7:56:39 AM12/19/14
to help-c...@googlegroups.com
Hi,

Gabor Nyers (Suse) and I are adding Suse platform specifics to The CFEngine Roadshow (https://github.com/Webhuis/CFEngine-Roadshow) and we encounter this issue:

I use ${sys.flavor} to determine the platform.and release:

bundle agent report_sys_os {

reports:

"inhoud van hard class os: ${sys.os} ${sys.flavor}";
}

In case of opensuse it returns: SUSE_13.

The agent discovers several other hard classes like SUSE SuSE SUSE_13 and suse.

The CFEngine Roadshow uses dynamic policies to provide platform specific policies. lsb_release is not yet installed on a virgin system and ${sys.flavor} is the life line I have. The problem is that the return value presented by sys.flavor differs from the distribution string as defined by the distributor in /etc/os-release, NAME variable. It should of course work for all platforms, including Android, SmartOS and so on.

Regards,
Gabor and Martin.

Brian Bennett

unread,
Dec 21, 2014, 6:56:05 PM12/21/14
to Martin Simons, help-c...@googlegroups.com
Cfengine doesn't rely on lsb_release because it's not always installed. So it tries to use other markers. It needs to be specially informed about each system variant and how to tell them apart. For about a year I had to roll my own SmartOS detection because cfengine detected it as Solaris. You can use a module or just cfengine native promises to detect non-supported systems and define appropriate classes in the same bundle that you use for dynamic bundle sequence and everything should still fall into place.

Cfengine has the best support for platforms that are either very widely popular or cfengine developers themselves use. I'm sure pull requests for new types would be welcome.


-- 
Brian Bennett
Looking for CFEngine training?
Seats available for 4-day class beginning Feb 2, 2015
http://www.verticalsysadmin.com/

--
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.
To post to this group, send email to help-c...@googlegroups.com.
Visit this group at http://groups.google.com/group/help-cfengine.
For more options, visit https://groups.google.com/d/optout.

Martin Simons

unread,
Dec 22, 2014, 7:26:01 AM12/22/14
to help-c...@googlegroups.com, mjcm....@gmail.com, brian....@verticalsysadmin.com
Dear Brian,

BB> Cfengine doesn't rely on lsb_release because it's not always installed.

Yeah, that was my idea too, so this is  not the way.

BB> You can use a module or just cfengine native promises to detect non-supported systems and define appropriate classes

I prefer CFEngine native promises by far. This is interesting to The CFEngine Roadshow and the packaging-team.

BB> I'm sure pull requests for new types would be welcome.

Where is this repo? I think we will see many different types when we gain popularity.

debian_8 is at hand, so we need to integrate this new version.

Regards,
Martin.

Op maandag 22 december 2014 00:56:05 UTC+1 schreef Brian Bennett:

Brian Bennett

unread,
Dec 22, 2014, 9:00:36 PM12/22/14
to Martin Simons, help-c...@googlegroups.com
I believe most of the code is in core, in libenv/sysinfo.c.

New versions of existing supported platforms (e.g., debian_8) should automatically be supported unless some of their identifying characteristics drastically change.


-- 
Brian Bennett
Looking for CFEngine training?
Seats available for 4-day class beginning Feb 2, 2015
http://www.verticalsysadmin.com/

Reply all
Reply to author
Forward
0 new messages