Augeas Lens Index

O |
| opt_eol, Keepalived
| opt_list Build Erlang Nslcd Test_Build
| opt_value, Ntpd
| opt_ws, Grub
| option Authorized_Keys Hosts_Access Pg_Hba Xorg
| options Modprobe Resolv
| optsep, Automaster
| origin_list, Access
| origin_pin, AptPreferences
P |
| page, Xymon_Alerting
| param, NagiosConfig
| param_def, NagiosConfig
| parameter, Sudoers
| parameter_flag, Sudoers
| parameter_integer, Sudoers
| parameter_list, Sudoers
| parameter_lists, Sudoers
| parameter_string, Sudoers
| parameters, Rabbitmq
| params, Gshadow
| pass_entry, JMXPassword
| password MasterPasswd Passwd Postfix_Passwordmap
| password_arg, Grub
| path Automounter Erlang Keepalived
| period, Anacron
| period_name, Anacron
| pin, AptPreferences
| pin_gen, AptPreferences
| pin_keys, AptPreferences
| pin_options, AptPreferences
| plus, Channels
| port, Services
| port_range, Services
| prefixlen, Keepalived
| primary_entry, OpenShift_Config
| program, Syslog
| programs, Syslog
| prop_filter, Rsyslog
| protocol, Services
Q |
| quote_opt_nil, Test_Quote
| quote_spaces, Quote
| quoted, Erlang

> let opt_eol = del /[ \t]*\n?/ " "

> let opt_list (lns:lens) (sep:lens) = lns . ( sep . lns )*

Same as list, but there might be only one element in the list

> let opt_list (lns:lens) = rspace lbrack . (Build.opt_list lns (lrspace comma) . space)? . Util.del_str rbrack

An optional list of elements, in square brackets

> let opt_list = Build.opt_list

> let opt_list = Build.opt_list [ key Rx.word ] Sep.space

> let opt_value (s:string) (r:regexp) = Build.key_value s space (store r)

A subnode for optional values.

> let opt_ws = Util.del_opt_ws ""

> let option = let kv_re = "command" | "environment" | "from" | "permitopen" | "principals" | "tunnel" in let flag_re = "cert-authority" | "no-agent-forwarding" | "no-port-forwarding" | "no-pty" | "no-user-rc" | "no-X11-forwarding" in let option_value = Util.del_str "\"" . store /((\\\\")?[^\\\n"]*)+/ . Util.del_str "\"" in Build.key_value kv_re Sep.equal option_value | Build.flag flag_re

A key option

> let option = [ key option_kw . ( del /([ \t]*=[ \t]*|[ \t]+)/ " " . sto_to_colon )? ]

Optional extensions defined in hosts_options(5)

> let option = let value_start = label "value" . Sep.equal in [ label "option" . store Rx.word . (Quote.quote_spaces value_start)? ]

part of method

> let option = [ indent . del /[oO]ption/ "Option" . label "Option" . sep_spc . quoted_non_empty_string_val . [ label "value" . sep_spc . quoted_string_val ]* . eol ]

