PATH:
usr
/
share
/
augeas
/
lenses
/
dist
(* NTP module for Augeas *) (* Author: Raphael Pinson <raphink@gmail.com> *) (* *) (* Status: basic settings supported *) module Ntp = autoload xfm (* Define useful shortcuts *) let eol = del /[ \t]*/ "" . [ label "#comment" . store /#.*/]? . Util.del_str "\n" let sep_spc = Util.del_ws_spc let word = /[^,# \n\t]+/ let num = /[0-9]+/ (* define comments and empty lines *) let comment = [ label "#comment" . del /#[ \t]*/ "#" . store /([^ \t\n][^\n]*)?/ . del "\n" "\n" ] let empty = [ del /[ \t]*\n/ "\n" ] let kv (k:regexp) (v:regexp) = [ key k . sep_spc. store v . eol ] (* Define generic record *) let record (kw:regexp) (value:lens) = [ key kw . sep_spc . store word . value . eol ] (* Define a command record; see confopt.html#cfg in the ntp docs *) let command_record = let opt = [ sep_spc . key /minpoll|maxpoll|ttl|version|key/ . sep_spc . store word ] | [ sep_spc . key (/autokey|burst|iburst|noselect|preempt/ | /prefer|true|dynamic/) ] in let cmd = /server|peer|broadcast|manycastclient/ | /multicastclient|manycastserver/ in record cmd opt* let broadcastclient = [ key "broadcastclient" . [ sep_spc . key "novolley" ]? . eol ] (* Define a fudge record *) let fudge_opt_re = "refid" | "stratum" let fudge_opt = [ sep_spc . key fudge_opt_re . sep_spc . store word ] let fudge_record = record "fudge" fudge_opt? (* Define simple settings, see miscopt.html in ntp docs *) let flags = let flags_re = /auth|bclient|calibrate|kernel|monitor|ntp|pps|stats/ in let flag = [ label "flag" . store flags_re ] in [ key /enable|disable/ . (sep_spc . flag)* . eol ] let simple_setting (k:regexp) = kv k word (* Still incomplete, misses logconfig, phone, setvar, tos, trap, ttl *) let simple_settings = kv "broadcastdelay" Rx.decimal | flags | simple_setting /driftfile|leapfile|logfile|includefile/ | simple_setting "statsdir" (* Misc commands, see miscopt.html in ntp docs *) (* Define restrict *) let restrict_record = let action = [ label "action" . sep_spc . store word ] in [ key "restrict" . sep_spc . [ label "ipv6" . Util.del_str "-6" . sep_spc ]? . store (word - "-6") . action* . eol ] (* Define statistics *) let statistics_flag (kw:string) = [ sep_spc . key kw ] let statistics_opts = statistics_flag "loopstats" | statistics_flag "peerstats" | statistics_flag "clockstats" | statistics_flag "rawstats" let statistics_record = [ key "statistics" . statistics_opts* . eol ] (* Define filegen *) let filegen = del /filegen[ \t]+/ "filegen " . store word let filegen_opt (kw:string) = [ sep_spc . key kw . sep_spc . store word ] (* let filegen_flag (kw:string) = [ label kw . sep_spc . store word ] *) let filegen_select (kw:string) (select:regexp) = [ label kw . sep_spc . store select ] let filegen_opts = filegen_opt "file" | filegen_opt "type" | filegen_select "enable" /(en|dis)able/ | filegen_select "link" /(no)?link/ let filegen_record = [ label "filegen" . filegen . filegen_opts* . eol ] (* Authentication commands, see authopt.html#cmd; incomplete *) let auth_command = [ key /controlkey|keys|keysdir|requestkey|authenticate/ . sep_spc . store word . eol ] | [ key /autokey|revoke/ . [sep_spc . store word]? . eol ] | [ key /trustedkey/ . [ sep_spc . label "key" . store word ]+ . eol ] (* tinker [step step | panic panic | dispersion dispersion | stepout stepout | minpoll minpoll | allan allan | huffpuff huffpuff] *) let tinker = let arg_names = /step|panic|dispersion|stepout|minpoll|allan|huffpuff/ in let arg = [ key arg_names . sep_spc . store Rx.decimal ] in [ key "tinker" . (sep_spc . arg)* . eol ] (* tos [beacon beacon | ceiling ceiling | cohort {0 | 1} | floor floor | maxclock maxclock | maxdist maxdist | minclock minclock | mindist mindist | minsane minsane | orphan stratum | orphanwait delay] *) let tos = let arg_names = /beacon|ceiling|cohort|floor|maxclock|maxdist| minclock|mindist|minsane|orphan|orphanwait/ in let arg = [ key arg_names . sep_spc . store Rx.decimal ] in [ key "tos" . (sep_spc . arg)* . eol ] (* Define lens *) let lns = ( comment | empty | command_record | fudge_record | restrict_record | simple_settings | statistics_record | filegen_record | broadcastclient | auth_command | tinker | tos)* let filter = (incl "/etc/ntp.conf") let xfm = transform lns filter
[+]
..
[-] mailscanner.aug
[edit]
[-] access.aug
[edit]
[-] gshadow.aug
[edit]
[-] activemq_conf.aug
[edit]
[-] gtkbookmarks.aug
[edit]
[-] activemq_xml.aug
[edit]
[-] hostname.aug
[edit]
[-] afs_cellalias.aug
[edit]
[-] mcollective.aug
[edit]
[-] aliases.aug
[edit]
[-] mdadm_conf.aug
[edit]
[-] anacron.aug
[edit]
[-] memcached.aug
[edit]
[-] approx.aug
[edit]
[-] group.aug
[edit]
[-] phpvars.aug
[edit]
[-] apt_update_manager.aug
[edit]
[-] grub.aug
[edit]
[-] puppet.aug
[edit]
[-] aptcacherngsecurity.aug
[edit]
[-] mongodbserver.aug
[edit]
[-] aptconf.aug
[edit]
[-] host_conf.aug
[edit]
[-] aptpreferences.aug
[edit]
[-] hosts.aug
[edit]
[-] aptsources.aug
[edit]
[-] hosts_access.aug
[edit]
[-] authorized_keys.aug
[edit]
[-] htpasswd.aug
[edit]
[-] automaster.aug
[edit]
[-] jettyrealm.aug
[edit]
[-] automounter.aug
[edit]
[-] mke2fs.aug
[edit]
[-] avahi.aug
[edit]
[-] jaas.aug
[edit]
[-] backuppchosts.aug
[edit]
[-] modprobe.aug
[edit]
[-] bbhosts.aug
[edit]
[-] jmxaccess.aug
[edit]
[-] bootconf.aug
[edit]
[-] modules.aug
[edit]
[-] build.aug
[edit]
[-] jmxpassword.aug
[edit]
[-] cachefilesd.aug
[edit]
[-] modules_conf.aug
[edit]
[-] carbon.aug
[edit]
[-] json.aug
[edit]
[-] cgconfig.aug
[edit]
[-] nagiosobjects.aug
[edit]
[-] cgrules.aug
[edit]
[-] kdump.aug
[edit]
[-] channels.aug
[edit]
[-] monit.aug
[edit]
[-] chrony.aug
[edit]
[-] multipath.aug
[edit]
[-] clamav.aug
[edit]
[-] keepalived.aug
[edit]
[-] cobblermodules.aug
[edit]
[-] known_hosts.aug
[edit]
[-] cobblersettings.aug
[edit]
[-] koji.aug
[edit]
[-] collectd.aug
[edit]
[-] mysql.aug
[edit]
[-] cpanel.aug
[edit]
[-] nagioscfg.aug
[edit]
[-] cron.aug
[edit]
[-] krb5.aug
[edit]
[-] crypttab.aug
[edit]
[-] netmasks.aug
[edit]
[-] cups.aug
[edit]
[-] ldif.aug
[edit]
[-] cyrus_imapd.aug
[edit]
[-] networkmanager.aug
[edit]
[-] darkice.aug
[edit]
[-] networks.aug
[edit]
[-] debctrl.aug
[edit]
[-] nrpe.aug
[edit]
[-] desktop.aug
[edit]
[-] ldso.aug
[edit]
[-] device_map.aug
[edit]
[-] lightdm.aug
[edit]
[-] dhclient.aug
[edit]
[-] nginx.aug
[edit]
[-] dhcpd.aug
[edit]
[-] limits.aug
[edit]
[-] dhcpd_140.aug
[edit]
[-] login_defs.aug
[edit]
[-] dns_zone.aug
[edit]
[-] ntpd.aug
[edit]
[-] dnsmasq.aug
[edit]
[-] nsswitch.aug
[edit]
[-] dovecot.aug
[edit]
[-] ntp.aug
[edit]
[-] dpkg.aug
[edit]
[-] odbc.aug
[edit]
[-] dput.aug
[edit]
[-] openshift_http.aug
[edit]
[-] erlang.aug
[edit]
[-] openshift_config.aug
[edit]
[-] ethers.aug
[edit]
[-] pamconf.aug
[edit]
[-] exports.aug
[edit]
[-] logrotate.aug
[edit]
[-] fai_diskconfig.aug
[edit]
[-] openvpn.aug
[edit]
[-] fonts.aug
[edit]
[-] pagekite.aug
[edit]
[-] fstab.aug
[edit]
[-] pam.aug
[edit]
[-] fuse.aug
[edit]
[-] passwd.aug
[edit]
[-] gdm.aug
[edit]
[-] httpd.aug
[edit]
[-] postfix_access.aug
[edit]
[-] inetd.aug
[edit]
[-] pbuilder.aug
[edit]
[-] inifile.aug
[edit]
[-] pg_hba.aug
[edit]
[-] inittab.aug
[edit]
[-] pgbouncer.aug
[edit]
[-] inputrc.aug
[edit]
[-] logwatch.aug
[edit]
[-] interfaces.aug
[edit]
[-] lokkit.aug
[edit]
[-] iproute2.aug
[edit]
[-] mailscanner_rules.aug
[edit]
[-] iptables.aug
[edit]
[-] php.aug
[edit]
[-] iscsid.aug
[edit]
[-] lvm.aug
[edit]
[-] util.aug
[edit]
[-] openshift_quickstarts.aug
[edit]
[-] xinetd.aug
[edit]
[-] postfix_main.aug
[edit]
[-] xendconfsxp.aug
[edit]
[-] postfix_master.aug
[edit]
[-] vfstab.aug
[edit]
[-] postfix_sasl_smtpd.aug
[edit]
[-] vmware_config.aug
[edit]
[-] postfix_transport.aug
[edit]
[-] xml.aug
[edit]
[-] postfix_virtual.aug
[edit]
[-] xorg.aug
[edit]
[-] postgresql.aug
[edit]
[-] xymon.aug
[edit]
[-] properties.aug
[edit]
[-] xymon_alerting.aug
[edit]
[-] protocols.aug
[edit]
[-] yum.aug
[edit]
[-] puppet_auth.aug
[edit]
[-] puppetfile.aug
[edit]
[-] vsftpd.aug
[edit]
[-] puppetfileserver.aug
[edit]
[-] anaconda.aug
[edit]
[-] pylonspaste.aug
[edit]
[-] pythonpaste.aug
[edit]
[-] qpid.aug
[edit]
[-] quote.aug
[edit]
[-] rabbitmq.aug
[edit]
[-] redis.aug
[edit]
[-] webmin.aug
[edit]
[-] reprepro_uploaders.aug
[edit]
[-] resolv.aug
[edit]
[-] rhsm.aug
[edit]
[-] rmt.aug
[edit]
[-] rsyncd.aug
[edit]
[-] rsyslog.aug
[edit]
[-] rx.aug
[edit]
[-] samba.aug
[edit]
[-] schroot.aug
[edit]
[-] securetty.aug
[edit]
[-] sep.aug
[edit]
[-] services.aug
[edit]
[-] shadow.aug
[edit]
[-] shells.aug
[edit]
[-] shellvars.aug
[edit]
[-] shellvars_list.aug
[edit]
[-] simplelines.aug
[edit]
[-] simplevars.aug
[edit]
[-] sip_conf.aug
[edit]
[-] slapd.aug
[edit]
[-] slapd_140.aug
[edit]
[-] smbusers.aug
[edit]
[-] solaris_system.aug
[edit]
[-] soma.aug
[edit]
[-] spacevars.aug
[edit]
[-] splunk.aug
[edit]
[-] squid.aug
[edit]
[-] ssh.aug
[edit]
[-] sshd.aug
[edit]
[-] sshd_140.aug
[edit]
[-] sssd.aug
[edit]
[-] stunnel.aug
[edit]
[-] subversion.aug
[edit]
[-] sudoers.aug
[edit]
[-] sysconfig.aug
[edit]
[-] sysconfig_route.aug
[edit]
[-] sysctl.aug
[edit]
[-] syslog.aug
[edit]
[-] systemd.aug
[edit]
[-] thttpd.aug
[edit]
[-] tuned.aug
[edit]
[-] up2date.aug
[edit]
[-] updatedb.aug
[edit]
[-] wine.aug
[edit]