/tmp/my.conf
is not a standard location for any conffile, so you need to specify which lens (i.e. parser) you want to use so Augeas knows which syntax to apply (there's tons of different conffile syntaxes, Augeas currently supports more than 150 out of the box!).
If you know which lens you want to use and you're using Augeas >= 1.0.0, you can use --transform
for that.
The Sshd.lns
lens looks similar to your format, so you might want to use this one.
Also:
--autosave
is necessary to commit your changes, since you're not calling thesave
command explicitely;- you need to use
/files/tmp/my.conf/OptionOne
to change the value of the node, since mapped files are exposed under/files
in the Augeas tree.
So:
# augtool --autosave --transform "Sshd.lns incl /tmp/my.conf" set /files/tmp/my.conf/OptionOne yes
Saved 1 file(s)
# cat /tmp/my.conf
OptionOne yes
OptionTwo yes