我只是build立一个新的傀儡服务器,并想找出什么最好的做法目录结构是? 我在不同的论坛和傀儡网站上看了一下,令我感到震惊的是,似乎每个人都以不同的方式展现出来。 没有推荐的方式和目录结构?
到目前为止我有:
puppet/ + manifests/ + site.pp + nodes/ + production/ + nodes.pp + dev/ + nodes.pp + modules/
我只是有点卡住之后:)
所以我想我想分开这个服务器angular色,如“web服务器”,它有一个服务,如“httpd”或“nginx”
最好的方法是把所有这一切,因为它驱使我坚果似乎没有一个首选的方法来做到这一点,或者我只是错过了所有其他信息:(
这是你如何构build目录?
puppet/ + manifests/ + site.pp + nodes/ + production/ + nodes.pp (Nodes have roles) + dev/ + nodes.pp + roles/ + web-server-apache.pp (Roles have modules) + modules/ + web-server-apache/ + manifests/ + init.pp (This is where "httpd" gets defined and installs latest httpd) + templates/ + files/
是的,标准的目录布局看起来像这样 – 你看到这种结构有什么样的变化?
你的不同服务(httpd,nginx)应该由模块目录中的modules
来处理,而将这些模块附加到节点以包含在它们的configuration目录中将在manifests
内发生。
你如何定义你的angular色? 一般来说,这应该在你的节点定义中完成,无论这是你的清单目录中的nodes.pp
文件,通过site.pp
加载,还是使用site.pp
作为你的节点定义(如果你愿意,它)。
我build议使用像Geppeto这样的IDE来根据Puppet Module Style Guide来pipe理你的模块。 Geppetto将创build所需的文件和目录结构。
所以我想我想分开这个服务器angular色,如“web服务器”,它有一个服务,如“httpd”或“nginx”
我想你问你是否可以把你的模块组织到文件系统的树上。 大多数人不这样做。 他们只是在模块目录中放置了很多模块,并给出了很好的描述性标签/名称。
为特定模块创build一些结构是有用的。 例如,你可能有一个role
模块,你可以创build一个类,如angular色::networking服务器which includes in modules that configure particular services. But if
which includes in modules that configure particular services. But if
role :: webserver`只包含类,则可以在节点定义,enc或hiera中应用相同的东西。
在你的例子中,你build议在services::
下定义服务。 如果你想使用伪造模块,你会发现这很难维护。 只是因为所有的锻造模块基本上都假设他们生活在顶层。 您将不得不大量重新编写您下载的任何模块,以使其适合您的结构并使用它。
所以我的build议,放弃树的想法,并接受你将有一个大的平面目录模块目录。