Questions tagged [augeas]

Augeas is a configuration editing tool. It parses configuration files in their native formats and transforms them into a tree. Configuration changes are made by manipulating this tree and saving it back into native config files.

Augeas - a configuration API

Augeas is a configuration editing tool. It parses configuration files in their native formats and transforms them into a tree. Configuration changes are made by manipulating this tree and saving it back into native config files.

Augeas is:

  • An API provided by a C library
  • A command line tool to manipulate configuration from the shell (and shell scripts)
  • Language bindings to do the same from your favorite scripting language
  • Canonical tree representations of common configuration files
  • A domain-specific language to describe configuration file formats

Augeas goals:

  • Manipulate configuration files safely, safer than the ad-hoc techniques generally used with grep, sed, awk and similar mechanisms in scripting languages
  • Provide a local configuration API for Linux
  • Make it easy to integrate new config files into the Augeas tree

More at http://augeas.net/.

87 questions
1
vote
1 answer

How to parse white-space-separated table with augeas?

Suppose I have fstab-like 2-dimensional white-space separated table (in my case it is /etc/lxc/lxc-usernet), with the following typical contents: # USERNAME TYPE BRIDGE COUNT adam veth lxcbr0 10 tempuser veth lxcbr1 5 How to edit it with augeas? I…
Adam Ryczkowski
  • 7,592
  • 13
  • 42
  • 68
1
vote
0 answers

Augeas and XML setting multiple attributes for puppet

I'm new to both puppet and Augeas and I'm having trouble. I have a puppet module that installs JBoss EAP 6.3 (in standalone mode), but I need to upgrade the scripts to allow users to configure their JBoss deployment with SSL. This leads me to try…
Jackie
  • 83
  • 1
  • 7
1
vote
1 answer

Why does Augeas Puppet resource type need 3 arguments for defnode?

I'm trying to add or update a user in an xml config file using augeas resource type in Puppet, here the manifest: augeas { "nexus_user_newadmin": lens => "Xml.lns", incl => "security.xml", root => "/usr/local/nexus/conf", …
PapelPincel
  • 4,255
  • 6
  • 39
  • 49
1
vote
1 answer

Sample file for augeas

I am searching for example of file which could be passed to the augeas: augeas --f example/file So far my file looks like this: set /files/etc/hosts/01/ipaddr 127.0.2.1 set /files/etc/hosts/01/alias[1] testy set /files/etc/hosts/01/alias[2]…
Pavel Janicek
  • 14,128
  • 14
  • 53
  • 77
1
vote
2 answers

augtool shows only /etc and /boot

By default augtool can only see the following directories /etc /boot Root is set to /. [root@]# augtool ls /files etc/ = (none) boot/ = (none) root/ = (none) Can't find nothing about it in errors: [root@]# augtool print /augeas//error (all…
user1789538
  • 163
  • 1
  • 9
1
vote
1 answer

puppet create_resources pass multiple values

i am passing the below foreman yaml config to puppet for sysctl keys.. YAML config sysctl: kval1: key: net.ipv4.ip_forward value: '0' kval2: key: kernel.sysrq value: '0' below is the puppet manifests for sysctl init.pp class…
krisdigitx
  • 7,068
  • 20
  • 61
  • 97
1
vote
1 answer

How to create separated XML nodes with "set" in Puppet using Augeas?

I am using the Augeas tool for Puppet 3.2 and I am trying to create an XML file. I want to be able to add multiple fields with the same name into my XML doc. For instance, I want to separate node2/location2 from node1/location1 by placing it in its…
dchoong
  • 13
  • 1
  • 4
1
vote
2 answers

Parsing a simple libconfuse file with Augeas

I'm using libconfuse for my program's configuration files, and that's working nicely. Now I'm interested to parse the configuration files using Augeas. I found a mailing list post which says that there's no generic Augeas lens for libconfuse files,…
Craig McQueen
  • 41,871
  • 30
  • 130
  • 181
1
vote
1 answer

Editing yum.conf/exclude with augeas

I am trying to edit the exclude part of my yum.conf using the augeas tool which again I use in puppet. The problem is that doing: # augtool augtool> set /files/etc/yum.conf/main/exclude[last()+1] 'kernel*' augtool> save Saved 1 file(s) augtool> set…
xeor
  • 5,301
  • 5
  • 36
  • 59
1
vote
1 answer

Parsing sectioned file with augeas

I am trying to create a module for parsing vim files which are sectioned in a specific manner. A sample file: " My section { set nocompatible " be iMproved set encoding=utf-8 " } " vim: set foldmarker={,} foldlevel=0…
Flavius
  • 13,566
  • 13
  • 80
  • 126
0
votes
0 answers

How to use multiple onlyif in Puppet Augeas resources?

I am trying to use an Puppet Augeas resource to update the /etc/fstab file. The change should add a mount option, but ONLY if (a) the option is not already there, and (b) the filesystem is present in fstab. To do this, I am trying to use an array…
Steve Shipway
  • 3,754
  • 3
  • 22
  • 39
0
votes
1 answer

Use sed (or awk) to add entry in fstab when match found

I have a need to edit lines in /etc/fstab and add/change fsoptions to lines where a matching volume is found. I have tried using sed and putting found blocks into registers to place them back, but am finding this one a challenge. Perhaps sed is…
xit
  • 135
  • 1
  • 12
0
votes
1 answer

How to install ruby-augeas gem? (macOS Mojave)

I spent most of the day yesterday searching for a clear answer for installing ruby-augeas. I can't find a good solution. How do I install it? The error while installing: gem install ruby-augeas Building native extensions. This could take a…
Gagan
  • 573
  • 8
  • 25
0
votes
2 answers

Augeas to sort XML file

I need to edit some XML files, I'm OK with removing and setting, but I don't see if and how is it possible to sort XML file using only Augeas? Has anyone done it, I am trying to avoid other resources than Augeas for now? I am using puppet, ruby,…
0
votes
0 answers

Does Debian 5 have augeas version 1.0

I am new to augeas and I want to find out if Debian 5 or my OS supports augeas version 1.0 or higher. How can I do this?
user2338823
  • 501
  • 1
  • 3
  • 16