Augeas Variable Index - Augeas Documentation

Augeas Variable Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z

T |
| tab, Sep
| tag, FAI_DiskConfig
| target, Crypttab
| tcp_check, Test_Keepalived
| the valid values for schedules, Cron
| title_ace, Test_IniFile
| title_acf, Test_IniFile
| title_ade, Test_IniFile
| title_adf, Test_IniFile
| title_bce, Test_IniFile
| title_bcf, Test_IniFile
| title_bde, Test_IniFile
| title_bdf, Test_IniFile
| to_com_chars, Sudoers
| to_com_dquot, Sudoers
| to_comment_re IniFile Simplevars
| to_eol, Xorg
| token, Syslog
| trailing_ws, Test_Tmpfiles
| type_label_lv, FAI_DiskConfig
U |
| ul1, Test_Xml
| unit, Test_Systemd
| user_record, cgrules
V |
| valid_age, Test_Tmpfiles
| valid_age_tree, Test_Tmpfiles
| valid_base, Test_Tmpfiles
| valid_base_tree, Test_Tmpfiles
| valid_days, Test_Tmpfiles
| valid_days_tree, Test_Tmpfiles
| valid_second, Test_Tmpfiles
| valid_second_tree, Test_Tmpfiles
| valid_short_args, Test_Tmpfiles
| valid_short_args_tree, Test_Tmpfiles
| value, Dovecot
| value_cmd_re, Systemd
| value_re Approx Up2date
| value_sep, Systemd
| value_single_re, Systemd
| vg_option, FAI_DiskConfig
| volume_cryptsetup, FAI_DiskConfig
| volume_full, FAI_DiskConfig
| volume_lvm, FAI_DiskConfig
| volume_or_comment, FAI_DiskConfig
| volume_raid, FAI_DiskConfig
| volume_tmpfs, FAI_DiskConfig
| volume_vg, FAI_DiskConfig
W |
| with_spaces, Test_FAI_DiskConfig
| word Aliases Chrony Crypttab Keepalived Nginx Rx Syslog
| word_opt_quot_re, Postgresql
| word_slash, Keepalived
| ws, cgrules
| ws_sep, Hosts_Access

> let tab = del Rx.space "\t"

Deletes a Rx.space and default to a tab

> let tag (re:regexp) = [ Util.del_str ":" . key re ]

A generic tag beginning with a colon

> let target = Rx.device_name

> let tcp_check = "virtual_server 192.168.1.11 22 { real_server 10.20.40.10 22 { TCP_CHECK { connect_timeout 3 connect_port 22 bindto 192.168.1.1 } } } " test Keepalived.lns get tcp_check = { "virtual_server" { "ip" = "192.168.1.11" } { "port" = "22" } { "real_server" { "ip" = "10.20.40.10" } { "port" = "22" } { "TCP_CHECK" { "connect_timeout" = "3" } { "connect_port" = "22" } { "bindto" = "192.168.1.1" } } } }

An example of a TCP health checker

> let title_ace = IniFile.title IniFile.record_re

> let title_acf = IniFile.title IniFile.record_re

> let title_ade = IniFile.title IniFile.record_re

> let title_adf = IniFile.title IniFile.record_re

> let title_bce = IniFile.title IniFile.record_re

> let title_bcf = IniFile.title IniFile.record_re

> let title_bde = IniFile.title IniFile.record_re

> let title_bdf = IniFile.title IniFile.record_re

> let to_com_chars = /[^",=#() \t\n\\]+/ (* " relax emacs *)

> let to_com_dquot = /"[^",=#()\n\\]+"/ (* " relax emacs *)

> let to_comment_re = /[^";# \t\n][^";#\n]*[^";# \t\n]|[^";# \t\n]/

Regex until comment

> let to_comment_re = let to_comment_squote = /'[^\n']*'/ in let to_comment_dquote = /"[^\n"]*"/ in let to_comment_noquote = /[^\n \t'"#][^\n#]*[^\n \t#]|[^\n \t'"#]/ in to_comment_squote | to_comment_dquote | to_comment_noquote

The regexp to match the value

> let to_eol = /[^ \t\n](.*[^ \t\n])?/

Match everything from here to eol, cropping whitespace at both ends

> let token = /([A-Za-z0-9]+|\*)/

alphanum or “*”

> let trailing_ws = " #Type Path Mode UID GID Age Argument \n d /run/user 0755 root root 10d - \t\n L /tmp/foobar - - - - /dev/null\t\n"

The complex example with extra spaces

