Automaster

Parses autofs’ auto.master files

Author: Dominic Cleal dcl.nosp@m.eal@redha.nosp@m.t.com

Summary
AutomasterParses autofs’ auto.master files
ReferenceSee auto.master(5)
LicenseThis file is licenced under the LGPL v2+, like the rest of Augeas.
Lens UsageTo be documented
Configuration filesThis lens applies to /etc/auto.master, auto_master and /etc/auto.master.d/* files.
ExamplesThe <Test_Automaster> file contains various examples and tests.
USEFUL PRIMITIVES
eol
empty
comment
typeyp, file, dir etc but not ldap
formatsun, hesoid
name
host
dn
optsep
ENTRIES
map_format
map_type
map_name
map_genericUsed for all except LDAP maps which are parsed further
map_ldap_nameSplit up host:dc=foo into host/map nodes
map_ldap
comma_spc_sep_listParses options either for filesystems or autofs
map_mountMountpoint and whitespace, followed by the map info
lns
filter

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

let eol = Util.eol

empty

let empty = Util.empty

comment

let comment = Util.comment

type

let type = Rx.word - /ldap/

yp, file, dir etc but not ldap

format

let format = Rx.word

sun, hesoid

name

let name = /[^: \t\n]+/

host

let host = /[^:# \n\t]+/

dn

let dn = /[^:# \n\t]+/

optsep

let optsep = del /[ \t,]+/ ","

ENTRIES

map_format

let map_format = [ label "format" . store format ]

map_type

let map_type = [ label "type" . store type ]

map_name

let map_name = [ label "map" . store name ]

map_generic

let map_generic = ( map_type . ( Sep.comma . map_format )? . Sep.colon )? . map_name

Used for all except LDAP maps which are parsed further

map_ldap_name

let map_ldap_name = ( [ label "host" . store host ] . Sep.colon )? . [ label "map" . store dn ]

Split up host:dc=foo into host/map nodes

map_ldap

let map_ldap = [ label "type" . store "ldap" ] . ( Sep.comma . map_format )? . Sep.colon . map_ldap_name

comma_spc_sep_list

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

Parses options either for filesystems or autofs

map_mount

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 ]

Mountpoint and whitespace, followed by the map info

lns

let lns = ( empty | comment | map_mount | map_master ) *

filter

let eol = Util.eol
let empty = Util.empty
let comment = Util.comment
let type = Rx.word - /ldap/
yp, file, dir etc but not ldap
let format = Rx.word
sun, hesoid
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 ]
let map_generic = ( map_type . ( Sep.comma . map_format )? . Sep.colon )? . map_name
Used for all except LDAP maps which are parsed further
let map_ldap_name = ( [ label "host" . store host ] . Sep.colon )? . [ label "map" . store dn ]
Split up host:dc=foo into host/map nodes
let map_ldap = [ label "type" . store "ldap" ] . ( Sep.comma . map_format )? . Sep.colon . map_ldap_name
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
Parses options either for filesystems or autofs
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 ]
Mountpoint and whitespace, followed by the map info
let lns = ( empty | comment | map_mount | map_master ) *
Close