Could not evaluate: Could not retrieve information from environment production source(s) for one module, for other is ok

10,454 views
Skip to first unread message

Juan Sierra Pons

unread,
Aug 6, 2012, 3:01:20 PM8/6/12
to puppet...@googlegroups.com
Hi,

I have been fighting this issue without success for several days. I am
sure some of you have dealt with something similar:

I have 2 manifest one for vim which works like a charm :

class vim {
if $operatingsystem == "Debian" {
package {"vim":
ensure => present,
}
package {'vim-puppet':
ensure => present,
require => Package["vim"],
}
}
file { "/etc/vim/vimrc":
owner => "root",
group => "root",
mode => 0644,
source =>"puppet://$puppetserver/modules/vim/etc/vim/vimrc",
require => Package["vim"],
}
}

The source file is downloaded ok
Aug 6 20:49:55 virtualito puppet-agent[26967]:
(/Stage[main]/Vim/File[/etc/vim/vimrc]/ensure) defined content as
'{md5}b98e8ce84974ad114ec0e12b8b97fa1f'

BUT I have a similar manifest for ntp:

class ntp {
if $is_virtual == 'false' {
package { 'ntp':
ensure => present,
}
service { 'ntp':
ensure => 'running',
enable => 'true',
hasrestart => 'true',
require => Package['ntp']
}
file { "/etc/ntpd.conf":
owner => "root",
group => "root",
mode => 0644,
require => Package["ntp"],
source =>
"puppet://$puppetserver/modules/ntp/files/etc/ntp.conf",
}
}
if $is_virtual == 'true' {
package { 'ntp':
ensure => purged,
}
}
}

In this case the source file is not downloaded and the logs show the
following output:

(/Stage[main]/Ntp/File[/etc/ntpd.conf]) Could not evaluate: Could not
retrieve information from environment production source(s)
puppet:///modules/ntp/files/etc/ntp.conf at
/etc/puppet/modules/ntp/manifests/init.pp:19

I have already checked that puppet user can get to the proper file so
is not a issue of FS permission.

Any idea?

Best regards

--------------------------------------------------------------------------------------
Juan Sierra Pons ju...@elsotanillo.net
Linux User Registered: #257202 http://www.elsotanillo.net
GPG key = 0xA110F4FE
Key Fingerprint = DF53 7415 0936 244E 9B00 6E66 E934 3406 A110 F4FE
--------------------------------------------------------------------------------------

Tim Mooney

unread,
Aug 6, 2012, 4:45:39 PM8/6/12
to puppet...@googlegroups.com
In regard to: [Puppet Users] Could not evaluate: Could not retrieve...:

> class ntp {
> if $is_virtual == 'false' {
> package { 'ntp':
> ensure => present,
> }
> service { 'ntp':
> ensure => 'running',
> enable => 'true',
> hasrestart => 'true',
> require => Package['ntp']
> }
> file { "/etc/ntpd.conf":
> owner => "root",
> group => "root",
> mode => 0644,
> require => Package["ntp"],
> source =>
> "puppet://$puppetserver/modules/ntp/files/etc/ntp.conf",
> }
> }
> if $is_virtual == 'true' {
> package { 'ntp':
> ensure => purged,
> }
> }
> }

Your indenting is a little strange, but I would start by using
notice/notify/fail or whatever you prefer to determine what is_virtual
actually is set to.

There was a thread about quoting and true/false a few months ago, search
the archives for that. I can't remember if the style guide was updated
with recommendations regarding quoting true/false, but that would also
be a place to look.

Try using yes/no (as strings) and checking for that in your class.

You may also want to run puppet-lint on your manifests, it's not perfect
but it will help catch a number of issues.

Tim
--
Tim Mooney Tim.M...@ndsu.edu
Enterprise Computing & Infrastructure 701-231-1076 (Voice)
Room 242-J6, IACC Building 701-231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164

jenrzzz

unread,
Aug 6, 2012, 6:25:34 PM8/6/12
to puppet...@googlegroups.com
Your source path should be "puppet://$puppetserver/modules/ntp/etc/ntp.conf". Leave out the 'files' part.

-- Jenner

Josh Cooper

unread,
Aug 7, 2012, 12:21:53 AM8/7/12
to puppet...@googlegroups.com
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/puppet-users/-/hJqnlHxzo5YJ.
>
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.

Also I highly recommend the file server docs that describe the puppet
URL syntax in more detail[1]. For example, the $puppetserver part is
not necessary.

Josh

[1] http://docs.puppetlabs.com/guides/file_serving.html

--
Josh Cooper
Developer, Puppet Labs

Juan Sierra Pons

unread,
Aug 7, 2012, 1:22:17 PM8/7/12
to puppet...@googlegroups.com
Thank you all for point me in the right direction:

- The problem was the "file" part include in the path. No it works OK
I didn't pay enough attention to it

- http://docs.puppetlabs.com/guides/file_serving.html explains
perfectly how it works

- puppet-lint is an excellent tool too

Best regards

--------------------------------------------------------------------------------------
Juan Sierra Pons ju...@elsotanillo.net
Linux User Registered: #257202 http://www.elsotanillo.net
GPG key = 0xA110F4FE
Key Fingerprint = DF53 7415 0936 244E 9B00 6E66 E934 3406 A110 F4FE
--------------------------------------------------------------------------------------


2012/8/7 Josh Cooper <jo...@puppetlabs.com>:

Shawn Miller

unread,
Jul 27, 2014, 4:04:00 PM7/27/14
to puppet...@googlegroups.com
I have the same issue, but having it in and pointed to 'puppet://$puppetserve/modules/ntp/etc/ntp.conf' did not fix it- still get same error, not even 'puppet://$::server/modules/ntp/etc/ntp.conf,'

Juan Sierra Pons

unread,
Jul 28, 2014, 4:40:36 AM7/28/14
to puppet...@googlegroups.com
Hi

I think you have missed a r in the $puppetserver variable name
puppet://$puppetserve/modules/ntp/etc/ntp.conf
^

Best regards
--------------------------------------------------------------------------------------
Juan Sierra Pons ju...@elsotanillo.net
Linux User Registered: #257202
Web: http://www.elsotanillo.net Git: http://www.github.com/juasiepo
Reply all
Reply to author
Forward
0 new messages