Puppetfile

Parses libarian-puppet’s Puppetfile format

Author: Raphael Pinson raphael.nosp@m..pinson@camptoc.nosp@m.amp.com

Summary
PuppetfileParses libarian-puppet’s Puppetfile format
ReferenceSee https://github.com/rodjek/librarian-puppet
LicenseThis file is licenced under the LGPL v2+, like the rest of Augeas.
Lens UsageTo be documented
Configuration filesThis lens applies to Puppetfiles.
ExamplesThe Test_Puppetfile file contains various examples and tests.
Augeas Lenses
commaa comma, optionally preceded or followed by spaces or newlines
moduledirThe moduledir setting specifies where modules from the Puppetfile will be installed
forgea forge entry
metadataa metadata entry
moda module entry, with optional version and options
lnsthe Puppetfile lens

License

This file is licenced under the LGPL v2+, like the rest of Augeas.

Lens Usage

To be documented

Configuration files

This lens applies to Puppetfiles.

Examples

The Test_Puppetfile file contains various examples and tests.

Augeas Lenses

comma

let comma = del /[ \t\n]*,[ \t\n]*/ ", "

a comma, optionally preceded or followed by spaces or newlines

moduledir

let moduledir = [ Util.indent . key "moduledir" . Sep.space . quote_to_comment_or_eol ]

The moduledir setting specifies where modules from the Puppetfile will be installed

forge

let forge = [ Util.indent . key "forge" . Sep.space . quote_to_comment_or_eol ]

a forge entry

metadata

let metadata = [ Util.indent . key "metadata" . comment_or_eol ]

a metadata entry

mod

let mod = let mod_name = Quote.do_quote (store ((Rx.word . /[\/-]/)? . Rx.word)) in let version = [ label "@version" . Quote.do_quote (store /[^#:\n]+/) . Util.comment_eol? ] in let sto_opt_val = store /[^#"', \t\n][^#"',\n]*[^#"', \t\n]|[^#"', \t\n]/ in let opt = [ Util.del_str ":" . key Rx.word . (del /[ \t]*=>[ \t]*/ " => " . Quote.do_quote_opt sto_opt_val)? ] in let opt_eol = del /([ \t\n]*\n)?/ "" in let opt_space_or_eol = del /[ \t\n]*/ " " in let comma_opt_eol_comment = comma_nospace . (opt_eol . Util.comment_eol)* . opt_space_or_eol in let opts = Build.opt_list opt comma_opt_eol_comment in [ Util.indent . Util.del_str "mod" . seq "mod" . Sep.space . mod_name . (comma_opt_eol_comment . version)? . (comma_opt_eol_comment . opts . Util.comment_eol?)? . Util.eol ]

a module entry, with optional version and options

lns

let lns = (Util.empty | Util.comment | forge | metadata | mod | moduledir )*

the Puppetfile lens

Provides unit tests and examples for the Puppetfile lens.
let comma = del /[ \t\n]*,[ \t\n]*/ ", "
a comma, optionally preceded or followed by spaces or newlines
let moduledir = [ Util.indent . key "moduledir" . Sep.space . quote_to_comment_or_eol ]
The moduledir setting specifies where modules from the Puppetfile will be installed
let forge = [ Util.indent . key "forge" . Sep.space . quote_to_comment_or_eol ]
a forge entry
let metadata = [ Util.indent . key "metadata" . comment_or_eol ]
a metadata entry
let mod = let mod_name = Quote.do_quote (store ((Rx.word . /[\/-]/)? . Rx.word)) in let version = [ label "@version" . Quote.do_quote (store /[^#:\n]+/) . Util.comment_eol? ] in let sto_opt_val = store /[^#"', \t\n][^#"',\n]*[^#"', \t\n]|[^#"', \t\n]/ in let opt = [ Util.del_str ":" . key Rx.word . (del /[ \t]*=>[ \t]*/ " => " . Quote.do_quote_opt sto_opt_val)? ] in let opt_eol = del /([ \t\n]*\n)?/ "" in let opt_space_or_eol = del /[ \t\n]*/ " " in let comma_opt_eol_comment = comma_nospace . (opt_eol . Util.comment_eol)* . opt_space_or_eol in let opts = Build.opt_list opt comma_opt_eol_comment in [ Util.indent . Util.del_str "mod" . seq "mod" . Sep.space . mod_name . (comma_opt_eol_comment . version)? . (comma_opt_eol_comment . opts . Util.comment_eol?)? . Util.eol ]
a module entry, with optional version and options
let lns = (Util.empty | Util.comment | forge | metadata | mod | moduledir )*
the Puppetfile lens
Close