Ask Your Question

Error in augeas

asked 2015-01-06 06:31:00 -0600

Chutki gravatar image


I am testing augeas, my puppet version is 3.3.X (both server nad master). When I compile below code, getting error message.

class testservice::ser_file {

$dummy_value = {
    service1 => {value => 1,
                    port  => 100,},
    service2 => {value => 2,
                    port  => 102,},

  define ser_val($value,$port) {

  augeas { "serviceabc$value":
    context => "/files/etc/services",
    changes => ["ins service-name after service-name[last()]",
                "set service-name[last()] serviceabc$value",
                "set service-name[.='serviceabc$value']/port 25$port"],

   onlyif => "match /files/etc/services/service-name[port = '211'] size == 0",

Below is the error message.

Debug: Augeas[serviceabc1](provider=augeas): Opening augeas with root /, lens path , flags 32
Debug: Augeas[serviceabc1](provider=augeas): Augeas version 1.1.0 is installed
Debug: Augeas[serviceabc1](provider=augeas): Closed the augeas connection
Debug: Augeas[serviceabc2](provider=augeas): Opening augeas with root /, lens path , flags 32
Debug: Augeas[serviceabc2](provider=augeas): Augeas version 1.1.0 is installed
Debug: Augeas[serviceabc2](provider=augeas): Closed the augeas connection
Debug: Failed to load library 'msgpack' for feature 'msgpack'

please help me how to fix bug. This is my first code in augeas

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-01-06 07:45:07 -0600

domcleal gravatar image

The "onlyif" parameter looks like it needs $port rather than having 211 hardcoded. Try:

onlyif => "match /files/etc/services/service-name[port = '25${port}'] size == 0",
edit flag offensive delete link more


thanks Domcleal. I ahve changes as you mentioned. But I am getting same error. I need too change service file like serviceabc1 000/tcp serviceabc2 102/tcp.

Chutki gravatar imageChutki ( 2015-01-08 08:18:14 -0600 )edit

Does your /etc/services file already have 000/tcp (??) and 102/tcp in it? Please update the ticket to show the current manifest - the whole thing's rather unclear to me.

domcleal gravatar imagedomcleal ( 2015-01-08 08:35:07 -0600 )edit

Thanks for your response. still I am testing the above manifests. Also I am learning augeas. So will post you it again test failed.

Chutki gravatar imageChutki ( 2015-01-09 08:20:40 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2015-01-06 06:31:00 -0600

Seen: 266 times

Last updated: Jan 06 '15