From 68623ce415e9a6fe9874319583dba0c68af29d1b Mon Sep 17 00:00:00 2001 From: Joshua Hoblitt Date: Mon, 20 Nov 2023 16:04:32 -0700 Subject: [PATCH] (WIP) cmdline.txt --- files/boot_cmdline.aug | 14 ++++++++++++++ manifests/init.pp | 10 ++++++++++ 2 files changed, 24 insertions(+) create mode 100644 files/boot_cmdline.aug diff --git a/files/boot_cmdline.aug b/files/boot_cmdline.aug new file mode 100644 index 0000000..9a8b9a9 --- /dev/null +++ b/files/boot_cmdline.aug @@ -0,0 +1,14 @@ +(* /boot/cmdline.txt module for Augeas *) + +module Boot_Cmdline = + autoload xfm + + let word = /[^ \n\t]+/ + let cmdline = [ seq "cmdline" . Util.indent . + [ label "parameter" . store word ] . + [ label "parameter" . Sep.space . store word ]* + . Util.eol ] + + let lns = cmdline + + let xfm = transform lns (incl "/boot/cmdline.txt") diff --git a/manifests/init.pp b/manifests/init.pp index 3525ed8..c1f01e4 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -3,4 +3,14 @@ # class pi { include augeas + + augeas { 'test': + context => '/files/home/jhoblitt/cmdline.txt/1', + lens => 'Boot_Cmdline.lns', + incl => '/home/jhoblitt/cmdline.txt', + load_path => '/usr/share/augeas/lenses/dist', + changes => [ + 'set parameter[. = "foo"] "foo"', + ], + } }