{"id":291,"date":"2016-06-30T23:33:37","date_gmt":"2016-06-30T23:33:37","guid":{"rendered":"https:\/\/avalon.land\/blog\/?p=291"},"modified":"2017-10-26T10:52:23","modified_gmt":"2017-10-26T10:52:23","slug":"puppet-with-hiera-best-practice","status":"publish","type":"post","link":"https:\/\/avalon.land\/blog\/it\/puppet-with-hiera-best-practice\/","title":{"rendered":"Puppet with Hiera\/Hierarchy [Best Practice]"},"content":{"rendered":"<p>\u0412\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u043d\u0430\u0448\u0438\u043c \u0431\u0430\u0440\u0430\u043d\u0430\u043c. \u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b\u0438, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c 2 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u043d\u0430 \u043d\u0438\u0445 <em>puppetmaster<\/em> \u0438 <em>puppetdb<\/em>. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0442\u0430\u043a \u0436\u0435 \u043f\u043e-\u043f\u0430\u0446\u0430\u043d\u0441\u043a\u0438 (aka best practice) \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c <em>hiera<\/em>, &#8220;\u043d\u0430\u043f\u0438\u0448\u0435\u043c&#8221; \u043d\u0430\u0448 \u043f\u0435\u0440\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0437 \u0440\u0435\u043f \u0444\u043e\u0440\u0434\u0436\u0430. \u041d\u0443, \u043f\u043e\u0435\u0445\u0430\u043b\u0438&#8230;<\/p>\n<p><!--more--><\/p>\n<h1 style=\"text-align: center;\"><span style=\"color: #808080;\">\u0422\u0435\u043e\u0440\u0438\u044f<\/span><\/h1>\n<hr \/>\n<p>\n\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 <em>hiera<\/em>? \u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 key\/value \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u043c \u0432\u0438\u0434\u0435 \u0432 \u0444\u0430\u0439\u043b\u0430\u0445. \u0427\u0442\u043e\u0431 \u043d\u0435 \u0440\u0430\u0441\u043f\u043b\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0432\u043e\u0434\u0435 \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0445 \u0438 \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0441\u043b\u043e\u0432 \u0442\u0435\u043e\u0440\u0438\u0438 \u043a\u0430\u043a \u044d\u0442\u043e \u043b\u044e\u0431\u044f\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0432 \u0441\u0432\u043e\u0435\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u0441\u043a\u0430\u0436\u0443 \u043b\u0438\u0448\u044c, \u0447\u0442\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0451 \u0434\u043b\u044f \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u0445\u043e\u0441\u0442\u043e\u0432 (\u043d\u043e\u0434, \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 puppet) \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0447\u0435\u0433\u043e-\u043b\u0438\u0431\u043e \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u041a\u0442\u043e \u043c\u0430\u043b\u043e-\u043c\u0430\u043b\u044c\u0441\u043a\u0438 \u0437\u043d\u0430\u043a\u043e\u043c \u0441 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u043e\u0439\u043c\u0451\u0442 \u043e \u0447\u0451\u043c \u0440\u0435\u0447\u044c.<\/p>\n<p>\u0417\u0430\u0447\u0435\u043c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u044b <em>\u043c\u043e\u0434\u0443\u043b\u0438<\/em> \u0438 \u043f\u0440\u0438 \u0447\u0451\u043c \u043e\u043d\u0438 \u0442\u0443\u0442 \u0432\u043e\u043e\u0431\u0449\u0435? \u041f\u043e-\u0441\u0443\u0442\u0438, \u0433\u0440\u0443\u0431\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u043c\u043e\u0434\u0443\u043b\u044c &#8211; \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u043b\u0430\u0441\u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0443\u0434\u043e\u0431\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430. \u0412\u043e\u043e\u0431\u0449\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u043c\u043e\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043b\u044e\u0431\u043e\u0439 \u0442\u043e\u0447\u043a\u0435 \u043b\u044e\u0431\u043e\u0433\u043e \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0430 \u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0442\u044c \u0438\u0445 \u0442\u0430\u043c \u0436\u0435, \u043d\u043e \u044d\u0442\u043e \u0432\u043d\u043e\u0441\u0438\u0442 \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u0443. \u041d\u0443 \u0438 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e &#8220;\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e&#8221; \u043f\u043e \u043c\u043d\u0435\u043d\u0438\u044e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 puppet, \u043f\u043e-\u044d\u0442\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, puppetdb \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u0432 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043e\u0434\u0438\u043d \u043e\u0434\u043d\u043e\u0438\u043c\u0451\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0441 \u043a\u0443\u0447\u0435\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u043f\u043e\u0434\u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 \u0442.\u0434.<\/p>\n<p>\u0412\u043e\u043e\u0431\u0449\u0435, \u043d\u0430\u0448 puppet-\u0441\u0435\u0440\u0432\u0438\u0441 \u043c\u043e\u0436\u0435\u0442 \u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438 \u0431\u0435\u0437 hiera, \u0432\u0441\u0435 \u0441\u0442\u0430\u0440\u044b\u0435 \u0435\u0433\u043e \u0432\u0435\u0440\u0441\u0438\u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a \u0438 \u0434\u0435\u043b\u0430\u044e\u0442, \u0432 \u043d\u0438\u0445 hiera \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043c\u043e\u0434\u0443\u043b\u0435\u043c \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c, \u043d\u043e \u0441 \u043d\u0435\u0434\u0430\u0432\u043d\u0438\u0445 \u043f\u043e\u0440 \u043e\u043d\u0430 \u0441\u0442\u0430\u043b\u0430 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 puppet&#8217;a. \u041d\u0443 \u043e\u043a, \u043f\u0443\u0441\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439, \u0440\u0430\u0437 \u043c\u044b \u0432\u0437\u044f\u043b\u0438\u0441\u044c \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c best practice, \u0437\u043d\u0430\u0447\u0438\u0442 \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0442 \u0438 \u0434\u043e, \u0447\u0442\u043e\u0431 \u043f\u043e-\u043f\u0430\u0446\u0430\u043d\u0441\u043a\u0438. \u0412\u043e\u0442 \u043a\u0430\u043a \u0432 \u0438\u0442\u043e\u0433\u0435 \u0432\u0441\u0451 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.<\/p>\n<figure id=\"attachment_250\" aria-describedby=\"caption-attachment-250\" style=\"width: 500px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/avalon.land\/blog\/wp-content\/uploads\/2016\/06\/pe-configuration-data1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-250\" src=\"https:\/\/avalon.land\/blog\/wp-content\/uploads\/2016\/06\/pe-configuration-data1.png\" alt=\"2\" width=\"500\" height=\"449\" \/><\/a><figcaption id=\"caption-attachment-250\" class=\"wp-caption-text\">\u0412\u0441\u0451 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e<\/figcaption><\/figure>\n<h1 style=\"text-align: center;\"><span style=\"color: #808080;\">\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430<\/span><\/h1>\n<hr \/>\n<p><\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043d\u0430\u0448\u0438 \u0445\u043e\u0441\u0442\u044b <strong>puppet<\/strong> \u0438 <strong>puppetdb<\/strong>. \u041f\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0438\u0445 (\u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043b\u0443\u0447\u0448\u0435 \u0432\u043e\u043e\u0431\u0449\u0435 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0447\u0430\u0449\u0435. \u041c\u044b \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u0438 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0435\u0433\u043e \u0441\u043e\u0444\u0442\u0430. \u0424\u0443-\u0444\u0443-\u0444\u0443) \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0447\u0442\u043e \u043d\u0430\u0448\u0438 \u0434\u0435\u043c\u043e\u043d\u044b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u043b\u0438.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\npuppet # ps ax | grep pupp\r\n  804 ?        Ssl    2:34 \/usr\/bin\/java -Xms4g -Xmx4g -XX:MaxPermSize=1g -XX:OnOutOfMemoryError=kill -9 %p -Djava.security.egd=\/dev\/urandom -cp \/opt\/puppetlabs\/server\/apps\/puppetserver\/puppet-server-release.jar clojure.main -m puppetlabs.trapperkeeper.main --config \/etc\/puppetlabs\/puppetserver\/conf.d -b \/etc\/puppetlabs\/puppetserver\/bootstrap.cfg\r\n11088 pts\/2    S+     0:00 grep --color=auto pupp\r\n\r\n\r\npuppetdb # ps ax | grep pupp\r\n  822 ?        Ssl    1:53 \/usr\/bin\/java -Xmx2g -XX:OnOutOfMemoryError=kill -9 %p -Djava.security.egd=\/dev\/urandom -cp \/opt\/puppetlabs\/server\/apps\/puppetdbpuppetdb.jar clojure.main -m puppetlabs.puppetdb.main --config \/etc\/puppetlabs\/puppetdb\/conf.d -b \/etc\/puppetlabs\/puppetdb\/bootstrap.cfg\r\n 5823 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53518) idle\r\n 5825 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53520) idle\r\n 5826 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53522) idle\r\n 5827 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53524) idle\r\n 5828 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53526) idle\r\n 5829 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53528) idle\r\n 5830 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53530) idle\r\n 5831 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53532) idle\r\n 5832 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53534) idle\r\n 5840 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53536) idle\r\n 5842 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53538) idle\r\n 5843 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53540) idle\r\n 5844 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53542) idle\r\n 5845 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53544) idle\r\n 5846 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53546) idle\r\n 5847 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53548) idle\r\n 5848 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53550) idle\r\n 5849 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53552) idle\r\n 5850 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53554) idle\r\n 5858 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53556) idle\r\n 5860 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53558) idle\r\n 5861 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53560) idle\r\n 5862 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53562) idle\r\n 5863 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53564) idle\r\n 5864 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53566) idle\r\n 5865 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53568) idle\r\n 5866 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53570) idle\r\n 5867 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53572) idle\r\n 5868 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53574) idle\r\n 5869 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53576) idle\r\n 5870 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53578) idle\r\n 5871 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53580) idle\r\n 5872 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53582) idle\r\n 5873 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53584) idle\r\n 5884 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53586) idle\r\n 5885 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53588) idle\r\n 5886 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53590) idle\r\n 5887 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53592) idle\r\n 5888 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53594) idle\r\n 5889 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53596) idle\r\n 5890 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53598) idle\r\n 5891 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53600) idle\r\n 5892 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53602) idle\r\n 5893 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53604) idle\r\n 5894 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53606) idle\r\n 5895 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53608) idle\r\n 5902 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53610) idle\r\n 5904 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53612) idle\r\n 5905 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53614) idle\r\n 5906 ?        Ss     0:00 postgres: puppetdb puppetdb 192.168.0.2(53616) idle\r\n 5934 pts\/0    S+     0:00 grep --color=auto pupp\r\n <\/pre>\n<p>\u041c\u043e\u0436\u043d\u043e \u0435\u0449\u0451 \u043b\u043e\u0433\u0438 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0434\u043b\u044f \u0432\u0435\u0440\u043d\u043e\u0441\u0442\u0438, \u043d\u043e \u043c\u043d\u0435 \u043b\u0435\u043d\u044c, \u044f \u0443\u0432\u0435\u0440\u0435\u043d \u0443 \u043d\u0430\u0441 \u0432\u0441\u0451 \u043d\u043e\u0440\u043c.<br \/>\n\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c. \u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e: \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0438 \u0437\u0430\u044e\u0437\u0430\u0435\u043c \u0435\u0433\u043e \u043d\u0430 \u043d\u043e\u0434\u0435 puppetdb \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e hiera. \u041c\u043e\u0434\u0443\u043b\u044c \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u043a\u0430\u043a \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0435 &#8211; ntp.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\npuppet # puppet module install puppetlabs-ntp\r\nNotice: Preparing to install into \/etc\/puppetlabs\/code\/environments\/production\/modules ...\r\nNotice: Downloading from https:\/\/forgeapi.puppetlabs.com ...\r\nNotice: Installing -- do not interrupt ...\r\n\/etc\/puppetlabs\/code\/environments\/production\/modules\r\nL-T puppetlabs-ntp (v4.2.0)\r\n  L-- puppetlabs-stdlib (v4.11.0)\r\n<\/pre>\n<p>\u0421\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043b\u044f \u043f\u0443\u0449\u0435\u0439 \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\npuppet # puppet module list\r\n\/etc\/puppetlabs\/code\/environments\/production\/modules\r\n+-- puppetlabs-apt (v2.2.2)\r\n+-- puppetlabs-concat (v2.1.0)\r\n+-- puppetlabs-firewall (v1.8.0)\r\n+-- puppetlabs-inifile (v1.5.0)\r\n+-- puppetlabs-ntp (v4.2.0)\r\n+-- puppetlabs-postgresql (v4.7.1)\r\n+-- puppetlabs-puppetdb (v5.1.2)\r\n+-- puppetlabs-stdlib (v4.11.0)\r\n\/etc\/puppetlabs\/code\/modules (no modules installed)\r\n\/opt\/puppetlabs\/puppet\/modules (no modules installed)\r\n<\/pre>\n<p>\u041e\u0442\u043b\u0438\u0447\u043d\u043e! \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0448 \u043c\u043e\u0434\u0443\u043b\u044c, \u043d\u043e \u043f\u043e\u043a\u0430 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f hiera, \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u043b\u0438 \u0432\u0441\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u043b\u044e\u0434\u0438 \u0440\u0430\u043d\u044c\u0448\u0435.<br \/>\n\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0444\u0430\u0439\u043b \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u043e\u0431\u044a\u044f\u0432\u0438\u043c \u0432\u0441\u0435 \u043d\u0430\u0448\u0438 \u043d\u043e\u0434\u044b <em>\/etc\/puppetlabs\/code\/environments\/production\/manifests\/site.pp<\/em> \u0435\u0441\u043b\u0438 \u043e\u043d \u0435\u0449\u0451 \u043d\u0435 \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d. \u0412\u043e\u043e\u0431\u0449\u0435, \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u0440\u043e\u043b\u0438 \u043d\u0435 \u0438\u0433\u0440\u0430\u0435\u0442, \u043f\u043e-\u0441\u0443\u0442\u0438 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442, \u043b\u044e\u0431\u043e\u0439 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 \u043f\u043e\u043c\u0435\u0449\u0451\u043d\u043d\u044b\u0439 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e environment, \u043d\u043e \u0440\u0430\u0437 \u0443\u0436 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0431\u0443\u043a\u0432\u0435 best practice, \u0431\u0443\u0434\u0435\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0451 \u0441\u0432\u043e\u0438\u043c\u0438 \u0438\u043c\u0435\u043d\u0430\u043c\u0438.<br \/>\n\u041f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nnode &#039;puppetdb.my.domain&#039; {\r\n  class { &quot;ntp&quot;:\r\n    servers    =&gt; &#x5B; &#039;0.ru.pool.ntp.org iburst&#039;,&#039;1.ru.pool.ntp.org iburst&#039;,&#039;2.ru.pool.ntp.org iburst&#039;,&#039;3.ru.pool.ntp.org iburst&#039;],\r\n    autoupdate =&gt; false,\r\n    restrict   =&gt; &#x5B;],\r\n  }\r\n}\r\n<\/pre>\n<p>\u0412\u0441\u0451, \u0441 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043e\u043d \u0432\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0432 \u0441\u0438\u043b\u0443, \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0438 \u043f\u0435\u0440\u0435\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0438. \u041c\u0430\u0441\u0442\u0435\u0440 \u043d\u0435 \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u0438\u0445 (\u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u044b) \u0432 \u043f\u0430\u043c\u044f\u0442\u044c, \u043d\u043e \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043a \u043d\u0438\u043c \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043a \u043d\u0435\u043c\u0443.<br \/>\n\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043d\u0430 puppetdb \u043a\u043b\u0438\u0435\u043d\u0442 \u0438 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\npuppetdb # puppet agent --no-daemonize --onetime --verbose\r\nInfo: Using configured environment &#039;production&#039;\r\nInfo: Retrieving pluginfacts\r\nInfo: Retrieving plugin\r\nInfo: Loading facts\r\nInfo: Caching catalog for puppetdb.my.domain\r\nInfo: Applying configuration version &#039;1467304459&#039;\r\nNotice: \/Stage&#x5B;main]\/Ntp::Config\/File&#x5B;\/etc\/ntp.conf]\/ensure: defined content as &#039;{md5}30c98a829448d2b680bb48abd595887f&#039;\r\nInfo: Class&#x5B;Ntp::Config]: Scheduling refresh of Class&#x5B;Ntp::Service]\r\nInfo: Class&#x5B;Ntp::Service]: Scheduling refresh of Service&#x5B;ntp]\r\nNotice: \/Stage&#x5B;main]\/Ntp::Service\/Service&#x5B;ntp]: Triggered &#039;refresh&#039; from 1 events\r\nNotice: Applied catalog in 0.17 seconds\r\n<\/pre>\n<p>\u0412\u0441\u0451 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c! \u0423\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e!<br \/>\n\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 hiera. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043c <em>\/etc\/puppetlabs\/code\/hiera.yaml<\/em> \u043f\u0440\u0438\u0432\u0435\u0434\u044f \u0444\u0430\u0439\u043b \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0432\u0438\u0434\u0443<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n---\r\n:backends:\r\n  - yaml\r\n:yaml:\r\n:datadir: &quot;\/etc\/puppetlabs\/code\/environments\/%{environment}\/hieradata&quot;\r\n:hierarchy:\r\n  - &quot;nodes\/%{::trusted.certname}&quot;\r\n  - &quot;nodes\/%{::hostname}&quot;\r\n  - common\r\n<\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nmkdir -p \/etc\/puppetlabs\/code\/environments\/production\/hieradata\/nodes\/\r\n<\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043a\u043e\u043d\u0444\u0438\u0433 \u043d\u0430\u0448\u0435\u0439 \u043d\u043e\u0434\u044b puppetdb <em>\/etc\/puppetlabs\/code\/environments\/production\/hieradata\/nodes\/puppetdb.my.domain.yaml<\/em> \u0438 \u043f\u0438\u0448\u0435\u043c \u0432 \u043d\u0451\u043c:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# \/etc\/puppetlabs\/code\/environments\/production\/hieradata\/nodes\/puppetdb.my.domain.yaml\r\n---\r\n# Declare our classes\r\nclasses: ntp\r\n\r\n# After declare, work with it, we can transfer any var that supports to it\r\nntp::restrict:\r\n -\r\nntp::autoupdate: false\r\nntp::enable: true\r\nntp::servers:\r\n - 0.jp.pool.ntp.org iburst\r\n - 1.jp.pool.ntp.org iburst\r\n - 2.jp.pool.ntp.org iburst\r\n - 3.jp.pool.ntp.org iburst\r\n<\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u043c \u043d\u0430\u0448 <em>\/etc\/puppetlabs\/code\/environments\/production\/manifests\/site.pp<\/em><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nnode &#039;puppetdb.my.domain&#039; {\r\n    hiera_include(&#039;classes&#039;)\r\n}\r\n<\/pre>\n<p>\u0421\u0438\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u043e\u043c, \u043c\u044b \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043c\u0430\u0441\u0442\u0435\u0440\u0430 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a hiera \u0438 \u0438\u0441\u043a\u0430\u0442\u044c \u0442\u0430\u043c \u0432\u0441\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441 \u043a\u043b\u044e\u0447\u0451\u043c <em>classes<\/em>. \u041a\u043b\u044e\u0447 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u044e\u0431\u043e\u0439, \u043d\u043e \u043e\u043f\u044f\u0442\u044c \u0436\u0435, \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u0430\u0434\u0443\u043c\u0430\u043d\u043d\u043e, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u0440\u043e\u0441\u044f\u0442 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0438\u043c\u0435\u043d\u043d\u043e <em>classes<\/em>, \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d\u0438 \u0442\u0430\u043a \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u0438&#8230; \u043f\u0430\u0440\u0434\u043e\u043d, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0442\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u041d\u0443 \u043e\u043a, \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u043c \u0438\u0445 \u0436\u0435\u043b\u0430\u043d\u0438\u0435.<br \/>\n\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043b\u0438\u0435\u043d\u0442 \u043d\u0430 puppetdb<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\npuppetdb # puppet agent --no-daemonize --onetime --verbose\r\nInfo: Using configured environment &#039;production&#039;\r\nInfo: Retrieving pluginfacts\r\nInfo: Retrieving plugin\r\nInfo: Loading facts\r\nInfo: Caching catalog for puppetdb.my.domain\r\nInfo: Applying configuration version &#039;1467305326&#039;\r\nInfo: Computing checksum on file \/etc\/ntp.conf\r\nInfo: \/Stage&#x5B;main]\/Ntp::Config\/File&#x5B;\/etc\/ntp.conf]: Filebucketed \/etc\/ntp.conf to puppet with sum 30c98a829448d2b680bb48abd595887f\r\nNotice: \/Stage&#x5B;main]\/Ntp::Config\/File&#x5B;\/etc\/ntp.conf]\/content: content changed &#039;{md5}30c98a829448d2b680bb48abd595887f&#039; to &#039;{md5}f65100dd021d444720d9c0442594c8c8&#039;\r\nInfo: Class&#x5B;Ntp::Config]: Scheduling refresh of Class&#x5B;Ntp::Service]\r\nInfo: Class&#x5B;Ntp::Service]: Scheduling refresh of Service&#x5B;ntp]\r\nNotice: \/Stage&#x5B;main]\/Ntp::Service\/Service&#x5B;ntp]: Triggered &#039;refresh&#039; from 1 events\r\nNotice: Applied catalog in 0.20 seconds\r\n<\/pre>\n<p><a href=\"https:\/\/avalon.land\/blog\/wp-content\/uploads\/2016\/06\/224896081.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-250 aligncenter\" src=\"https:\/\/avalon.land\/blog\/wp-content\/uploads\/2016\/06\/224896081.jpg\" alt=\"2\" width=\"500\" height=\"449\" \/><\/a><\/p>\n<p>\u0421\u043c\u0435\u0445 \u0441\u043c\u0435\u0445\u043e\u043c \u0438 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0447\u0442\u043e \u0432\u0441\u0451 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u043d\u043e \u044d\u0442\u043e \u043b\u0438\u0448\u044c \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u044d\u0442\u043e \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u044e \u044f. \u0427\u0442\u043e\u0431 \u0434\u043e\u0441\u0442\u0438\u0447\u044c \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u044f \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u043b \u0443\u0439\u043c\u0443 \u0441\u0432\u043e\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0412\u0441\u0451 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0432 \u0438\u0445 \u0434\u0443\u0440\u0430\u0446\u043a\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 1000 \u0441\u0442\u0440\u043e\u043a \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0442\u043e\u0433\u043e &#8220;\u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442&#8221; aka \u0442\u0435\u043e\u0440\u0438\u0438 \u0438 1 \u0441\u0442\u0440\u043e\u043a\u0430 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0435\u0449\u0451 \u043d\u0430\u0434\u043e \u043d\u0430\u0439\u0442\u0438. \u042f \u043d\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438 \u043c\u043d\u0435, \u043a\u0430\u043a \u0431\u044b\u0434\u043b\u043e\u0430\u0434\u043c\u0438\u043d\u0443, \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0438 \u044f \u0431\u044b\u043b \u0431\u044b \u0440\u0430\u0434 1000 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c \u0438 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0442\u0435\u043e\u0440\u0438\u0438, \u043d\u043e \u0443\u0432\u044b. \u041d\u0443 \u0434\u0430 \u043b\u0430\u0434\u043d\u043e, \u0430 \u0442\u043e \u0447\u0451\u0442 \u0443 \u043c\u0435\u043d\u044f \u0431\u043e\u043c\u0431\u0438\u0442\u044c \u0441\u043d\u043e\u0432\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442&#8230;<\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043d\u0430\u0448 \u0448\u0430\u0433 &#8211; \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0438\u0439 \u0441\u0432\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c, \u0447\u0442\u043e\u0431 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0442\u0443\u0434\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u043d\u0430\u043c \u043b\u043e\u0433\u0438\u043a\u0443. \u0415\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0443\u0442\u0435\u0439: <strong>\u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439<\/strong> \u0438 <strong>\u0411\u044b\u0441\u0442\u0440\u044b\u0439<\/strong>. \u041f\u0440\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043d\u0430\u0441 \u0443\u0447\u0430\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0441 \u043d\u0443\u043b\u044f, \u0443\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0435\u0433\u043e, \u0437\u0430\u043b\u0438\u0432\u0430\u0442\u044c \u043d\u0430 \u0440\u0435\u043f\u0443, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0438 \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <em>module install<\/em>. \u041d\u043e \u043a\u0430\u043a \u043c\u044b \u043d\u0435 \u0434\u0435\u0432\u0435\u043b\u043e\u043f\u0435\u0440\u044b, \u0430 \u0430\u0434\u043c\u0438\u043d\u044b \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c, \u0442\u0430\u043a \u043c\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0431\u044b\u0441\u0442\u0440\u044b\u0439: &#8220;\u0425\u0435\u0440\u0430\u043a-\u0445\u0435\u0440\u0430\u043a \u0438 \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u043d&#8221; (\u0441)<\/p>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043c\u043e\u0434\u0443\u043b\u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435, \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043d\u0430 \u0432\u0441\u0435 environment&#8217;\u044b, \u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c environment&#8217;\u0435, \u0432 \u043a\u0430\u043a\u043e\u0439 \u0432\u044b \u0435\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435. \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439. \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0443\u044e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f, \u0443 \u043d\u0430\u0441 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f tm (\u0421\u043e\u043a\u0440. Test Module):<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nmkdir \/etc\/puppetlabs\/code\/environments\/production\/modules\/tm\r\n<\/pre>\n<p>\u041e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u0430 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0439. \u041c\u043e\u0434\u0443\u043b\u0438 \u043f\u043e\u0434\u0447\u0438\u043d\u044f\u044e\u0442\u0441\u044f \u0442\u043e\u0439 \u0436\u0435 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u0447\u0442\u043e \u0438 environment&#8217;\u044b &#8211; \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u044b \u0432 manifests, \u0444\u0430\u0439\u043b\u044b \u0432 files, \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0432 templates \u0438 \u0442.\u043f. \u041d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e manifests. \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0435\u0451:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nmkdir \/etc\/puppetlabs\/code\/environments\/production\/modules\/tm\/manifests\r\n<\/pre>\n<p>\u0418 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u0442\u0443\u0434\u0430 \u043d\u0430\u0448 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b\u0438\u043a <em>init.pp<\/em> \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# Class: tm\r\n#\r\n\r\nclass tm ($parameter_one = &quot;default text&quot;) {\r\n file {&#039;\/tmp\/test_module&#039;:\r\n  ensure  =&gt; file,\r\n  content =&gt; $parameter_one,\r\n }\r\n}\r\n<\/pre>\n<p>\u0418 \u0442\u0443\u0442 \u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043d\u0430\u0448\u0438 \u043c\u043e\u0434\u0443\u043b\u0438:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\npuppet # puppet module list\r\n\/etc\/puppetlabs\/code\/environments\/production\/modules\r\n+-- puppetlabs-apt (v2.2.2)\r\n+-- puppetlabs-concat (v2.1.0)\r\n+-- puppetlabs-firewall (v1.8.0)\r\n+-- puppetlabs-inifile (v1.5.0)\r\n+-- puppetlabs-ntp (v4.2.0)\r\n+-- puppetlabs-postgresql (v4.7.1)\r\n+-- puppetlabs-puppetdb (v5.1.2)\r\n+-- puppetlabs-stdlib (v4.11.0)\r\nL-- tm (???)\r\n\/etc\/puppetlabs\/code\/modules (no modules installed)\r\n\/opt\/puppetlabs\/puppet\/modules (no modules installed)\r\n<\/pre>\n<p>\u0412\u0438\u0434\u0438\u043c \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0441\u043e \u0437\u043d\u0430\u043a\u0430\u043c\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0441\u043a\u043e\u0431\u043a\u0430\u0445. \u042d\u0442\u043e \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d \u0441\u0434\u0435\u043b\u0430\u043d \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0438 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0435\u0440\u0441\u0438\u0438, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0441\u0442\u0440\u0430\u0448\u043d\u043e, \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432 \u0441\u0430\u043c\u043e\u0435 \u0442\u043e.<br \/>\n\u041f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c <em>\/etc\/puppetlabs\/code\/environments\/production\/hieradata\/nodes\/puppetdb.my.domain.yaml<\/em> <\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# \/etc\/puppetlabs\/code\/environments\/production\/hieradata\/nodes\/puppetdb.my.domain.yaml\r\n---\r\n# Declare our classes\r\nclasses: \r\n - ntp\r\n - tm\r\n\r\n# After declare, work with it, we can transfer any var that supports to it\r\nntp::restrict:\r\n -\r\nntp::autoupdate: false\r\nntp::enable: true\r\nntp::servers:\r\n - 0.ch.pool.ntp.org iburst\r\n - 1.ch.pool.ntp.org iburst\r\n - 2.ch.pool.ntp.org iburst\r\n - 3.ch.pool.ntp.org iburst\r\n\r\n# Here is example our module &quot;Test Module&quot; via \/etc\/puppetlabs\/code\/environments\/production\/modules\/tm\r\ntm::parameter_one: &quot;There is no other way, and there never was. I lost in this place. Pls, i beg u, help me if u can&quot; \r\n<\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043b\u0438\u0435\u043d\u0442 \u043d\u0430 puppetdb<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\npuppetdb # puppet agent --no-daemonize --onetime --verbose\r\nInfo: Using configured environment &#039;production&#039;\r\nInfo: Retrieving pluginfacts\r\nInfo: Retrieving plugin\r\nInfo: Loading facts\r\nInfo: Caching catalog for puppetdb.my.domain\r\nInfo: Applying configuration version &#039;1467306854&#039;\r\nNotice: \/Stage&#x5B;main]\/Ntp::Config\/File&#x5B;\/etc\/ntp.conf]\/ensure: defined content as &#039;{md5}f65100dd021d444720d9c0442594c8c8&#039;\r\nInfo: Class&#x5B;Ntp::Config]: Scheduling refresh of Class&#x5B;Ntp::Service]\r\nInfo: Class&#x5B;Ntp::Service]: Scheduling refresh of Service&#x5B;ntp]\r\nNotice: \/Stage&#x5B;main]\/Ntp::Service\/Service&#x5B;ntp]: Triggered &#039;refresh&#039; from 1 events\r\nNotice: \/Stage&#x5B;main]\/Tm\/File&#x5B;\/tmp\/test_module]\/ensure: defined content as &#039;{md5}ef4186a646a01838b0427bdffeae7cc6&#039;\r\nNotice: Applied catalog in 0.18 seconds\r\n<\/pre>\n<p>\u041f\u043e\u0445\u043e\u0436\u0435 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 <em>\/tmp\/test_module<\/em><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\npuppetdb # cat \/tmp\/test_module\r\nThere is no other way, and there never was. I lost in this place. Pls, i beg u, help me if u can\r\n<\/pre>\n<p>\u0412 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u043f\u0438\u0441\u0430\u043b\u0438 \u0432 \u043d\u0430\u0448\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0435. \u0415\u0441\u043b\u0438 \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <em>parameter_one<\/em> , \u0431\u0443\u0434\u0435\u0442 \u0431\u0440\u0430\u0442\u044c\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u0437 \u043a\u043b\u0430\u0441\u0441\u0430.<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043d\u0435\u0445\u0438\u0442\u0440\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u043e\u0436\u043d\u043e \u0448\u0442\u0430\u043c\u043f\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u0438 \u043f\u0430\u0447\u043a\u0430\u043c\u0438, \u043f\u0438\u0445\u0430\u044f \u0442\u0443\u0434\u0430 \u0432\u0441\u0451 \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e, \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0445 \u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u043c \u043d\u043e\u0434\u0430\u043c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438. \u041d\u0443, \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u0431\u044b\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e. \u0423\u0432\u0438\u0434\u0438\u043c\u0441\u044f \u043a\u043e\u0433\u0434\u0430 \u0443\u0432\u0438\u0434\u0438\u043c\u0441\u044f.<br \/>\nSayonara.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0412\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u043d\u0430\u0448\u0438\u043c \u0431\u0430\u0440\u0430\u043d\u0430\u043c. \u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b\u0438, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c 2 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u043d\u0430 \u043d\u0438\u0445 puppetmaster \u0438 puppetdb. \u0412 \u044d\u0442\u043e\u0439<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/avalon.land\/blog\/it\/puppet-with-hiera-best-practice\/\">Continue reading<span class=\"screen-reader-text\">Puppet with Hiera\/Hierarchy [Best Practice]<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"class_list":["post-291","post","type-post","status-publish","format-standard","hentry","category-it","entry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/avalon.land\/blog\/wp-json\/wp\/v2\/posts\/291","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/avalon.land\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/avalon.land\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/avalon.land\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/avalon.land\/blog\/wp-json\/wp\/v2\/comments?post=291"}],"version-history":[{"count":7,"href":"https:\/\/avalon.land\/blog\/wp-json\/wp\/v2\/posts\/291\/revisions"}],"predecessor-version":[{"id":299,"href":"https:\/\/avalon.land\/blog\/wp-json\/wp\/v2\/posts\/291\/revisions\/299"}],"wp:attachment":[{"href":"https:\/\/avalon.land\/blog\/wp-json\/wp\/v2\/media?parent=291"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/avalon.land\/blog\/wp-json\/wp\/v2\/categories?post=291"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/avalon.land\/blog\/wp-json\/wp\/v2\/tags?post=291"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}