Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos 木偶不工作_Macos_Puppet - Fatal编程技术网

Macos 木偶不工作

Macos 木偶不工作,macos,puppet,Macos,Puppet,我正试图在我的mac(OS X)中本地进行傀儡操作。我安装了最新版本的puppet、hiera和facter。我创建了一个具有以下结构的模块 $ find . . ./files ./manifests ./manifests/init.pp ./templates 以及hello_world/manifests/init.pp的内容 $ cat manifests/init.pp class hello_world { file {'/tmp/itworks': en

我正试图在我的mac(OS X)中本地进行傀儡操作。我安装了最新版本的puppet、hiera和facter。我创建了一个具有以下结构的模块

$ find .
.
./files
./manifests
./manifests/init.pp
./templates
以及hello_world/manifests/init.pp的内容

$ cat manifests/init.pp 
class hello_world { 
   file {'/tmp/itworks':
       ensure  => directory,
   }
}

但是,当我运行puppet apply hello_world/manifests/init.pp时,什么也不会发生。您定义了一个类,但从未包含它。(未声明该类。)

$ cat manifests/init.pp 
class hello_world { 
   file {'/tmp/itworks':
       ensure  => directory,
   }
}
puppet apply hello_world/manifests/init.pp 请注意,模块通常不直接应用。相反,您应用一个清单,该清单包含模块中的一个类(通常是以模块命名并自动位于
module\u name/manifests/init.pp

puppet apply -e 'include hello_world'
请注意,
hello\u world/
目录必须位于您的
$modulepath
(对于开源变体,通常是
/etc/puppet/modules

您可以尝试:

木偶应用-e“包括hello_world”

或者进行一次试运行

木偶应用-e'包括hello_world'--noop

有关应用的更多信息,请参阅手册页: