-
Notifications
You must be signed in to change notification settings - Fork 104
Reformatted some initial files with cfengine format #3132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,88 +5,126 @@ bundle common inventory_debian | |
| { | ||
| vars: | ||
| has_lsb_release:: | ||
| "lsb_release_info" string => readfile("/etc/lsb-release","256"), | ||
| comment => "Read more OS info" ; | ||
| "lsb_release_info" | ||
| string => readfile("/etc/lsb-release", "256"), | ||
| comment => "Read more OS info"; | ||
|
|
||
| has_etc_linuxmint_info:: | ||
| "linuxmint_info" string => readfile("/etc/linuxmint/info","1024"), | ||
| comment => "Read Linux Mint specific info" ; | ||
| "linuxmint_info" | ||
| string => readfile("/etc/linuxmint/info", "1024"), | ||
| comment => "Read Linux Mint specific info"; | ||
|
|
||
| "lm_info_count" | ||
| int => parsestringarray("mint_info", # array to populate | ||
| "$(linuxmint_info)", # data to parse | ||
| "\s*#[^\n]*", # comments | ||
| "=", # split | ||
| 100, # maxentries | ||
| 2048) ; # maxbytes | ||
|
|
||
| "mint_release" string => "$(mint_info[RELEASE][1])" ; | ||
| "mint_codename" string => "$(mint_info[CODENAME][1])" ; | ||
| int => parsestringarray( | ||
| "mint_info", | ||
|
olehermanse marked this conversation as resolved.
|
||
| # array to populate | ||
| "$(linuxmint_info)", | ||
|
Comment on lines
+20
to
+21
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think comments should stay on the side if that's where they where. At least, that's how black works
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not really possible - comments are just comments and we render from syntax tree - whitespace is lost. (We'd have to change the parser and architecture quite a bit to achieve that, and I don't think it's really worth it). |
||
| # data to parse | ||
| "\s*#[^\n]*", | ||
| # comments | ||
| "=", | ||
| # split | ||
| 100, | ||
| # maxentries | ||
| 2048 | ||
| # maxbytes | ||
| ); | ||
|
|
||
| "mint_release" string => "$(mint_info[RELEASE][1])"; | ||
| "mint_codename" string => "$(mint_info[CODENAME][1])"; | ||
|
|
||
| classes: | ||
| any:: | ||
| "debian_derived_evaluated" | ||
| scope => "bundle", | ||
| or => { isvariable("sys.os_release"), "has_lsb_release", "has_etc_linuxmint_info" } ; | ||
| scope => "bundle", | ||
| or => { | ||
| isvariable("sys.os_release"), | ||
| "has_lsb_release", | ||
| "has_etc_linuxmint_info", | ||
| }; | ||
|
|
||
| "linuxmint" | ||
| expression => "has_etc_linuxmint_info", | ||
| comment => "this is a Linux Mint system, of some sort", | ||
| meta => { "inventory", "attribute_name=none" } ; | ||
| expression => "has_etc_linuxmint_info", | ||
| comment => "this is a Linux Mint system, of some sort", | ||
| meta => { "inventory", "attribute_name=none" }; | ||
|
|
||
| has_lsb_release:: | ||
| "linuxmint" | ||
| expression => regcmp("(?ms).*^DISTRIB_ID=LinuxMint$.*", "$(lsb_release_info)"), | ||
| comment => "this is a Linux Mint system, of some sort", | ||
| meta => { "inventory", "attribute_name=none" } ; | ||
| expression => regcmp( | ||
| "(?ms).*^DISTRIB_ID=LinuxMint$.*", "$(lsb_release_info)" | ||
| ), | ||
| comment => "this is a Linux Mint system, of some sort", | ||
| meta => { "inventory", "attribute_name=none" }; | ||
|
|
||
| linuxmint:: | ||
| "lmde" | ||
| expression => regcmp('.*LMDE.*', "$(sys.os_release[NAME])"), | ||
| comment => "this is a Linux Mint Debian Edition", | ||
| meta => { "inventory", "attribute_name=none", "derived-from=sys.os_release[NAME]" } ; | ||
| expression => regcmp('.*LMDE.*', "$(sys.os_release[NAME])"), | ||
| comment => "this is a Linux Mint Debian Edition", | ||
| meta => { | ||
| "inventory", | ||
| "attribute_name=none", | ||
| "derived-from=sys.os_release[NAME]", | ||
| }; | ||
|
|
||
| linuxmint.has_lsb_release:: | ||
| "lmde" | ||
| expression => regcmp('(?ms).*^DISTRIB_DESCRIPTION="LMDE.*', "$(lsb_release_info)"), | ||
| comment => "this is a Linux Mint Debian Edition", | ||
| meta => { "inventory", "attribute_name=none", "derived-from=inventory_debian.lsb_release_info" } ; | ||
| expression => regcmp( | ||
| '(?ms).*^DISTRIB_DESCRIPTION="LMDE.*', "$(lsb_release_info)" | ||
| ), | ||
| comment => "this is a Linux Mint Debian Edition", | ||
| meta => { | ||
| "inventory", | ||
| "attribute_name=none", | ||
| "derived-from=inventory_debian.lsb_release_info", | ||
| }; | ||
|
|
||
| has_etc_linuxmint_info:: | ||
| "lmde" | ||
| expression => regcmp('(?ms).*^DESCRIPTION="LMDE.*',"$(linuxmint_info)"), | ||
| comment => "this is a Linux Mint Debian Edition", | ||
| meta => { "inventory", "attribute_name=none", "derived-from=inventory_debian.linuxmint_info" } ; | ||
| expression => regcmp( | ||
| '(?ms).*^DESCRIPTION="LMDE.*', "$(linuxmint_info)" | ||
| ), | ||
| comment => "this is a Linux Mint Debian Edition", | ||
| meta => { | ||
| "inventory", | ||
| "attribute_name=none", | ||
| "derived-from=inventory_debian.linuxmint_info", | ||
| }; | ||
|
|
||
| debian_derived_evaluated.has_etc_linuxmint_info.!lmde:: | ||
| # These need to be evaluated only after debian_derived_evaluated is defined | ||
| # to ensure that the mint_info array has been evaluated as well. | ||
| # Failing to do that will create meaningless classes | ||
| # On non-LMDE Mint systems, this will create classes like, e.g.: | ||
| # linuxmint_14, nadia, linuxmint_nadia | ||
| "linuxmint_$(mint_release)" expression => "any", | ||
| meta => { "inventory", "attribute_name=none" } ; | ||
| "linuxmint_$(mint_release)" | ||
| expression => "any", | ||
| meta => { "inventory", "attribute_name=none" }; | ||
|
|
||
| "$(mint_codename)" expression => "any", | ||
| meta => { "inventory", "attribute_name=none" } ; | ||
| "$(mint_codename)" | ||
| expression => "any", | ||
| meta => { "inventory", "attribute_name=none" }; | ||
|
|
||
| "linuxmint_$(mint_codename)" expression => "any", | ||
| meta => { "inventory", "attribute_name=none" } ; | ||
| "linuxmint_$(mint_codename)" | ||
| expression => "any", | ||
| meta => { "inventory", "attribute_name=none" }; | ||
|
|
||
| debian_derived_evaluated:: | ||
| "debian_pure" expression => "debian.!(ubuntu|linuxmint)", | ||
| comment => "pure Debian", | ||
| meta => { "inventory", "attribute_name=none" }; | ||
| "debian_pure" | ||
| expression => "debian.!(ubuntu|linuxmint)", | ||
| comment => "pure Debian", | ||
| meta => { "inventory", "attribute_name=none" }; | ||
|
|
||
| "debian_derived" expression => "debian.!debian_pure", | ||
| comment => "derived from Debian", | ||
| meta => { "inventory", "attribute_name=none" }; | ||
| "debian_derived" | ||
| expression => "debian.!debian_pure", | ||
| comment => "derived from Debian", | ||
| meta => { "inventory", "attribute_name=none" }; | ||
|
|
||
| any:: | ||
| "has_lsb_release" expression => fileexists("/etc/lsb-release"), | ||
| comment => "Check if we can get more info from /etc/lsb-release"; | ||
|
|
||
| "has_etc_linuxmint_info" expression => fileexists("/etc/linuxmint/info"), | ||
| comment => "If this is a Linux Mint system, this *could* be available"; | ||
| "has_lsb_release" | ||
| expression => fileexists("/etc/lsb-release"), | ||
| comment => "Check if we can get more info from /etc/lsb-release"; | ||
|
|
||
| "has_etc_linuxmint_info" | ||
| expression => fileexists("/etc/linuxmint/info"), | ||
| comment => "If this is a Linux Mint system, this *could* be available"; | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.