[英]Error using source in Puppet manifest
我正在嘗試更改人偶代理中的文件,並且編寫了以下代碼。
modules/
├── helloworld
│ └── manifests
│ ├── init.pp
│ └── motd.pp
└── ssh
├── manifests
| └── init.pp
└── ssh_config
我的人偶清單代碼:
# 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'],
}
}
以下是主要清單的代碼:
# manifests/site.pp
node default {
class { 'ssh': }
}
以下是我收到的錯誤:
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
您的ssh_config
文件位置必須位於模塊的files
目錄中,以便與source
屬性中的Puppet URI一起使用,就像您所做的那樣。
modules/
├── helloworld
│ └── manifests
│ ├── init.pp
│ └── motd.pp
└── ssh
├── manifests
| └── init.pp
└── files
├── ssh_config
另外,您可能意味着您的package
資源是openssh
而不是openssl
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.