Hi,

Perhaps there is an environment diference between the command line and the
puppet agent process. The first one I think is the path one.

I would try to launch the php-config --version and the awk with the
full-path.

If that doesn't work, I would check if the php-config-version needs any
environment variable.

Regards,
El 29/04/2014 21:49, "Paulo Pinto" <[email protected]> escribió:

> Hi all.
>
> I have a very simple Custom Fact
> in /etc/puppet/modules/facts/lib/facter/php_version.rb :
>
> Facter.add(:php_version) do
>   setcode do
>     Facter::Util::Resolution.exec('php-config --version|awk -F "."
> \'{print $1$2}\'')
>   end
> end
>
> It gets deployed and if I run "facter -p |grep php " on the "slave" server
> I get:
> php_version => 54
>
> Now, if I try to use the variable on my manifest like this:
>
> file { "/usr/local/lib/php.ini":
>                 owner => root,
>                 group => root,
>                 mode => 0644,
>                 source  =>  "puppet:///files/php${::php_version}.ini",
>                 require => Exec['install_cpanel']
>         }
>
>
> I always get on the "slave" log :
>
> (/Stage[main]/Cpanel::Cpanel/File[/usr/local/lib/php.ini]) Could not
> evaluate: Could not retrieve information from environment production
> source(s) puppet:///files/php.ini
>
> As it is obvious, it's not replacing the variable ${::php_version} as it
> should return php54.ini and not php.ini .
>
> What am I doing wrong here ?
>
> Best regards,
>
> --
> Paulo
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/89d00ab1-018a-447f-a95f-3b804b25c85c%40googlegroups.com<https://groups.google.com/d/msgid/puppet-users/89d00ab1-018a-447f-a95f-3b804b25c85c%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAF_B3dcp_dQHR%2Bqi7%3D_K7x5iSm8kCV3foqEE8PZZEzsYpTgDJA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to