linuxpuppetaugeas

Trouble using augeas for /etc/fstab in Puppet


I am pretty sure I have some syntax error in this class that has one augeas resource in it.

Here is my code:

#
# This class was created to deal with /etc/fstab on openstack nodes
#
class myfstab (
    $spec = 'uig003:/uig003/uig003_OSC_vol003A', 
# spec Example uig003:/uig003/uig003_OSC_vol003A
    $mount_point = '/data', 
# Example /data
    $vfstype = 'nfs',
# Example nfs
    $opt_1 = 'rw',
# Example rw
    $opt_2 = 'bg',
#Example bg
    $opt_3 = 'hard',
#Example hard
    $opt_4 = 'intr',
#Example intr
    $opt_5 = 'rsize=32768',
#Example rsize=32768
    $opt_6 = 'wsize=32768',
#Example wsize=32768
    $opt_7 = 'tcp',
#Example tcp
    $opt_8 = 'vers=3',
#Example vers=3
    $dump = 0,
#Example 0
    $passno = 0,
#Example 0
) { 
    augeas{ 'data_mount' :
        context => '/files/etc/fstab',
        changes => [
            “set 01/spec $spec",
            “set 01/file $mount_point",
            “set 01/vfstype $vfstype”,
            “set 01/opt[1] $opt_1”,
            “set 01/opt[2] $opt_2”,
            “set 01/opt[3] $opt_3",
            “set 01/opt[4] $opt_4",
            “set 01/opt[5] $opt_5",
            “set 01/opt[6] $opt_6",
            “set 01/opt[7] $opt_7",
            “set 01/opt[8] $opt_8",
            “set 01/dump $dump”,
            “set 01/passno $passno”,
        ],
    }
}

When I run puppet parser validate init.pp I get this error message:

Error: Could not parse for environment production: Could not match “set at /etc/puppetlabs/puppet/modules/myfstab/manifests/init.pp:35

Line 35 is the ...

        “set 01/spec $spec",

... line.

Thanks.


Solution

  • From your code exerts, it looks like your code contains curly (typographic) double quotes instead of ASCII double quotes. This is what puppet is chocking on.