Ask Your Question

Revision history [back]

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/init.pp 
  class ssh {
    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/ssh/ssh_config",
   }

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

Below is the main manifests code:

 cat manifests/site.pp 
 node default {
 class { 'ssh': }
  }

still same error:

  Info: Using configured environment 'production'
   Info: Retrieving pluginfacts
   Info: Retrieving plugin
   Info: Caching catalog for dheera.asicdesigners.com
   Info: Applying configuration version '1478497316'
   Error: /Stage[main]/Ssh/File[ssh_config]: Could not evaluate: Could not retrieve information from environment production        source(s)       
   puppet:///modules/ssh/ssh_config
   Notice: /Stage[main]/Ssh/Service[sshd]: Dependency File[ssh_config] has failures: true
   Warning: /Stage[main]/Ssh/Service[sshd]: Skipping because of failed dependencies
   Notice: Applied catalog in 0.21 seconds

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/init.pp 
  class ssh {
    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/ssh/ssh_config",
   }

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

Below is the main manifests code:

 cat manifests/site.pp 
 node default {
 class { 'ssh': }
  }

still same error:

  Info: Using configured environment 'production'
   Info: Retrieving pluginfacts
   Info: Retrieving plugin
   Info: Caching catalog for dheera.asicdesigners.com
   Info: Applying configuration version '1478497316'
   Error: /Stage[main]/Ssh/File[ssh_config]: Could not evaluate: Could not retrieve information from environment production        source(s)       
   puppet:///modules/ssh/ssh_config
   Notice: /Stage[main]/Ssh/Service[sshd]: Dependency File[ssh_config] has failures: true
   Warning: /Stage[main]/Ssh/Service[sshd]: Skipping because of failed dependencies
   Notice: Applied catalog in 0.21 seconds

Hi, As you mentioned i used format but still i have facing same issueFixed the issue,

The source file would be located on the Puppet master at etc/puppetlabs/code/modules/ntp/files/ntp.conf

source should like below

  modules/
├── helloworld
│   └── manifests
│       ├── init.pp
│         └── motd.pp
└── ssh
├── manifests
│   └── init.pp
└── ssh_config
source=>

I have changed my script to use and below is the details:

  cat modules/ssh/manifests/init.pp 
  class ssh {
    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/ssh/ssh_config",
   }

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

Below is the main manifests code:

 cat manifests/site.pp 
 node default {
 class { 'ssh': }
  }

still same error:

  Info: Using configured environment 'production'
   Info: Retrieving pluginfacts
   Info: Retrieving plugin
   Info: Caching catalog for dheera.asicdesigners.com
   Info: Applying configuration version '1478497316'
   Error: /Stage[main]/Ssh/File[ssh_config]: Could not evaluate: Could not retrieve information from environment production        source(s)       
   puppet:///modules/ssh/ssh_config
   Notice: /Stage[main]/Ssh/Service[sshd]: Dependency File[ssh_config] has failures: true
   Warning: /Stage[main]/Ssh/Service[sshd]: Skipping because of failed dependencies
   Notice: Applied catalog in 0.21 seconds

Fixed the issue,

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

source should like below

 source=>
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'],

}