{"id":229867,"date":"2014-07-21T22:45:03","date_gmt":"2014-07-21T18:45:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=229867"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=229867","title":{"rendered":"<span class=\"post_title\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e Puppet \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0441 \u043d\u0443\u043b\u044f<\/span>"},"content":{"rendered":"<div class=\"content html_format\">       \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u044f \u043f\u0435\u0440\u0435\u043e\u0441\u043c\u044b\u0441\u043b\u0438\u043b \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 Puppet \u0441 \u043d\u0443\u043b\u044f \u043d\u0430 Ubuntu 12.04, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0432\u0441\u0435 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0432\u0438\u0441\u0442\u0435\u043b\u043a\u0438 \u0438 \u043f\u0435\u0440\u0434\u0435\u043b\u043a\u0438. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u044d\u0442\u043e\u0442 \u0433\u0430\u0439\u0434.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0447\u0438\u0441\u0442\u0430\u044f Ubuntu c \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u0439 \u0441\u0435\u0442\u044c\u044e \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c DNS.<\/p>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c:  <\/p>\n<ul>\n<li>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b\u0439 \u0432\u0435\u0437\u0434\u0435 Puppet 3-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438<\/li>\n<li>\u041a\u043e\u043d\u0444\u0438\u0433\u0438 \u0432 git \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u0441 \u043e\u0431\u0449\u0438\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c<\/li>\n<li>\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0435 <a href=\"https:\/\/github.com\/adrienthebo\/r10k\">r10k<\/a><\/li>\n<li>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 PuppetDB<\/li>\n<li>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 Hiera<\/li>\n<\/ul>\n<p>  \u0414\u0430\u043d\u043d\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0434\u043b\u0438\u043d\u043d\u043e\u0435, \u0442.\u043a. \u0432\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u0435\u043b\u0430\u044e\u0442\u0441\u044f \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u0447\u0442\u043e\u0431\u044b \u0432\u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438 \u043b\u0435\u0433\u043a\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0438 \u043f\u043e\u0434\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u0434 \u0441\u0435\u0431\u044f. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f PuppetDB, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0449\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043e\u0442 Puppet Labs, \u0430 \u043d\u0435 \u0432\u0440\u0443\u0447\u043d\u0443\u044e.<\/p>\n<p>  \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432\u0441\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f root \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 Puppet, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0438\u043d\u043e\u0435.<br \/>  <a name=\"habracut\"><\/a><\/p>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Puppet<\/h2>\n<p>  \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 Puppet Labs, \u043f\u0443\u0442\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0438\u0445 \u043f\u0430\u043a\u0435\u0442\u0430:  <\/p>\n<pre><code class=\"bash\">source \/etc\/lsb-release wget https:\/\/apt.puppetlabs.com\/puppetlabs-release-$DISTRIB_CODENAME.deb dpkg -i puppetlabs-release-$DISTRIB_CODENAME.deb rm puppetlabs-release-$DISTRIB_CODENAME.deb <\/code><\/pre>\n<p>  \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 Puppet \u0438 Puppet Master:  <\/p>\n<pre><code class=\"bash\">apt-get update apt-get install puppet puppetmaster <\/code><\/pre>\n<p>  <i>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435 \u043e\u0442 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430: \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f Puppet Labs <a href=\"http:\/\/docs.puppetlabs.com\/guides\/install_puppet\/install_debian_ubuntu.html#step-2-install-puppet-on-the-puppet-master-server\">\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442<\/a> \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c puppetmaster-passenger.<\/i><\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Puppet<\/h2>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432\u0430\u0448\u0438\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439 \u0438 \u0434\u0430\u0439\u0442\u0435 \u0433\u0440\u0443\u043f\u043f\u0435 <code>puppet<\/code> \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c:  <\/p>\n<pre><code class=\"bash\">mkdir \/etc\/puppet\/environments chgrp puppet \/etc\/puppet\/environments chmod 2775 \/etc\/puppet\/environment <\/code><\/pre>\n<p>  \u041c\u044b \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0434\u0430\u043d\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u0437\u0430 \u043d\u0430\u0441 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c <code>r10k<\/code> \u0447\u0435\u0440\u0435\u0437 git hook, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 <code>\/etc\/puppet\/puppet.conf<\/code>. \u0412\u043e\u0442 \u043d\u0435\u043f\u043b\u043e\u0445\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0447\u0430\u0442\u044c:  <\/p>\n<pre><code>[main]   environment   = production   confdir       = \/etc\/puppet   logdir        = \/var\/log\/puppet   vardir        = \/var\/lib\/puppet   ssldir        = $vardir\/ssl   rundir        = \/var\/run\/puppet   factpath      = $vardir\/lib\/facter   templatedir   = $confdir\/templates   pluginsync    = true  [agent]   environment   = production   report        = true   show_diff     = true  [master]   environment   = production   manifest      = $confdir\/environments\/$environment\/manifests\/site.pp   modulepath    = $confdir\/environments\/$environment\/modules:$confdir\/environments\/$environment\/site   # Passenger   ssl_client_header        = SSL_CLIENT_S_DN   ssl_client_verify_header = SSL_CLIENT_VERIFY <\/code><\/pre>\n<p>  <i>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435 \u043e\u0442 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430: \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 3.6, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 <code>manifest<\/code>\/<code>modulepath<\/code>\/<code>config_version<\/code> <a href=\"http:\/\/docs.puppetlabs.com\/puppet\/3.6\/reference\/release_notes.html#deprecation-config-file-environments-and-the-global-manifestmodulepathconfigversion-settings\">\u0443\u0441\u0442\u0430\u0440\u0435\u043b\u0438 \u0432 \u043f\u043e\u043b\u044c\u0437\u0443 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439<\/a>.<\/i><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0449\u0435 \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u043d\u0438 &quot;<code>puppet<\/code>&quot; \u0432 DNS, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <code>server = your.server.com<\/code> \u0432 \u0441\u0435\u043a\u0446\u0438\u044e <code>[main]<\/code>.<\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Hiera<\/h2>\n<p>  Hiera \u0442\u0430\u043a \u0436\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438. \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0444\u0430\u0439\u043b <code>\/etc\/puppet\/hiera.yaml<\/code>:  <\/p>\n<pre><code class=\"ruby\">--- :hierarchy:   - &quot;nodes\/%{::fqdn}&quot;   - &quot;manufacturers\/%{::manufacturer}&quot;   - &quot;virtual\/%{::virtual}&quot;   - common :backends:   - yaml :yaml:   :datadir: &quot;\/etc\/puppet\/environments\/%{::environment}\/hieradata&quot; <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0442\u043b\u0430\u0434\u043a\u0443 Hiera \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0449\u0435 \u0438 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u044b \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c, \u044f \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u0430\u0439\u043b <code>\/etc\/hiera.yaml<\/code> (\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c Puppet \u0434\u0430\u0436\u0435 \u043d\u0435 \u043f\u043e\u0434\u043e\u0437\u0440\u0435\u0432\u0430\u0435\u0442) \u0441\u0438\u043c\u0432\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u043e\u0439 \u043d\u0430 <code>\/etc\/puppet\/hiera.yaml<\/code>:  <\/p>\n<pre><code class=\"bash\">ln -sf \/etc\/puppet\/hiera.yaml \/etc\/hiera.yaml <\/code><\/pre>\n<h2>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 Puppet<\/h2>\n<p>   \u0421\u0435\u0439\u0447\u0430\u0441 \u0441\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 Puppet Master:  <\/p>\n<pre><code class=\"bash\">\/etc\/init.d\/puppetmaster restart <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c Puppet \u0430\u0433\u0435\u043d\u0442\u0430:  <\/p>\n<pre><code class=\"bash\">puppet agent --test <\/code><\/pre>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435\u0447\u0442\u043e \u043f\u043e\u0445\u043e\u0436\u0435\u0435:  <\/p>\n<pre><code class=\"ruby\">Info: Retrieving plugin Error: \/File[\/var\/lib\/puppet\/lib]: Could not evaluate: Could not retrieve information from environment production source(s) puppet:\/\/testpm.qix.no\/plugins Info: Caching catalog for testpm.qix.no Info: Applying configuration version '1384949455' Info: Creating state file \/var\/lib\/puppet\/state\/state.yaml Notice: Finished catalog run in 0.03 seconds <\/code><\/pre>\n<p>  \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0430, \u0442.\u043a. \u0443 \u043d\u0430\u0441 \u0435\u0449\u0435 \u043d\u0435\u0442 \u043d\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u0432, \u043d\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432. <br \/>  \u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c, \u0443\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u044c\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 DNS.<\/p>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 r10k<\/h2>\n<p>  \u0411\u0435\u0441\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 <a href=\"http:\/\/somethingsinistral.net\/\">Adrien Thebo<\/a> \u0441\u043e\u0437\u0434\u0430\u043b \u0442\u0430\u043a\u0443\u044e \u0436\u0435 \u0431\u0435\u0441\u043f\u043e\u0434\u043e\u0431\u043d\u0443\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u0443 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\u043c\u0438 Puppet \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u2014 \u043d\u0435\u0432\u0430\u0436\u043d\u043e, \u043d\u0430\u0448\u043b\u0438 \u043b\u0438 \u0432\u044b \u0438\u0445 \u043d\u0430 <a href=\"https:\/\/forge.puppetlabs.com\/\">Puppet Forge<\/a> \u0438\u043b\u0438 \u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0438\u0445 \u0432 \u0441\u0432\u043e\u0435\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438.<br \/>  \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043a\u0435 <a href=\"https:\/\/github.com\/adrienthebo\/r10k\">GitHub<\/a>. \u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:  <\/p>\n<pre><code class=\"bash\">apt-get install rubygems gem install r10k <\/code><\/pre>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 r10k<\/h2>\n<p>  \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0441 \u043a\u0435\u0448\u0430\u043c\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 <code>r10k<\/code> \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043a\u043e\u043f\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439:  <\/p>\n<pre><code class=\"bash\">mkdir \/var\/cache\/r10k chgrp puppet \/var\/cache\/r10k chmod 2775 \/var\/cache\/r10k <\/code><\/pre>\n<p>  \u0418 \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, <code>r10k<\/code> \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0439 \u0444\u0430\u0439\u043b \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438. \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 <code>\/etc\/r10k.yaml<\/code> \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:  <\/p>\n<pre><code class=\"ruby\"># location for cached repos :cachedir: '\/var\/cache\/r10k'  # git repositories containing environments :sources:   :base:     remote: '\/srv\/puppet.git'     basedir: '\/etc\/puppet\/environments'  # purge non-existing environments found here :purgedirs:   - '\/etc\/puppet\/environments' <\/code><\/pre>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 git<\/h2>\n<p>  \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0432\u0435\u0440\u0441\u0438\u044f git, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0434\u0435\u0442 \u0432 \u043f\u043e\u0441\u0442\u0430\u0432\u043a\u0435 Ubuntu 12.04, \u043f\u043e\u0434\u0432\u0435\u0440\u0436\u0435\u043d\u0430 <a href=\"https:\/\/git.kernel.org\/cgit\/git\/git.git\/commit\/?id=45d4fdc2dc74c657a9c2e95bf04aed539fdcb0a4\">\u044d\u0442\u043e\u043c\u0443 \u0431\u0430\u0433\u0443<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0430 (0755) \u043d\u0430 \u0432\u0441\u0435 \u043d\u043e\u0432\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f Puppet. \u042d\u0442\u043e \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0441\u0448\u0430\u0440\u0438\u0432\u0430\u0442\u044c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438.<\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 PPA \u043e\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 git:  <\/p>\n<pre><code class=\"bash\">apt-get install python-software-properties add-apt-repository ppa:git-core\/ppa <\/code><\/pre>\n<p>  \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e git:  <\/p>\n<pre><code class=\"bash\">apt-get update apt-get install git <\/code><\/pre>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 git \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/h2>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 git \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0442\u0430\u043d\u0435\u0442 \u0433\u043b\u0430\u0432\u043d\u044b\u043c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c Puppet \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430.<br \/>  \u0412\u0441\u0435 \u0432\u0430\u0448\u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u044b \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u044d\u0442\u0438\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u043c, \u0430 <code>r10k<\/code> \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0438\u0437 \u043d\u0435\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c (\u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c) \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f Puppet.<br \/>  \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0432 <code>\/srv\/puppet.git<\/code>:  <\/p>\n<pre><code class=\"bash\">git init --bare --shared=group \/srv\/puppet.git chgrp -R puppet \/srv\/puppet.git cd \/srv\/puppet.git git symbolic-ref HEAD refs\/heads\/production <\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0443 \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u043e\u0442\u043b\u0438\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438:  <\/p>\n<ol>\n<li>\u043e\u043d <i>bare;<\/i><\/li>\n<li>\u043e\u043d <i>shared;<\/i><\/li>\n<li>\u0432\u0435\u0442\u043a\u0430 <i>master<\/i> \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0430 \u0432 <i>production.<\/i><\/li>\n<\/ol>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430<\/h2>\n<p>  \u041f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0447\u0430\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c Puppet \u0432 git \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438.<br \/>  \u0412\u044b \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 git \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u043c \u0438\u0437 \u043f\u043e\u0434 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f root, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0433\u0440\u0443\u043f\u043f\u0443 <code>puppet<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0434\u043b\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044e:  <\/p>\n<pre><code class=\"bash\">adduser &lt;myuser&gt; puppet <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u043b\u043e\u0433\u0438\u043d\u044c\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0431\u044b \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432\u0441\u0442\u0443\u043f\u0438\u043b\u0438 \u0432 \u0441\u0438\u043b\u0443.<br \/>  \u0415\u0449\u0435 \u0440\u0430\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0447\u043b\u0435\u043d\u0441\u0442\u0432\u043e \u0432 \u0433\u0440\u0443\u043f\u043f\u0435, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u0434\u0430\u043d\u043d\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f:  <\/p>\n<pre><code class=\"bash\">id | grep puppet <\/code><\/pre>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 git \u0445\u0443\u043a\u0430<\/h2>\n<p>  \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0439\u0442\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u043e\u0434 \u0441\u0432\u043e\u0438\u043c \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c.<br \/>  \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0444\u0430\u0439\u043b <code>\/srv\/puppet.git\/hooks\/post-receive<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c <code>r10k<\/code> \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c push&#8217;\u0435 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439:  <\/p>\n<pre><code class=\"bash\">#!\/bin\/bash  umask 0002  while read oldrev newrev ref do     branch=$(echo $ref | cut -d\/ -f3)     echo     echo &quot;--&gt; Deploying ${branch}...&quot;     echo     r10k deploy environment $branch -p     # sometimes r10k gets permissions wrong too     find \/etc\/puppet\/environments\/$branch\/modules -type d -exec chmod 2775 {} \\; 2&gt; \/dev\/null     find \/etc\/puppet\/environments\/$branch\/modules -type f -exec chmod 664 {} \\; 2&gt; \/dev\/null done <\/code><\/pre>\n<p>  \u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u043c:  <\/p>\n<pre><code class=\"bash\">chmod 0775 \/srv\/puppet.git\/hooks\/post-receive <\/code><\/pre>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f<\/h2>\n<p>  \u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u0434\u043e\u043c\u0430\u0448\u043d\u044e\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u043f\u043e\u0434 \u0441\u0432\u043e\u0438\u043c \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0438 \u0441\u043a\u043b\u043e\u043d\u0438\u0440\u0443\u0439\u0442\u0435 \u043f\u0443\u0441\u0442\u043e\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439:  <\/p>\n<pre><code class=\"bash\">cd git clone \/srv\/puppet.git cd puppet <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0439:  <\/p>\n<pre><code class=\"bash\">mkdir -p hieradata\/nodes manifests site <\/code><\/pre>\n<p>  \u041f\u0430\u043f\u043a\u0443 <code>modules<\/code> \u043c\u044b \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c, \u0442.\u043a. \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 <code>r10k<\/code>. \u041b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 (\u0442.\u0435. \u043c\u043e\u0434\u0443\u043b\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e puppet master \u0441\u0435\u0440\u0432\u0435\u0440\u0430) \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <code>site<\/code>.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 <code>r10k<\/code>. \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0444\u0430\u0439\u043b <code>Puppetfile<\/code> \u0432 \u043a\u043e\u0440\u043d\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:  <\/p>\n<pre><code class=\"bash\"># Puppet Forge mod 'puppetlabs\/ntp', '3.0.0-rc1' mod 'puppetlabs\/puppetdb', '3.0.0' mod 'puppetlabs\/stdlib', '4.1.0' mod 'puppetlabs\/concat', '1.0.0' mod 'puppetlabs\/inifile', '1.0.0' mod 'puppetlabs\/postgresql', '3.2.0' mod 'puppetlabs\/firewall', '0.4.2'  # A module from your own git server #mod 'custom', #  :git =&gt; 'git:\/\/git.mydomain.com\/custom.git', #  :ref =&gt; '1.0' <\/code><\/pre>\n<p>  \u0424\u043e\u0440\u043c\u0430\u0442 \u0444\u0430\u0439\u043b\u0430 <code>Puppetfile<\/code> \u0431\u044b\u043b \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d \u0422\u0438\u043c\u043e\u043c \u0428\u0430\u0440\u043f\u043e\u043c (Tim Sharpe) \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 <a href=\"https:\/\/github.com\/rodjek\/librarian-puppet\">librarian-puppet<\/a>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0435\u0433\u043e \u043a\u0430\u043a \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438.<br \/>  \u0414\u0432\u0430 \u0432\u0430\u0436\u043d\u044b\u0445 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043e <code>Puppetfile<\/code>:  <\/p>\n<ul>\n<li>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0438 \u043e\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>puppet module<\/code>, <code>r10k<\/code> \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 (\u0434\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u0438 1.1.0). \u0412\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u0440\u0443\u0447\u043d\u0443\u044e.<\/li>\n<li>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0441\u044b\u043b\u0430\u0442\u044c\u0441\u044f \u043d\u0430 git \u043a\u043e\u043c\u043c\u0438\u0442\u044b \u0437\u0430\u043c\u0435\u043d\u044f\u044f \u0442\u0435\u0433\u0438 \u043d\u0430 git \u0445\u0435\u0448\u0438. \u0414\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b \u0434\u0430\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u0435\u0442\u043a\u0443, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 <code>ref<\/code> \u043d\u0430 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0442\u0438\u043f\u0430 <code>master<\/code>, \u043d\u043e \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u0430\u044f \u0438\u0434\u0435\u044f \u0432 \u0431\u043e\u0435\u0432\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438.<\/li>\n<\/ul>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0434\u0432\u0430 \u043c\u043e\u0434\u0443\u043b\u044f, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0432 \u0438\u0445 \u0447\u0435\u0440\u0435\u0437 <code>Hiera<\/code>.<br \/>  \u0412\u0441\u0435 \u0445\u043e\u0441\u0442\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043c\u0435\u0442\u044c <code>ntp<\/code> \u043c\u043e\u0434\u0443\u043b\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0444\u0430\u0439\u043b <code>hieradata\/common.yaml<\/code> \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:  <\/p>\n<pre><code class=\"ruby\">--- classes:   - ntp  ntp::servers:   - 0.pool.ntp.org   - 1.pool.ntp.org   - 2.pool.ntp.org   - 3.pool.ntp.org <\/code><\/pre>\n<p>  \u041d\u0430\u0448\u0435\u043c\u0443 puppet master \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u044c puppetdb, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0444\u0430\u0439\u043b <code>hieradata\/nodes\/$(hostname -f).yaml<\/code> \u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432 \u043d\u0435\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0441 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438:  <\/p>\n<pre><code class=\"ruby\">--- classes:   - puppetdb   - puppetdb::master::config <\/code><\/pre>\n<p>  \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 <code>manifests\/site.pp<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0432\u0441\u0435 \u043a\u043b\u0430\u0441\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438 \u0432 <code>Hiera<\/code>:  <\/p>\n<pre><code class=\"ruby\">hiera_include('classes') <\/code><\/pre>\n<h2>Commit \u0438 push<\/h2>\n<p>  \u041e\u0441\u0442\u0430\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u0432 git \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u2014 \u043f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c commit \u0438 push \u043f\u0435\u0440\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f <i>production<\/i>.<br \/>  \u0418\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e git \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438, \u0430 \u0443 \u043d\u0430\u0441 \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u043d\u0435\u0442 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0444\u0438\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <code>site<\/code>:  <\/p>\n<pre><code class=\"bash\">touch site\/.keep <\/code><\/pre>\n<p>  \u0423\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u044c\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0442\u043a\u0430, \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432\u0441\u0435 \u0444\u0430\u0439\u043b\u044b \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 commit \u0438 push:  <\/p>\n<pre><code class=\"bash\">git checkout -b production git add * git commit -a -m &quot;initital commit&quot; git push -u origin production <\/code><\/pre>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u043e\u0442\u0432\u0435\u0442:  <\/p>\n<pre><code class=\"bash\">Counting objects: 11, done. Compressing objects: 100% (5\/5), done. Writing objects: 100% (11\/11), 867 bytes | 0 bytes\/s, done. Total 11 (delta 0), reused 0 (delta 0) remote:  remote: --&gt; Deploying production... remote:  To \/srv\/puppet.git  * [new branch]      production -&gt; production Branch production set up to track remote branch production from origin. <\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 <code>--&gt; Deploying production...<\/code>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043d\u0430\u0448 git \u0445\u0443\u043a \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b.<br \/>  \u0412\u044b \u043c\u043e\u0436\u0435\u0442 \u0442\u0430\u043a \u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f <code>\/etc\/puppet\/environments\/production<\/code> \u0431\u044b\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0435\u0435 \u043f\u0430\u043f\u043a\u0438 <code>modules<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043c\u043e\u0434\u0443\u043b\u0438 Puppet Forge, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u043b\u0438 \u0432 <code>Puppetfile<\/code>.<\/p>\n<h2>\u0417\u0430\u043f\u0443\u0441\u043a Puppet<\/h2>\n<p>  \u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u0441\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f <code>root<\/code> \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 puppet \u0430\u0433\u0435\u043d\u0442\u0430:  <\/p>\n<pre><code class=\"bash\">puppet agent --test <\/code><\/pre>\n<p>  \u0412\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043a\u0440\u0430\u043d\u043e\u0432 \u0432\u044b\u0432\u043e\u0434\u0430 \u0447\u0435\u0440\u043d\u043e\u0433\u043e \u0438 \u0437\u0435\u043b\u0435\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441 \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u0438 \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 NTP \u0438 PuppetDB \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 PostgreSQL, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0434\u043b\u044f PuppetDB.<br \/>  \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435, \u0447\u0442\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u044b:  <\/p>\n<pre><code class=\"bash\">\/etc\/init.d\/ntp status \/etc\/init.d\/puppetdb status <\/code><\/pre>\n<h2>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 PuppetDB<\/h2>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 puppet \u0435\u0449\u0435 \u0440\u0430\u0437, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u043c\u0438 postgresql:  <\/p>\n<pre><code class=\"bash\">puppet agent --test <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0442\u0430\u043a\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:  <\/p>\n<pre><code class=\"bash\">puppet node status $(hostname -f) <\/code><\/pre>\n<p>  \u0412\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u043e\u0442\u0432\u0435\u0442:  <\/p>\n<pre><code class=\"bash\">testpm.qix.no Currently active Last catalog: 2013-11-20T13:22:05.036Z Last facts: 2013-11-20T13:22:00.437Z <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0441\u043e\u0432\u0435\u0442: \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443, \u0447\u0442\u043e\u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432\u0441\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0432\u0430\u0448\u0435\u043c \u0445\u043e\u0441\u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0445\u0440\u0430\u043d\u0438\u0442 puppetdb \u0432 \u043e\u0442\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c json:  <\/p>\n<pre><code class=\"bash\">puppet node find $(hostname -f) | python -mjson.tool <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c puppetdb \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"http:\/\/docs.puppetlabs.com\/puppet\/latest\/reference\/lang_exported.html\">\u044d\u043a\u0441\u043f\u043e\u0440\u0442 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432<\/a> \u0434\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0432\u0435\u0449\u0435\u0439 \u043a\u0430\u043a \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 ssh \u043a\u043b\u044e\u0447\u0435\u0439 \u043f\u043e \u0432\u0441\u0435\u043c \u0445\u043e\u0441\u0442\u0430\u043c.<\/p>\n<h2>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 Hiera<\/h2>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0434\u043e\u0448\u043b\u0438 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u0448\u0430\u0433\u0430, \u0437\u043d\u0430\u0447\u0438\u0442 Hiera \u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u0432\u0430\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u043e\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c Hiera \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438.<br \/>  \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0432\u044b \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043b\u0438 \u043c\u043e\u0435\u043c\u0443 \u0441\u043e\u0432\u0435\u0442\u0443 \u0438 \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0444\u0430\u0439\u043b \/etc\/hiera.yaml \u0441\u0438\u043c\u0432\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u043e\u0439 \u043d\u0430 \/etc\/puppet\/hiera.yaml. \u0422\u043e\u0433\u0434\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u0442 \u0432\u0441\u0435 \u043a\u043b\u0430\u0441\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u044b \u043a \u0442\u0435\u043a\u0443\u0449\u0435\u043c\u0443 \u0445\u043e\u0441\u0442\u0443 \u0432 production \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438:  <\/p>\n<pre><code class=\"bash\">hiera -a classes ::environment=production ::fqdn=$(hostname -f) <\/code><\/pre>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c:  <\/p>\n<pre><code class=\"bash\">[&quot;puppetdb&quot;, &quot;puppetdb::master::config&quot;, &quot;ntp&quot;] <\/code><\/pre>\n<h2>\u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Puppet Master<\/h2>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0432\u0435\u0442\u043e\u043a \u0432 git \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u0441\u043e\u0431\u044b\u0445 \u0443\u0441\u0438\u043b\u0438\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"bash\"># \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u0443\u044e \u0432\u0435\u0442\u043a\u0443 \u0438 \u0441\u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f git checkout -b new_feature vim somefile git add somefile git commit -m &quot;best feature ever&quot;  # \u043d\u043e\u0432\u0430\u044f \u0432\u0435\u0442\u043a\u0430 == \u043d\u043e\u0432\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 git push --set-upstream origin new_feature  # \u043f\u0440\u043e\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0435\u0441\u0442\u044b (\u0432\u0435\u0434\u044c \u0432\u044b \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u043d\u0435 \u0442\u0430\u043a \u043b\u0438?) puppet agent --test --noop --environment new_feature puppet agent --test --environment new_feature  # diff and merge git checkout production git diff ..new_feature git diff --name-only new_feature git merge new_feature  # \u0432\u044b\u043b\u043e\u0436\u0438\u0442\u0435 \u043d\u043e\u0432\u0443\u044e \u0444\u0438\u0447\u0443 \u0432 production git push  # \u0443\u0434\u0430\u043b\u0438\u0442\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0442\u043a\u0443 git branch -d new_feature  # \u0443\u0434\u0430\u043b\u0438\u0442\u0435 \u0432\u0435\u0442\u043a\u0443 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 == \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 git push origin :new_feature <\/code><\/pre>\n<h2>\u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438<\/h2>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u043d\u0430\u0434 \u043c\u043e\u0434\u0443\u043b\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445 Puppet Master (\u043d\u043e \u043d\u0435 \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0430\u0440\u0443\u0436\u0443), \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u2014 \u0432\u044b\u043b\u043e\u0436\u0438\u0442\u044c \u043d\u0430 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 git \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432\u0435\u0442\u043a\u0443, \u043d\u0430\u0434 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u0432 <code>Puppetfile<\/code>:  <\/p>\n<pre><code class=\"ruby\">mod 'my_app',   :git =&gt; 'git:\/\/git.mydomain.com\/my_app.git',   :ref =&gt; 'master' <\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043f\u043e\u0434 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043a\u043e\u043c\u043c\u0438\u0442 \u0432 \u0432\u0435\u0442\u043a\u0435 <code>master<\/code> \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0434\u0435\u043b\u0430\u0435\u0442\u0435 push \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f <code>\/srv\/puppet.git<\/code>. \u0410 \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0434\u0435\u043b\u0430\u043b\u0438 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u044d\u0442\u043e\u0442 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439? \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 <code>r10k<\/code> \u044f\u0432\u043d\u043e. \u0414\u0430\u043d\u043d\u043d\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043e\u0431\u043d\u043e\u0432\u0438\u0442 \u0432\u0441\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0432\u043e \u0432\u0441\u0435\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\u0445:  <\/p>\n<pre><code class=\"bash\">r10k deploy environment -p <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f <i>testing<\/i>:  <\/p>\n<pre><code class=\"bash\">r10k deploy environment testing -p <\/code><\/pre>\n<p>  \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 <code>r10k<\/code> \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u044d\u0442\u043e \u0442\u043e, \u0447\u0442\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u0435\u0445\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0430 \u0432 <code>\/etc\/puppet\/environments<\/code>, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c \u0432 \u0440\u0430\u0441\u0448\u0430\u0440\u0435\u043d\u043d\u043e\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438. \u0427\u0442\u043e \u0431\u044b \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0441\u043a\u0440\u0438\u043f\u0442 <code>\/usr\/local\/bin\/deploy<\/code> \u0438 \u0434\u0430\u0439\u0442\u0435 \u0435\u043c\u0443 \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435:  <\/p>\n<pre><code class=\"bash\">#!\/bin\/sh  umask 0002  r10k deploy environment $1 -p  find \/etc\/puppet\/environments -mindepth 1 -type d -exec chmod 2775 {} \\; find \/etc\/puppet\/environments -type f -exec chmod 0664 {} \\; <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0432\u0435\u0442\u043a\u0443, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b:  <\/p>\n<pre><code class=\"bash\"># \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u0441\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0432\u043e \u0432\u0441\u0435\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\u0445 deploy  # \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u0441\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438 deploy testing <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0434 \u0441\u0432\u043e\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u0435\u043c, \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0442\u0435\u0433:  <\/p>\n<pre><code class=\"bash\">git tag -a 1.0 -m &quot;finally no error messages&quot; git push --tags <\/code><\/pre>\n<p>  \u2026 \u0438 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u0435 \u0432\u0430\u0448 Puppetfile, \u0447\u0442\u043e \u0431\u044b \u0441\u0441\u044b\u043b\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0438\u043c\u0435\u043d\u0438 \u0442\u0435\u0433\u0430, \u0430 \u043d\u0435 \u043f\u043e \u0438\u043c\u0435\u043d\u0438 \u0432\u0435\u0442\u043a\u0438. \u0427\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u043d\u044b \u0441\u0435\u0431\u0435 \u0437\u0430 \u044d\u0442\u043e.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043c\u0435\u0442\u044c \u043f\u0440\u043e\u0447\u043d\u0443\u044e \u0438 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e (\u043d\u0443, \u043d\u0430 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0432\u0440\u0435\u043c\u044f) \u0431\u0430\u0437\u043e\u0432\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e Puppet. \u0423\u0434\u0430\u0447\u0438!<\/p>\n<h2>\u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c<\/h2>\n<p>  <\/p>\n<ul>\n<li><a href=\"http:\/\/puppetlabs.com\/blog\/git-workflow-and-puppet-environments\">\u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 git \u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\u043c\u0438 Puppet<\/a> (Puppet Labs)<\/li>\n<li><a href=\"http:\/\/somethingsinistral.net\/blog\/rethinking-puppet-deployment\/\">\u041f\u0435\u0440\u0435\u043e\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f Puppet<\/a> (Adrien Thebo)<\/li>\n<\/ul>\n<h3>\u0414\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u0442 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430<\/h3>\n<p>  \u0423 \u0441\u0435\u0431\u044f \u043d\u0430 Puppet Master \u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b \u0441\u0432\u044f\u0437\u043a\u0443 <a href=\"https:\/\/github.com\/sitaramc\/gitolite\">gitolite<\/a>+<a href=\"http:\/\/gitlist.org\/\">gitlist<\/a>. \u0412\u0441\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043b\u0435\u0436\u0430\u0442 \u0432 gitolite, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 (<a href=\"https:\/\/about.gitlab.com\/\">gitlab<\/a> \u043c\u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043e\u043d\u0441\u0442\u0440\u0443\u043e\u0437\u043d\u044b\u043c \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438 \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u043c \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u043e\u043c). \u0414\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \/etc\/puppet \u0442\u043e\u0436\u0435 \u043b\u0435\u0436\u0438\u0442 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c git \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 (<code>environments<\/code> \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0432 <code>.gitignore<\/code>)<br \/>  \u0414\u043b\u044f \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043e\u0442\u0447\u0435\u0442\u043e\u0432 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e <a href=\"https:\/\/github.com\/spotify\/puppetexplorer\">puppetexplorer<\/a> \u2014 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f PuppetDB, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 (\u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 <code>AngularJS<\/code> \u0438 <code>CoffeeScript<\/code>).<\/p>\n<p>  \u0421\u0441\u044b\u043b\u043a\u0438:  <\/p>\n<ul>\n<li><a href=\"http:\/\/terrarum.net\/blog\/puppet-infrastructure-with-r10k.html\">Puppet Infrastructure with r10k<\/a><\/li>\n<li><a href=\"http:\/\/puppetspecialist.nl\/MPIpres\/#1\">Manageable Puppet infrastructure<\/a><\/li>\n<li><a href=\"http:\/\/www.olindata.com\/blog\/2014\/01\/puppet-management-gui-comparison\">Puppet Management GUI Comparison<\/a><\/li>\n<\/ul>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/229867\/\"> http:\/\/habrahabr.ru\/post\/229867\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">       \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u044f \u043f\u0435\u0440\u0435\u043e\u0441\u043c\u044b\u0441\u043b\u0438\u043b \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 Puppet \u0441 \u043d\u0443\u043b\u044f \u043d\u0430 Ubuntu 12.04, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0432\u0441\u0435 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0432\u0438\u0441\u0442\u0435\u043b\u043a\u0438 \u0438 \u043f\u0435\u0440\u0434\u0435\u043b\u043a\u0438. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u044d\u0442\u043e\u0442 \u0433\u0430\u0439\u0434.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0447\u0438\u0441\u0442\u0430\u044f Ubuntu c \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u0439 \u0441\u0435\u0442\u044c\u044e \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c DNS.<\/p>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c:  <\/p>\n<ul>\n<li>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b\u0439 \u0432\u0435\u0437\u0434\u0435 Puppet 3-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438<\/li>\n<li>\u041a\u043e\u043d\u0444\u0438\u0433\u0438 \u0432 git \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u0441 \u043e\u0431\u0449\u0438\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c<\/li>\n<li>\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0435 <a href=\"https:\/\/github.com\/adrienthebo\/r10k\">r10k<\/a><\/li>\n<li>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 PuppetDB<\/li>\n<li>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 Hiera<\/li>\n<\/ul>\n<p>  \u0414\u0430\u043d\u043d\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0434\u043b\u0438\u043d\u043d\u043e\u0435, \u0442.\u043a. \u0432\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u0435\u043b\u0430\u044e\u0442\u0441\u044f \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u0447\u0442\u043e\u0431\u044b \u0432\u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438 \u043b\u0435\u0433\u043a\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0438 \u043f\u043e\u0434\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u0434 \u0441\u0435\u0431\u044f. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f PuppetDB, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0449\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043e\u0442 Puppet Labs, \u0430 \u043d\u0435 \u0432\u0440\u0443\u0447\u043d\u0443\u044e.<\/p>\n<p>  \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432\u0441\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f root \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 Puppet, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0438\u043d\u043e\u0435.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-229867","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/229867","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=229867"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/229867\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=229867"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=229867"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=229867"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}