In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article is about how to analyze the new features of Puppet 2.6.x. The editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article.
Puppet is an open source enterprise systems management tool that has added a number of new features to the Puppet 2.6.0 release (and subsequent releases, including the most recent 2.6.5). The 2.6.x series will be the next generation of Puppet in a number of ways, including normalizing the number of versions by moving the decimal point in the version count (from 0.25 to 2.6.x series). In this technique, we will highlight their new features and give some examples of how they work.
First of all, the new version marks opposition to Puppet's initial XMLRPC connection and support for faster RESTful API. The result is improved Puppet performance and easier integration with it.
Support for Ruby DSL
Another new feature is the new Ruby DSL (Domain specific language). Puppet has a current DSL that can be used to manage configurations, but 2.6.0 adds support for a pure Ruby version of DSL. In today's DSL, you can create a managed resource:
Class host {file {"/ etc/hosts": mode = > 0750 class host owner = > root,}}
In the new Ruby DSL, you can express it in the following ways:
Hostclass: host dofile "/ etc/hosts",: mode = > 0750,: owner = > "root" end
If you are already proficient in Ruby, you can also use Ruby code to perform tasks in your list of Ruby DS. For example, you can manage or retrieve data from other sources in your list, such as retrieving data from MySQL data and using it in Puppet resources:
Require 'rubygems'require' mysql'hostclass: packages docon = Mysql.new ('localhost',' user', 'password',' cmdb') pkgs = con.query ('select * from packages') pkgs.each_hash {| p | package p [' name'], ensure = > 'latest'} con.closeendnode' default' doinclude 'packages'end
New functions in Puppet language
The Puppet language itself has some new features, including the ability to use hashes (Puppet already knows the array) and elsif structures that are added to existing if/else conditions.
If $foo = 'bar' {include baz} else {include qux}
Puppet now allows more full if/elsif/else syntax as follows:
If $foo = = 'bar' {include baz} elsif $qux = =' hum' {include valve} else {include box}
In addition, Puppet now supports the concept of "phases", which means you can add rougher commands to your list. This is useful for administrative subroutines if there is a need for configuration in a specific command. For example, all the steps required to turn on the host may occur before the application configuration on the host. Puppet creates a default phase called "main". You can create other phases and specify the commands that occur:
Stage {[pre, post]:} Stage [pre]-> Stage [main]-> Stage [post]
This code specifies two phases: pre and post. It then specifies that the command be executed, first pre, then main, then post. We can then add resources and categories to that phase for execution in that phase, such as:
Class {"keys": stage = > pre; "dns": stage = > main; "web": stage = > post;}
Audit configuration options
Another new development is the concept of Puppet audit configuration. Before you run Puppet, you only have two modes:
Execute, which makes actual changes on the host.
Simulation or "wait" mode, where Puppet tells you what changes it will make but will not actually make those changes.
If you only want to know the configuration status, the new audit feature allows you to specify the configuration. You can specify configurations, such as tracking file ownership in the directory, telling Puppet to pay attention to these files and sending reports showing their status changes over time. For example, you can audit the `/ etc/ hosts` file. The next time Puppet*** runs a file, it reports its features-who owns it, licenses, and so on. During each continuous run, Puppet checks the existing status and reports all different conditions compared to the previous, for example, if the file owner changes, a log message is generated:
Audit change: the former record value owner root has become the owner james
This feature allows you to copy tools with audit capabilities, such as Tripwire with Puppet.
Puppet Enterprise Edition
Puppet Labs has released Puppet Enterprise Edition, a commercial product that bundles all Puppet and its associated accessories with an installer. It is designed to reduce barriers to user entry and to help people implement Puppet configuration practices. It has the same functionality as open source products, but it has built-in support, more robust testing, installers, and additional documentation.
This includes upgrading future versions of Puppet Dashboard and other major features and Puppet 2.7.0, both of which will be completed in mid-2011.
The above is how to analyze the new features of Puppet 2.6.x, and the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.