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
2
votes
1 answer

Issues adding attribute to XML root node via augeas

I am using augeas to manipulate XML on some machines. Whereas creating new nodes and also setting a bunch of attributes worked like a charm I'm biting my nails of adding a simple attribute to an XML file. XML looks like the following:
daniel.eichten
  • 2,535
  • 19
  • 26
2
votes
1 answer

How to make Augeas script with conditions

Ok, I learned how to make a script in augeas but as stated in the answer, the simple file creates a new entry in the file. I need some conditions (if - else) or at least if (condition) not true do... I was searching on the internet and found only…
Pavel Janicek
  • 14,128
  • 14
  • 53
  • 77
2
votes
4 answers

How to install ruby-augeas gem? (ubuntu 10.04)

root@ubuntu10:~# gem install ruby-augeas Fetching: ruby-augeas-0.5.0.gem (100%) Building native extensions. This could take a while... ERROR: Error installing ruby-augeas: ERROR: Failed to build gem native extension. …
TheOneTeam
  • 25,806
  • 45
  • 116
  • 158
2
votes
1 answer

Augeas not able to set node to value of another node?

In the process of trying to learn augeas config file language, the first real task I set to was to copy the first block of my grub.conf and add a "single" kernel parameter to the copy. In doing this, I scoured to the documentation and could not find…
1
vote
1 answer

remove multiple line from /etc/hosts using augtool

My /etc/hosts look like this: 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.13.11 idm.myhost.com 192.168.13.10 …
Hamid Reza Moradi
  • 429
  • 2
  • 4
  • 11
1
vote
1 answer

Adding new lines and tabs in XML using Augeas

This is related to my previous post for updating xml using Augeas. I manually adjusted the format and was able to look at how the new line and tabs were added and parsed in augtool. I tried to add those new lines but not being able to insert each…
1
vote
1 answer

Adding new nodes to XML file with Augeas

I have this XML file /opt/webapp/config.xml for a custom webapp that contains a parent node items. I'm trying to add a list of new child nodes item with an attribute value while making sure the child node doesn't contain the…
1
vote
2 answers

How to add export statements to bash_profile with Augeas and Puppet

I have Puppet + Augeas working to assign variable values in a bash_profile, however I have not found a way to export the variables from the file. augeas { "bash_profile-${user}-${name}": incl => "/home/${user}/.bash_profile", lens =>…
Simon Hardman
  • 476
  • 4
  • 14
1
vote
1 answer

Augeas - Partial control of sshd-config - Match entries

In the config file /etc/ssh/sshd_config I want to determine PasswordAuthentication entries for a few specific users (or Groups) like: Match Group xyz_admin, xyz_support PasswordAuthentication no Match User yvonne,yvette PasswordAuthentication…
user835745
  • 1,974
  • 3
  • 17
  • 18
1
vote
2 answers

Translate Augeas into Puppet speak Augeas

Using puppet's augeas capability I want to modify the config file: /etc/ssh/sshd_config Without puppet I've experimented using Augeas's "augtool" and found a couple of lines which seem to work: augtool> set…
user835745
  • 1,974
  • 3
  • 17
  • 18
1
vote
1 answer

Puppet XML augeas lens

I'm trying to set the configuration for a Windows CFG file with Puppet. augeas{ "bbdisplay_setting": incl => '/tmp/BBWin.cfg', lens => "Xml.lns", # How do I change the value of `value=1.1.1.1 to value=9.9.9.9 } I can't find a good example of…
Peter Souter
  • 5,110
  • 1
  • 33
  • 62
1
vote
1 answer

Is It Possible To Use Augeas For File Conversion?

I recently stumbled upon a tool called Augeas. As far as I understand the tool can be used to create an abstract file type independent tree that can be manipulated where the lens is an intermediary. I want to try to use it for file conversion. Is…
user3081519
  • 2,659
  • 5
  • 25
  • 35
1
vote
1 answer

setting ServerName with Augeas

I am trying to use a Augeas resource to set the ServerName in my httpd.conf like so ... # configure Apache HTTP server augeas { 'ServerName': context => '/files/etc/httpd/conf/httpd.conf', changes => "set ServerName ${controller_name}", }…
Red Cricket
  • 9,762
  • 21
  • 81
  • 166
1
vote
1 answer

Is it possible to change few portions of the value in Augeas

I would like to change the few portion in the value part of xml. Is it possible to do it in Augeas ? For eg: I would like to change the IP_ADDRESS alone in the following xml. It has been placed in three places. Is it possible to do it…
ArunRaj
  • 1,780
  • 2
  • 26
  • 48
1
vote
1 answer

Create conf file with Augeas

I'm trying to write a bash script which will leverage Augeas to create a conf file in /etc/httpd/conf.d/ and also set up the necessary nodes for the vhost. For some reason I am unable to set the DocumentRoot node. When I try via the interactive…
Sean
  • 33
  • 1
  • 6