> let options = let opt_value = /[^#" \t\n\\\\]+|"[^#"\n\\\\]*"/ in let option = [ key Rx.word . (del /[ \t]*=[ \t]*/ "=" . store opt_value)? ] in [ key "options" . sep_space . sto_no_spaces . (sep_space . option)* . Util.comment_or_eol ]

> let options = let options_entry = Build.key_value ("ndots"|"timeout"|"attempts") (Util.del_str ":") (store Rx.integer) | Build.flag ("debug"|"rotate"|"no-check-names" |"inet6"|"ip6-bytestring"|"edns0" |"single-request-reopen") | ip6_dotint in Build.key_value_line_comment "options" Sep.space (Build.opt_list options_entry Sep.space) comment_eol

Options values

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

> let origin_list = let origin_re = Rx.no_spaces - /[Ee][Xx][Cc][Ee][Pp][Tt]/ in Build.opt_list [ label "origin" . store origin_re ] Sep.space

origin_list can be a single ipaddr/originname/domain/fqdn or a list of those values

> let origin_pin = pin_gen "origin"

> let page = kw_word /(EX)?PAGE/

The (ex)?page filter definition

> let param = [ Util.indent . param_def . [ Sep.space . param_def ]* . Util.eol ]

Params can have sub params

> let param_def = let space_in = /[^ \t\n][^\n=]*[^ \t\n]|[^ \t\n]/ in key /[A-Za-z0-9_]+/ . Sep.opt_space . Sep.equal . Sep.opt_space . store space_in

define a field

> let parameter = parameter_flag | parameter_integer | parameter_string | parameter_lists

A single parameter for defaults

> let parameter_flag_kw = "always_set_home" | "authenticate" | "env_editor" | "env_reset" | "fqdn" | "ignore_dot" | "ignore_local_sudoers" | "insults" | "log_host" | "log_year" | "long_otp_prompt" | "mail_always" | "mail_badpass" | "mail_no_host" | "mail_no_perms" | "mail_no_user" | "noexec" | "path_info" | "passprompt_override" | "preserve_groups" | "requiretty" | "root_sudo" | "rootpw" | "runaspw" | "set_home" | "set_logname" | "setenv" | "shell_noargs" | "stay_setuid" | "targetpw" | "tty_tickets" | "visiblepw" | "closefrom_override" | "closefrom_override" | "compress_io" | "fast_glob" | "log_input" | "log_output" | "pwfeedback" | "umask_override" | "use_pty" | "match_group_by_gid" | "always_query_group_plugin"

A flag parameter for defaults

> let parameter_integer_nobool_kw = "passwd_tries"

An integer parameter for defaults

> let parameter_list = parameter . ( sep_com . parameter )*

A list of comma-separated parameters for defaults

> let parameter_lists_kw = "env_check" | "env_delete" | "env_keep"

A single list parameter for defaults

> let parameter_string_nobool_kw = "badpass_message" | "editor" | "mailsub" | "noexec_file" | "passprompt" | "runas_default" | "syslog_badpri" | "syslog_goodpri" | "timestampdir" | "timestampowner" | "secure_path"

A string parameter for defaults

> let parameters = listeners | ssl_options | disk_free_limit | log_levels | Erlang.value /vm_memory_high_watermark(_paging_ratio)?/ Erlang.decimal | Erlang.value "frame_max" Erlang.integer | Erlang.value "heartbeat" Erlang.integer | Erlang.value /default_(vhost|user|pass)/ Erlang.glob | Erlang.value_list "default_user_tags" Erlang.bare | Erlang.value_list "default_permissions" Erlang.glob | cluster_nodes | Erlang.value_list "server_properties" Erlang.bare | Erlang.value "collect_statistics" Erlang.bare | Erlang.value "collect_statistics_interval" Erlang.integer | Erlang.value_list "auth_mechanisms" Erlang.quoted | Erlang.value_list "auth_backends" Erlang.bare | Erlang.value "delegate_count" Erlang.integer | Erlang.value_list "trace_vhosts" Erlang.bare | tcp_listen_options | Erlang.value "hipe_compile" Erlang.boolean | Erlang.value "msg_store_index_module" Erlang.bare | Erlang.value "backing_queue_module" Erlang.bare | Erlang.value "msg_store_file_size_limit" Erlang.integer | Erlang.value /queue_index_(max_journal_entries|embed_msgs_below)/ Erlang.integer | cluster_partition_handling | Erlang.value /(ssl_)?handshake_timeout/ Erlang.integer | Erlang.value "channel_max" Erlang.integer | Erlang.value_list "loopback_users" Erlang.glob | Erlang.value "reverse_dns_lookups" Erlang.boolean | Erlang.value "cluster_keepalive_interval" Erlang.integer | Erlang.value "mnesia_table_loading_timeout" Erlang.integer

Top-level parameters for the lens

> let params = [ label "password" . store password . colon ] . admin_list? . colon . member_list?

> let pass_entry = [ label "user" . [ label "username" . store Rx.word ] . Sep.space . [ label "password" . store Rx.no_spaces ] . Util.eol ]

> let password = [ label "password" . sto_to_col? . colon ]

pw_passwd

> let password = [ label "password" . sto_to_col? . colon ]

pw_passwd

> let password = [ label "password" . (store Rx.space_in)? ]

> let password_arg = [ command "password" "" . (spc . [ switch "md5" ])? . (spc . [ switch "encrypted" ])? . spc . store (/[^ \t\n]+/ - /--[^ \t\n]+/) . (spc . [ label "file" . store /[^ \t\n]+/ ])? . eol ]

> let path = /[^-+#: \t\n][^#: \t\n]*/

> let path = quoted

Store a path (quoted)

> let path = [ label "path" . store /[^# \t\n][^ \t\n]*/ . Util.eol ]

> let period = [ label "period" . store Rx.integer ]

> let period_name = [ label "period_name" . Util.del_str "@" . store period_name_re ]

In the format “@keyword”

> let pin = let pin_value = pin_options | version_pin | origin_pin in Build.key_value_line "Pin" colon pin_value

> let pin_gen (lbl:string) = store lbl . [ label lbl . Sep.space . store Rx.no_spaces ]

A generic pin

> let pin_keys = let space_in = store /[^, \r\t\n][^,\n]*[^, \r\t\n]|[^, \t\n\r]/ in Build.key_value /[aclnov]/ Sep.equal space_in

> let pin_options = let comma = Util.delim "," in store "release" . Sep.space . Build.opt_list pin_keys comma

> let plus = Util.del_str "+"

> let port = [ label "port" . store num_re ]

> let port_range = [ label "start" . store num_re ] . Util.del_str "-" . [ label "end" . store num_re ]

> let prefixlen = [ label "prefixlen" . Util.del_str "/" . sto_num ]

A prefix for IP addresses

> let primary_entry = Build.key_value_line Rx.word Sep.equal Quote.any_opt

> let program = [ label "program" . opt_hash . bang . ( opt_plus | [ Build.xchgs "-" "reverse" ] ) . programs . eol . entries ]

a program begins with an optional hash, a bang, and an optional + or -

> let programs = label_opt_list_or "program" (store word) comma "*"

a list of programs

> let prop_filter = let sep = Sep.comma . Util.del_opt_ws " " in let prop_name = [ Util.del_str ":" . label "property" . store Rx.word ] in let prop_oper = [ label "operation" . store /[A-Za-z!-]+/ ] in let prop_val = [ label "value" . Quote.do_dquote (store /[^\n"]*/) ] in let prop_act = [ label "action" . action ] in [ label "filter" . prop_name . sep . prop_oper . sep . prop_val . Sep.space . prop_act . Util.eol ]

Parses property-based filters, which start with “:” and the property name

> let protocol = [ label "protocol" . store protocol_re ]

> let quote_opt_nil = let body = store Quote.any_opt_re in [ label "quote_opt_nil" . Quote.do_quote_opt_nil body ]?

> let quote_spaces (lns:lens) =

Make quotes mandatory if value contains spaces, and optional if value doesn’t contain spaces.
Store a quoted value
Close