Hi everyone,

I am trying to exec the following command:

    exec { 'Apply all kernel variables' :
        path        => '/bin:/usr/bin:/usr/local/bin',
        user        => 'root',
        logoutput   => true,
        provider    => shell,
        command     => "for file in ${config_file} ${config_dir}/*.conf
                        do
                            [ -r \"\${file}\" ] && (echo Applying
\"\${file}\" && /sbin/sysctl -q -p \"\${file}\")
                        done",
        refreshonly => true,
    }
Here is the output:
err: /Stage[main]/Sysctl/Exec[Apply all kernel variables]: Failed to call
refresh: for file in /etc/sysctl.conf /etc/sysctl.d/*.conf

                                 do
                                                        [ -r "${file}" ] &&
(echo Applying "${file}" && /sbin/sysctl -q -p "${file}")
                                                done returned 1 instead of
one of [0] at /etc/puppet/modules/sysctl/manifests/init.pp:93


Is simply doesn't work, I know that there are some special behavior with
the exec ressource. Of course the following exec works:
    exec { 'Apply all kernel variables' :
        path        => '/bin:/usr/bin:/usr/local/bin',
        user        => 'root',
        logoutput   => true,
        provider    => shell,
        command     => 'for file in /etc/sysctl.conf /etc/sysctl.d/*.conf
                        do
                            [ -r "\${file}" ] && (echo Applying "\${file}"
&& /sbin/sysctl -q -p "\${file}")
                        done',
        refreshonly => true,
    }


I have extremely big trouble using " instead of ', any idea?

Regards,
JM

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to