3 Parses /etc/puppet/auth.conf
5 Author: Raphael Pinson <raphael.pinson@camptocamp.com>
8 This lens tries to keep as close as possible to `http://docs.puppetlabs.com/guides/rest_auth_conf.html` where possible.
11 This file is licenced under the LGPL v2+, like the rest of Augeas.
16 About: Configuration files
17 This lens applies to /etc/puppet/auth.conf. See <filter>.
20 The <Test_Puppet_Auth> file contains various examples and tests.
29 let list (kw:string) (val:regexp) =
30 let item = [ seq kw . store val ]
31 in let comma = del /[ \t]*,[ \t]*/ ", "
32 in [ Util.indent . key kw . Sep.space
33 . Build.opt_list item comma . Util.comment_or_eol ]
36 An authentication stanza *)
38 [ Util.indent . Build.xchg /auth(enticated)?/ "auth" "auth"
39 . Sep.space . store /yes|no|on|off|any/ . Util.comment_or_eol ]
41 (* View: reset_counters *)
43 counter "environment" . counter "method"
44 . counter "allow" . counter "allow_ip"
47 let setting = list "environment" Rx.word
48 | list "method" /find|search|save|destroy/
49 | list "allow" /[^# \t\n,][^#\n,]*[^# \t\n,]|[^# \t\n,]/
50 | list "allow_ip" /[A-Za-z0-9.:\/]+/
55 let operator = [ label "operator" . store "~" ]
56 in [ Util.indent . key "path"
57 . (Sep.space . operator)?
58 . Sep.space . store /[^~# \t\n][^#\n]*[^# \t\n]|[^~# \t\n]/ . Util.eol
60 . (Util.empty | Util.comment | setting)*
64 let lns = (Util.empty | Util.comment | record)*
66 (* Variable: filter *)
67 let filter = (incl "/etc/puppet/auth.conf"
68 .incl "/usr/local/etc/puppet/auth.conf"
69 .incl "/etc/puppetlabs/puppet/auth.conf")
71 let xfm = transform lns filter