我是一名木偶新手。我試圖設置一個廚師式的部署環境。我設置了一個puppet-master服務器,我希望能夠配置/部署到我同時設置的兩個節點。進口陳述失敗
我現在用我的木偶設置期望的是我的兩臺服務器(稱爲img01和img02)自動創建一個名爲/tmp/test_file.txt的文件。
我甚至不知道如何真正「加載」清單。我只是假設site.pp中的任何內容都會自動加載,但似乎並非如此。當我運行「傀儡適用/etc/puppet/manifests/site.pp」,我得到如下:
Error: Could not parse for environment production: No file(s) found for import of 'test' at /etc/puppet/manifests/site.pp:3 on node puppet.lgwp.com
Error: Could not parse for environment production: No file(s) found for import of 'test' at /etc/puppet/manifests/site.pp:3 on node puppet.lgwp.com
這是我的清單設置看起來像現在:在
證書列表木偶主服務器:
+ "img01.lgwp.com.com" (SHA256) (omitted)
+ "img02.lgwp.com" (SHA256) (omitted)
+ "puppet.lgwp.com" (SHA256) (omitted) (alt names: "DNS:puppet.lgwp.com")
/etc/puppet/manifest/site.pp:
import "test"
import "nodes"
Exec { path => "/usr/bin:/usr/sbin/:/bin:/sbin" }
/etc/puppet/manifest/nodes.pp:
import "test"
node "imageserver" {
include "tempfile"
}
node 'img01.lgwp.com' inherits imageserver {
}
node 'img02.lgwp.com' inherits imageserver {
}
/etc/puppet/modules/test/manifests/test.pp:
class test {
package { test: ensure => latest }
file { "test_file":
path => '/tmp/test_file.txt',
ensure => present,
mode => 0755,
content => 'hola world',
source => "puppet:///modules/test/test_file",
require => Package["test"],
}
}