Parses autofs’ auto.master files
Author: Dominic Cleal dcleal@redhat.com
| Automaster | Parses autofs’ auto.master files |
| Reference | See auto.master(5) |
| 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 /etc/auto.master, auto_master and /etc/auto.master.d/* files. |
| Examples | The <Test_Automaster> file contains various examples and tests. |
| USEFUL PRIMITIVES | |
| eol | |
| empty | |
| comment | |
| type | yp, file, dir etc but not ldap |
| format | sun, hesoid |
| name | |
| host | |
| dn | |
| optsep | |
| ENTRIES | |
| map_format | |
| map_type | |
| map_name | |
| map_generic | Used for all except LDAP maps which are parsed further |
| map_ldap_name | Split up host:dc=foo into host/map nodes |
| map_ldap | |
| comma_spc_sep_list | Parses options either for filesystems or autofs |
| map_mount | Mountpoint and whitespace, followed by the map info |
| lns | |
| filter |
let eol = Util.eol
let empty = Util.empty
let comment = Util.comment
yp, file, dir etc but not ldap
let type = Rx.word - /ldap/
sun, hesoid
let format = Rx.word
let name = /[^: \t\n]+/
let host = /[^:# \n\t]+/
let dn = /[^:# \n\t]+/
let optsep = del /[ \t,]+/ ","
let map_format = [ label "format" . store format ]
let map_type = [ label "type" . store type ]
let map_name = [ label "map" . store name ]
Used for all except LDAP maps which are parsed further
let map_generic = ( map_type . ( Sep.comma . map_format )? . Sep.colon )? . map_name
Split up host:dc=foo into host/map nodes
let map_ldap_name = ( [ label "host" . store host ] . Sep.colon )? . [ label "map" . store dn ]
let map_ldap = [ label "type" . store "ldap" ] . ( Sep.comma . map_format )? . Sep.colon . map_ldap_name
Parses options either for filesystems or autofs
let comma_spc_sep_list (l:string) = let value = [ label "value" . Util.del_str "=" . store Rx.neg1 ] in let lns = [ label l . store optlabel . value? ] in Build.opt_list lns optsep
Mountpoint and whitespace, followed by the map info
let map_mount = [ seq "map" . store mount . Util.del_ws_tab . ( map_generic | map_ldap ) . ( Util.del_ws_spc . comma_spc_sep_list "opt" )? . Util.eol ]
let lns = ( empty | comment | map_mount | map_master ) *