0

I am trying to make a change to my memcached.conf file via Augeas with puppet. I have this in my manifest file:

  augeas { 'listen_on_IP':
    context => '/etc/memcached.conf',
    changes => ['set l 0.0.0.0'],
  }

but I see no changes.

I'm using Ubuntu 12.04 (to mimic Heroku's Celadon Cedar stack as closely as possible) and starting with a stock memcached.conf.

What am I doing wrong?

Erik
  • 7,479
  • 8
  • 62
  • 99

1 Answers1

1

Your context is wrong. It should look like below:

augeas { 'listen_on_ip':
  context => '/files/etc/memcached.conf',
  changes => ['set l 0.0.0.0']
}

Take a look at the augueas documentation for more information on the augeas tree. (eg. /files, /augeas, etc)

Hope this helps!

ptierno
  • 9,534
  • 2
  • 23
  • 35
  • This did not work for me. I am beginning to suspect that my puppet installation is treating the augeas resource as a no op. – Erik Aug 29 '14 at 01:48
  • @Erik just to troubleshoot. can you supply the output of `augtool print /files/etc/memcached.conf/l`? If your using `Puppet Enterprise` then puppet's `augtool` would be located in `/opt/puppet/bin` – ptierno Aug 29 '14 at 02:17
  • `which augtool` shows me that it's not installed. I install puppet via this vagrant script: https://github.com/hashicorp/puppet-bootstrap. I assumed augeas was installed like hiera is. – Erik Aug 29 '14 at 03:02
  • I'm not sure about that install script. Maybe the pre-reqs aren't met? `https://docs.puppetlabs.com/guides/augeas.html#pre-requisites`. What is the output of `dpkg --list|grep aug`? – ptierno Aug 29 '14 at 04:26
  • $ dpkg --list|grep aug ii augeas-lenses 0.10.0-0ubuntu4 Set of lenses needed by libaugeas0 to parse config files ii libaugeas-ruby 0.3.0-1.1ubuntu4 Augeas bindings for the Ruby language ii libaugeas-ruby1.8 0.3.0-1.1ubuntu4 Augeas bindings for the Ruby language ii libaugeas0 0.10.0-0ubuntu4 Augeas configuration editing library and API – Erik Aug 29 '14 at 05:00
  • I'm also running ruby 1.9. – Erik Aug 29 '14 at 05:03
  • appears that the install script didn't install or require those packages to be installed. trying `apt-get install libaugeas-ruby1.9.1 augeas-tools` and see if `augtool` is available after that. – ptierno Aug 29 '14 at 05:09
  • No change. Also, when I run `augtool print /files/etc/memcached.conf/l` I get no output. – Erik Aug 29 '14 at 05:36
  • 1
    I'm at a loss. I just spun up an ubuntu node, used that install script and the `augeas` resource in my answer worked for me. Sorry man. not sure what the issue is. – ptierno Aug 29 '14 at 05:40
  • Thanks -- I'll keep pounding on it. You've given me some things to mess with. – Erik Aug 29 '14 at 05:41
  • One more test. when running `puppet apply` on your manifest add `-v -d --trace` and see if there is anything relevant. – ptierno Aug 29 '14 at 05:49
  • Looks like augeas isn't finding or parsing the file: https://gist.github.com/ErikEvenson/7628e2630c90299847da. – Erik Aug 29 '14 at 06:00
  • strange. that issue seems to relate to `https://git.fedorahosted.org/cgit/augeas.git/commit/?id=f81b2e44b15c0dc215eebd5632715ddfca4593a8` which apparently was fixed in 2012. sorry man. i'm dumbfounded. wish i could have helped more. – ptierno Aug 29 '14 at 06:08
  • https://git.fedorahosted.org/cgit/augeas.git/commit/?id=f81b2e44b15c0dc215eebd5632715ddfca4593a8 – ptierno Aug 29 '14 at 06:37
  • seems when putting the link in a `'s it broke the link. – ptierno Aug 29 '14 at 06:37
  • The memcached lens was [added in Augeas 1.0.0](https://github.com/hercules-team/augeas/blob/master/NEWS#L394), but Ubuntu 12.04 has 0.10.0, so it doesn't support it. You could use [this PPA](https://launchpad.net/~raphink/+archive/ppa) or perhaps try installing [the lens](https://raw.githubusercontent.com/hercules-team/augeas/master/lenses/memcached.aug) in your current version (in /usr/share or lib/augeas/lenses/ in a module if on Puppet 2.7.18+), but it may not be compatible. – Dominic Cleal Aug 29 '14 at 08:01
  • @m0dlx that does seem to be the problem. Working on getting Augeas 1.0.0 on my 12.04 box. – Erik Aug 29 '14 at 16:08
  • I tried using an Ubuntu 14.04 vagrant box and everything works fine. I think I will just migrate to 14.04 now rather than later. Hopefully Heroku's Celadon Cedar-14 stack will come out of beta soon. Thanks for all the help. I will post an answer in the next day unless @m0dlx or Petey T beats me to it. – Erik Aug 29 '14 at 19:53