开发者

Running Recipe for Puppet on Ubuntu 11.04

开发者 https://www.devze.com 2023-04-13 05:39 出处:网络
I am new to Puppet world. I have Ubuntu 11.04 (64bit) server and client. I have installed the latest version开发者_开发技巧 of puppet server and client. The Puppet configuration running successfully.

I am new to Puppet world. I have Ubuntu 11.04 (64bit) server and client. I have installed the latest version开发者_开发技巧 of puppet server and client. The Puppet configuration running successfully. I am able to connect to the server from my client.

I want to write a recipe to install Apache2 on my client. Can anybody tell me the link or a step by step creation process of a puppet recipe to install Apache2 on my client? How to run and where to run these recipes?

Where do I see the error files? How can I know my recipes are working correctly?

The init.pp file is

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: {}
    }
 } 


The message is telling you there's already an /etc/password file who's group is root instead of bin. Since the /etc/password file doesn't have anything to do with installing apache, so I recommend removing the entire file block.

Other things you may want to look at:

  • The package name for apache is going to change based on the operating system, so it won;t always be 'httpd'
  • You may want to include an "enable => true" to your service so apache will start on boot.
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号