> let type_label_lv = label "lv" . [ label "vg" . store (/[^# \t\n-]+/ - "raw") ] . Util.del_str "-" . [ label "name" . store /[^ \t\n]+/ ]

> let ul1 = " <ul> <li>test1</li> <li>test2</li> <li>test3</li> <li>test4</li> </ul> " test Xml.doc get ul1 = { "ul" { "#text" = " " } { "li" { "#text" = "test1" } } { "#text" = " " } { "li" { "#text" = "test2" } } { "#text" = " " } { "li" { "#text" = "test3" } } { "#text" = " " } { "li" { "#text" = "test4" } } }

> let unit = "# This file is part of systemd. # # See systemd.special(7) for details .include /etc/example [Unit] Description=Locale Service # Add another file .include /etc/example [Service] ExecStart=/lib/systemd/systemd-localed Type=dbus BusName=org.freedesktop.locale1 CapabilityBoundingSet= "

> let user_record = generic_record "user" (store name)

> let valid_age = "v /var/tmp/js 4221 johnsmith - ~10d12h\n"

Example with a complex age.

> let valid_age_tree = { "1" { "type" = "v" } { "path" = "/var/tmp/js" } { "mode" = "4221" } { "uid" = "johnsmith" } { "gid" = "-" } { "age" = "~10d12h" } }

Tree for valid_age

> let valid_base = "H /var/tmp/js 0000 jonhsmith 60 1s foo\n"

A valid test to be re-used by the failure cases

> let valid_base_tree = { "1" { "type" = "H" } { "path" = "/var/tmp/js" } { "mode" = "0000" } { "uid" = "jonhsmith" } { "gid" = "60" } { "age" = "1s" } { "argument" = "foo" } }

Tree for valid_base

> let valid_days = "x /var/tmp/manu - jonhsmith - 9days\n"

Example with full age unit (plural)

> let valid_days_tree = { "1" { "type" = "x" } { "path" = "/var/tmp/manu" } { "mode" = "-" } { "uid" = "jonhsmith" } { "gid" = "-" } { "age" = "9days" } }

Tree for valid_days

> let valid_second = "p+ /var/tmp - jsmith - 0second\n"

Example with full age unit

> let valid_second_tree = { "1" { "type" = "p+" } { "path" = "/var/tmp" } { "mode" = "-" } { "uid" = "jsmith" } { "gid" = "-" } { "age" = "0second" } }

Tree for valid_second

> let valid_short_args = "h /var/log/journal - - - - C\nh /var/log/journal - - - - +C\n"

A short argument value example.

> let valid_short_args_tree = { "1" { "type" = "h" } { "path" = "/var/log/journal" } { "mode" = "-" } { "uid" = "-" } { "gid" = "-" } { "age" = "-" } { "argument" = "C" } } { "2" { "type" = "h" } { "path" = "/var/log/journal" } { "mode" = "-" } { "uid" = "-" } { "gid" = "-" } { "age" = "-" } { "argument" = "+C" } }

Tree for valid_short_args

> let value = any . (Rx.space . any)*

Match any value after “ =”.

> let value_cmd_re = /[^#@ \t\n\\-][^#@ \t\n\\-][^# \t\n\\]*/

> let value_re = /[^ \t\n](.*[^ \t\n])?/

> let value_re = /[^ \t\n;][^\n;]*[^ \t\n;]|[^ \t\n;]/

> let value_sep = del /[ \t]+|[ \t]*\\\\[ \t]*\n[ \t]*/ " "

Multi-value entries separated by whitespace or backslash and newline

> let value_single_re = /[^# \t\n\\][^#\n\\]*[^# \t\n\\]|[^# \t\n\\]/

> let vg_option = [ key "pvcreateopts" . Util.del_str "=\"" . store /[^"\n]*/ . Util.del_str "\"" ]

An option for volume_vg

> let volume_cryptsetup = volume_full (key ("swap"|"tmp"|"luks")) device

> let volume_full (type:lens) (third_field:lens) =

> let volume_lvm = volume_full type_label_lv size (* lvm logical volume: vg name and lv name *) | volume_vg

> let volume_or_comment (vol:lens) = (vol|empty|comment)* . vol

A succesion of volumes and comments

> let volume_raid = volume_full (key /raid[0156]/) disk_list (* raid level *)

> let volume_tmpfs = [ key "tmpfs" . space . mountpoint .space . size . space . mount_options . (space . fs_options)? . eol ]

> let volume_vg = [ key "vg" . space . name . space . disk . (space . vg_option)? . eol ]

> let with_spaces = "disk_config disk2 raw-disk - 0 - - "

> let word = /[^|", \t\n]+/

> let word = Rx.word

> let word = Rx.word

> let word = Rx.word

> let word = /[A-Za-z0-9_.:-]+/

> let word = /[A-Za-z0-9_.-]+/

An alphanumeric string

> let word = /[A-Za-z0-9][A-Za-z0-9_.-]*/

our version can’t start with [_.-] because it would mess up the grammar

> let word_opt_quot_re = /[A-Za-z][A-Za-z0-9_]*/

Strings that don’t require quotes

> let word_slash = word | "/"

> let ws = del /[ \t]+/ " "

> let ws_sep = / +/

Close