Ask Your Question

Puppet file move issue

asked 2014-02-27 08:44:20 -0600

Mike1977 gravatar image

updated 2014-02-27 09:40:52 -0600

doc75 gravatar image

Hello all,

Puppet newbie here that is diving into to deep end but having a few issues in the shallow side of the pool. Trying to copy over a file, /etc/nsswitch.conf from my master to a client node. I have the new nsswitch file in place like it is supposed to be and the manifest statement is written properly, and puppet has read access to the file but I keep getting the "could not retrieve information about environment production source" error. I have read many threads on Google about this and none appear to be helpful. Just wondering ... (more)

edit retag flag offensive close merge delete


Hard to help without your code.

lavaman gravatar imagelavaman ( 2014-02-27 18:31:57 -0600 )edit

3 Answers

Sort by ยป oldest newest most voted

answered 2014-02-27 09:40:39 -0600

doc75 gravatar image

Are you sure you are running your agent as root ? Are you using hiera ? It might not find hiera file also.

edit flag offensive delete link more

answered 2014-02-27 10:04:51 -0600

Mike1977 gravatar image

updated 2014-02-27 11:16:27 -0600

Okay.. so for the heck of it, I took off the .conf from nsswitch.conf that is my source file on my master. I reran puppet and it worked! From what I read, I do not see there being an issue with a . extension file, but I can't deny what I saw and I tested it by restoring to a default nsswitch conf file...

edit flag offensive delete link more


puppet does not care about file extensions so .conf should not be an issue. Unfortunately without the puppet output (best run puppet with --debug --trace) it would involve a lot ...(more)

Stefan gravatar imageStefan ( 2014-02-27 11:33:27 -0600 )edit

Agreed.. however I have done this to all the files I had to set it up with ldap so its no longer causing me to beat my head against the ...(more)

Mike1977 gravatar imageMike1977 ( 2014-02-27 14:24:20 -0600 )edit

answered 2015-04-04 10:20:49 -0600

Ensure your resources look like this:

class mynssconf {
  file { 'name_service_switch_configuration':
    ensure => file,
    path   => '/etc/nsswitch.conf',
    mode   => '0644',
    owner  => 'root',
    group  => 'root',
    source => 'puppet:///modules/mynssconf/nsswitch.conf',


$ ls -alhd /etc/puppet/modules/mynssconf/files/ # invoked on the puppetmaster
drwxr-xr-x 1 root puppet 12K Apr  4 15:15 /etc/puppet/modules/mynssconf/files/
$ ls -alh /etc/puppet/modules/mynssconf/files/nsswitch.conf
-rw-r--r-- 1 root puppet 475 Apr  4 15:10 /etc/puppet/modules/mynssconf/files/nsswitch.conf
edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

1 follower


Asked: 2014-02-27 08:44:20 -0600

Seen: 898 times

Last updated: Apr 04 '15