Questions tagged [augeas]

Augeas is a configuration file API.

Augeas is a configuration file API written in C. Bindings are available in many languages. In particular, the Ruby bindings are used to provide an Augeas type in Puppet.

Augeas uses bidirectional programs called "lenses" and written in a language similar to Ocaml in order to parse configuration files.

More information: * http://augeas.net

Related:

39 questions
2
votes
2 answers

How can I use Puppet/Augeas to manage exim dc_local_interfaces configuration?

I need to set the value for "dc_local_interfaces" to "127.0.0.1;::1", but the semi-colon prevents this. This is my definition in Puppet: augeas { "/etc/exim4/update-exim4.conf.conf": lens => "Shellvars.lns", incl =>…
Larsen
  • 315
  • 2
  • 14
2
votes
1 answer

How to set value of ipa_hostname directive in sssd.conf using Augeas

Using Puppet versions Master: puppetserver 6.7 Client: puppet-agent 6.10 I have other Augeas code in other modules that works just fine. Example sssd.conf [sssd] services = nss, sudo, pam, ssh config_file_version = 2 domains =…
Phil
  • 151
  • 5
1
vote
1 answer

Modify server in /etc/ntp.conf with one-liner?

In /etc/ntp.conf would I like to change all servers to just server ntp.example.com in just one command line. I can do it with ssh like so augtool --autosave --noautoload --transform "ssh incl /etc/ssh/ssh_config" set…
Jasmine Lognnes
  • 2,520
  • 8
  • 33
  • 51
1
vote
0 answers

Is there any way to tell the Puppet augeas resource which encoding to use?

i am new to augeas, and i am getting plenty of errors like: Could not evaluate: invalid byte sequence in UTF-8 in special i expect augeas to honor the encoding declaration in a XML-file but in the source…
mmoossen
  • 111
  • 3
1
vote
1 answer

Commenting out or removing an @include from /etc/pam.d/sshd with augtool

How can I either comment out or remove the "@include common-auth" line in /etc/pam.d/sshd? The default content is: ... # Standard Un*x authentication. @include common-auth ... The lens documentation isn't all that helpful. I'm new to Augeas and…
Ates Goral
  • 57
  • 1
  • 9
1
vote
2 answers

How to append to the same variable with augeas run via puppet?

I have the following resource declaration to set the setenv.sh file via augeas in puppet. augeas {'test': lens => 'Properties.lns', incl => '/tmp/setenv.sh', changes => "set CATALINA_OPTS \" $CATALINA_OPTS -XX:PermSize=192m…
kaizenCoder
  • 343
  • 2
  • 8
  • 22
1
vote
2 answers

Configuring PAM with Augeas

I am attempting to use Augeas to configure the files in my /etc/pam.d directory in a default Ubuntu 14.04 install. My goal is to find all nodes that have an argument of either 'nullok' or 'nullok_secure' and remove those arguments from the…
user7560
  • 23
  • 7
1
vote
2 answers

Puppet Augeas with /etc/hosts

I'm fairly new to Augeas, but I've been told it is the tool for modifying config with puppet. I'm trying to create a simple class that adds a line to /etc/hosts if it doesn't already exist. augeas { "test_config": context =>…
Matt
  • 69
  • 2
  • 9
1
vote
1 answer

How to ignore the rest of a file in Augeas?

I'm working with a set of config files and I need a way to only cherry pick out certain entries when defining an Augeas lens. How do I effectively state "if what Augeas sees isn't already listed specifically as an extraction it is OK to ignore"? I…
Tim Brigham
  • 15,545
  • 10
  • 75
  • 115
1
vote
1 answer

Augeas edit option if it exist, add otherwise - while referencing newly created node

I want to do something along the lines of: set /files/etc/exports/dir[. = '/export/home'][client = '10.0.0.0/8'] /export/home set /files/etc/exports/dir[. = '/export/home'][client = '10.0.0.0/8']/client 10.0.0.0/8 What happens if I run the above is…
Jon Skarpeteig
  • 951
  • 2
  • 14
  • 29
1
vote
1 answer

How to copy a branch in augeas

Is there a ready way to copy a branch natively in augeas or via the puppet augeas handler? If the copy operator were natively available in augeas it would be something like cp /files/etc/grub.conf/title[1]/ /files/etc/grub.conf/title[99]/ In my…
Tim Brigham
  • 15,545
  • 10
  • 75
  • 115
1
vote
1 answer

Representing a multiline value in Augeas using '\'

I recently assembled a lens in Augeas and now it's not functioning quite as desired. My file contains a few references with the following syntax: Value1 = KEY 32 OR\ KEY 33 OR\ .... How do I represent the backslash newline combination and…
Tim Brigham
  • 15,545
  • 10
  • 75
  • 115
1
vote
1 answer

Augeas - create new ini section

I have a config file in augeas using a custom lens that outputs the data as follows. /files/opt/../server.conf/target[1] = "general" /files/opt/../server.conf/target[1]/serverName = "XXX" /files/opt/../server.conf/target[1]/guid =…
Tim Brigham
  • 15,545
  • 10
  • 75
  • 115
1
vote
1 answer

Using Augeas to modify Squid configuration

I'm running squid-deb-proxy and I want to alter the configuration using Puppet/Augeas. When I try this: augeas {'squid-deb-proxy.conf': lens => 'Squid.lns', incl => '/etc/squid-deb-proxy/squid-deb-proxy.conf', changes => ["set…
dty
  • 273
  • 3
  • 12
1
vote
1 answer

How to set the string "value;othervalue" in php.ini with augeas?

i want to change the session.save_path in the php.ini with augeas default: session.save_path="/var/lib/php5" target value session.save_path="3;/var/lib/php5sessions" augeas returns quite interesting results not working command (save is…
c33s
  • 1,515
  • 3
  • 21
  • 39