Ask Your Question
0

I am using source in manifest and getting error

asked 2016-11-05 05:54:45 -0600

vidyasagar.reddy66@gmail.com gravatar image

updated 2016-11-07 00:00:58 -0600

Hi Team,

I am using source parameter in manifest to push files to puppet agents.

Below is the my site.pp

package {'openssl': ensure => present, before => File['/etc/ssh/sshd_config'], }

file {'ssh_config':
       ensure => file,
       path => '/etc/ssh/sshd_config',
       mode => "600",
       source => "puppet:///modules/files/ssh_config",
}

service {'sshd':
        ensure => running,
        enable => true,
        subscribe => File['/etc/ssh/sshd_config'],
}

I have kept the source file ssh_config in below path.

  /opt/puppetlabs/puppet/modules/files/

When i am tryung from agent i am receiving below error please help.

puppet agent -t
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for dheera.asicdesigners.com
Info: Applying configuration version '1478337901'
Error: /Stage[main]/Main/File[ssh_config]: Could not evaluate: Could not retrieve information from environment production source(s) puppet:///modules/files/ssh_config
Notice: /Stage[main]/Main/Service[sshd]: Dependency File[ssh_config] has failures: true
Warning: /Stage[main]/Main/Service[sshd]: Skipping because of failed dependencies
Notice: Applied catalog in 0.19 seconds
edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted
0

answered 2016-11-07 00:09:53 -0600

vidyasagar.reddy66@gmail.com gravatar image

updated 2016-11-07 03:21:13 -0600

Fixed the issue,

The source file would be located on the Puppet master at etc/puppetlabs/code/modules/ssh/files/ssh_config

source should like below

 source  =>   "puppet:///modules/ssh/ssh_config",

created ssh directory and under ssh directory created files directory below is the manifests file and copied ssh_config file to files directory.

service {'sshd':
    ensure => running,
    enable => true,
    subscribe => File['/etc/ssh/sshd_config'],

}

edit flag offensive delete link more
0

answered 2016-11-06 15:59:52 -0600

shouldnt the format be:

puppet:///modules/my_module/ssh_config  where my_module is your module name
edit flag offensive delete link more

Comments

Hi, As you mentioned i used format but still i have facing same issue modules/ ├── helloworld │ └── manifests │ ├── init.pp │ └── motd.pp └── ssh ├── manifests │ └── init.pp └── ssh_config I have changed my script to use and below is the details: cat modules/ssh/manifests/in

vidyasagar.reddy66@gmail.com gravatar imagevidyasagar.reddy66@gmail.com ( 2016-11-07 02:11:09 -0600 )edit
0

answered 2016-11-07 01:05:57 -0600

rohithmn03 gravatar image

Hi,

First make sure that your "ssh_config" is inside you "ssh" dir. If YES, try with the below line: Just place your source with in single quotes instead of double quotes. Ex:

file {'ssh_config':
   ensure => file,
   path => '/etc/ssh/sshd_config',
   mode => "600",
   source => 'puppet:///modules/ssh/ssh_config',
   }
edit flag offensive delete link more

Comments

No luck same error, ssh_config exits and relapled double quotes with single quotes and same issue. [root@puppet production]# ls -l /etc/puppetlabs/code/environments/production/modules/ssh/ total 8 drwxrwxrwx 2 root root 20 Nov 7 14:18 manifests -rwxrwxrwx 1 root root 4702 Nov 5 13:47 ssh_config

vidyasagar.reddy66@gmail.com gravatar imagevidyasagar.reddy66@gmail.com ( 2016-11-07 02:56:36 -0600 )edit

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2016-11-05 05:54:45 -0600

Seen: 120 times

Last updated: Nov 07 '16