1

我是木偶世界的新手。我有 Ubuntu 11.04(64 位)服务器和客户端。我已经安装了最新版本的 puppet 服务器和客户端。Puppet 配置运行成功。我能够从我的客户端连接到服务器。

我想写一个食谱来在我的客户端上安装 Apache2。谁能告诉我在我的客户端上安装 Apache2 的木偶配方的链接或逐步创建过程?如何运行以及在哪里运行这些食谱?

我在哪里可以看到错误文件?我怎么知道我的食谱工作正常?

init.pp 文件是

file  {"password": 
    name=>"/etc/passwd",
    owner =>"root",
    group =>"bin",
    mode=>644,
} 

class apache{ 
    package { httpd: ensure => installed }
    service{ "httpd" : 
        name => $operatingsystem ?{
                    debian=>"apache2",
                    redhat=>"httpd",
                    default =>"apache",
                    CentOS=>"httpd",
                 },
         ensure=> running,
         require=>Package["httpd"],
   }
 }

node 'myclientname'{
    include apache
} 

# All of the nodes that don't have definitions associated with the will use
# the following node definition.
node default {
    case $operatingsystem {
        CentOS: { include apache }
        default: {}
    }
 } 
4

1 回答 1

0

该消息告诉您已经有一个 /etc/password 文件,该文件的组是 root 而不是 bin。由于 /etc/password 文件与安装 apache 没有任何关系,所以我建议删除整个文件块。

您可能想要查看的其他内容:

  • apache 的包名会根据操作系统而改变,所以它不会总是'httpd'
  • 您可能希望在您的服务中包含“enable => true”,以便 apache 将在启动时启动。
于 2011-10-19T12:37:47.790 回答