Puppet Advanced Guide--package Resources detailed

Source: Internet
Author: User

Package Resources

The package resource can be used to help us install the software using the local Pack management system, or it can be installed by specifying a package with parameters.


1. Common Properties of package resources


Package {' Resource title ':

Allowcdrom

Description

Ensure

Provider

Source

}


Allowcdrom: Notifies apt to allow the use of CDROM as a source of software, which can be set to False or true.

Description: Describes the package.

ensure: Set the installation state of the package, you can set the value of present|installed|absent|latest|purged| " Version ".

= = present|installed, checks whether the file exists, does not exist the new
= = Absent, no other software dependencies, can be deleted, otherwise it will error.
= = Latest, check whether the file is the latest version, or upgrade to the latest version
= = purged, remove the package including all dependent packages, with the risk of caution
= "2.7.21-1", specifying that a version is in the installed state

provider: Different platforms are available in different packages.

Source: Specifies the installation source for the package.


Case 1

Installing httpd RPM packages through the package resource

Edit/etc/puppet/manifests/package.pp, add the following:

Package {' httpd ':

ensure = installed,

Provider = ' Yum ',

}


If it is a RPM package, you can also set this

Package {' httpd ':

ensure = installed,

Source = '/tmp/httpd-2.2.15-45.el6.centos.i686.rpm ',

Provider = ' rpm ',

}


# Puppet Apply Package.pp

NOTICE:/stage[main]//package[httpd]/ensure:created

notice:finished catalog run in 1.91 seconds


Case 2

The above is to install a package, if we install a large number of packages can be set

package {["httpd",

"Puppet",

"Nginx",

"OpenSSL"]:

ensure = installed,

}



please pay attention to http://www.wzlinux.com:45 and http://www.wzlinux.com .



This article is from the "Small Drops Linux" blog, make sure to keep this source http://wangzan18.blog.51cto.com/8021085/1685642

Puppet Advanced Guide--package Resources detailed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.