{"id":287303,"date":"2018-08-16T14:06:18","date_gmt":"2018-08-16T10:06:18","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=287303"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=287303","title":{"rendered":"\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043d\u0430 \u0431\u0430\u0437\u0435 Icinga2 \u0438 Puppet"},"content":{"rendered":"\n<div data-io-article-url=\"https:\/\/habr.com\/post\/420199\/\" class=\"post__text post__text-html js-mediator-article\">\n<h1><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/do\/po\/ex\/dopoexqmfbzwvbyt6vlwvvaqqus.png\">\u00a0\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043d\u0430 \u0431\u0430\u0437\u0435 Icinga2 \u0438 Puppet<\/h1>\n<p>  <\/p>\n<h3>\u041f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u2026 Infrastructure as code (IaC).<\/h3>\n<p>  \u041d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 \u043f\u0440\u043e Icinga2, \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0436\u0435 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0440\u043e Puppet:<\/p>\n<p>  <a href=\"https:\/\/habr.com\/post\/326450\/\">Icinga2 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442<\/a><br \/>  <a href=\"https:\/\/habr.com\/post\/307358\/\">\u041f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u043c \u043c\u0438\u043a\u0440\u043e\u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 \u043d\u0430 icinga2 \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0437\u0430\u0442\u0440\u0430\u0442\u0430\u043c\u0438<\/a><br \/>  <a href=\"https:\/\/habr.com\/post\/229867\/\">\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<\/a><\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u0442\u0435\u043c\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u043f\u043e\u0442\u0440\u044f\u0441\u0430\u044e\u0449\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0430.<br \/>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435, \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043d\u0430 \u00ab\u0436\u0438\u0432\u043e\u043c\u00bb \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e, \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0432 \u044d\u0442\u0438 \u0434\u0432\u0435 <br \/>  \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0432\u0430\u0448\u0435\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0441\u043e \u0432\u0441\u0435\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0421\u0442\u0430\u0442\u044c\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u0440\u043e\u0434\u0430 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e\u043c \u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044e \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 \u00ab\u0432\u0441\u0435 \u0432 \u043e\u0434\u043d\u043e\u043c \u0444\u043b\u0430\u043a\u043e\u043d\u0435\u00bb. \u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u0443 \u0432\u0430\u0441 \u0432 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0440\u0430\u0431\u043e\u0447\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u00ab\u0434\u043e\u043f\u0438\u043b\u0438\u0432\u0430\u0442\u044c\u00bb \u043f\u043e\u0434 \u0441\u0435\u0431\u044f. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c!<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h1>\u0418\u0442\u0430\u043a:<\/h1>\n<p>  <\/p>\n<h2>\u041c\u044b \u043f\u043e\u0434\u043d\u044f\u043b\u0438 \u043d\u043e\u0432\u044b\u0439 \u0445\u043e\u0441\u0442. \u0418 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e:<\/h2>\n<p>  <\/p>\n<h2>1. \u0427\u0442\u043e\u0431\u044b \u0435\u0433\u043e \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0432 Icinga2, \u0438 \u0441\u043e\u0437\u0434\u0430\u043b\u0438\u0441\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438:<\/h2>\n<p>  <\/p>\n<table>\n<tr>\n<td> <font color=\"#337788\"><b>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0438<\/b><\/font>   <\/td>\n<td> <font color=\"#337788\"><b>\u0421\u043d\u0438\u043c\u043a\u0438<\/b><\/font>   <\/td>\n<td> <font color=\"#337788\"><b>\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f<\/b><\/font>   <\/td>\n<\/tr>\n<tr>\n<td> <font color=\"#337788\"> <b>Host<\/b><br \/>   <\/font>   <\/td>\n<td> <a href=\"https:\/\/habrastorage.org\/webt\/yg\/ur\/_6\/ygur_6ovuboc_fsseywgtabr0uc.png\"> <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/kj\/3z\/hj\/kj3zhjnnftl0e_bymn0ffsp-cps.png\"><br \/>   <\/a>   <\/td>\n<td> \u0421 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 ping, \u0447\u0442\u043e \u0445\u043e\u0441\u0442 \u00ab\u0436\u0438\u0432\u043e\u0439\u00bb.   <\/td>\n<\/tr>\n<tr>\n<td> <font color=\"#337788\"> <b>Disk usage<\/b><br \/>   <\/font>   <\/td>\n<td> <a href=\"https:\/\/habrastorage.org\/webt\/yr\/bx\/am\/yrbxam59vus0gnrtgjvetndcyjq.png\"> <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/_k\/od\/6-\/_kod6-txtpme2ygoeq_y5ixhpga.png\"><br \/>   <\/a>   <\/td>\n<td>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430 \u043d\u0430 \u0434\u0438\u0441\u043a\u0430\u0445.<\/td>\n<\/tr>\n<tr>\n<td> <font color=\"#337788\"> <b>Load average<\/b><br \/>   <\/font>   <\/td>\n<td> <a href=\"https:\/\/habrastorage.org\/webt\/ge\/-d\/jt\/ge-djtzrnr55rze_6iv-x1-gdv8.png\"> <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ts\/4x\/nm\/ts4xnmllobanjgmtc-nzlgp5o2i.png\"><br \/>   <\/a>   <\/td>\n<td>\u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043c \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438. \u0423\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432 \u043d\u0430 \u043d\u0451\u043c.<\/td>\n<\/tr>\n<tr>\n<td> <font color=\"#337788\"> <b>Free memory<\/b><br \/>   <\/font>    <\/td>\n<td> <a href=\"https:\/\/habrastorage.org\/webt\/xd\/ej\/1e\/xdej1ed3ikbp0ovambgmk19vljq.png\"> <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/m0\/c_\/7k\/m0c_7kx6vpz7x6lmdyzhs1nxqgw.png\"><br \/>   <\/a>   <\/td>\n<td>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435.<\/td>\n<\/tr>\n<tr>\n<td> <font color=\"#337788\"> <b>Open ports<\/b><br \/>   <\/font>   <\/td>\n<td> <a href=\"https:\/\/habrastorage.org\/webt\/bj\/nc\/vp\/bjncvp1uxpsl3h4wumsjbdvbwnu.png\"> <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/qe\/ww\/d6\/qewwd6qbleu9rokn11av0bbesge.png\"><br \/>   <\/a>   <\/td>\n<td>\u0421\u043a\u0430\u043d\u0438\u0440\u0443\u0435\u043c \u043f\u043e\u0440\u0442\u044b \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043a\u0430\u0440\u0442\u0443 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u043f\u043e\u0440\u0442\u043e\u0432. \u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043d\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u043e\u0432\u044b\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0435 \u0438\u043b\u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u044b\u0435 \u043f\u043e\u0440\u0442\u044b.<\/td>\n<\/tr>\n<tr>\n<td> <font color=\"#337788\"> <b>Critical updates<\/b><br \/>   <\/font>   <\/td>\n<td> <a href=\"https:\/\/habrastorage.org\/webt\/pk\/az\/j6\/pkazj6f1bjpckvw1rkadnpouvjk.png\"> <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ac\/in\/y5\/aciny5yddcavhdjfrfjxitrn4fo.png\"><br \/>   <\/a>   <\/td>\n<td>\u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435.<\/td>\n<\/tr>\n<\/table>\n<h2> 2. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0432 \u0443\u0434\u043e\u0431\u043d\u043e\u043c \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u043c \u0432\u0438\u0434\u0435. \u0427\u0442\u043e \u0431\u044b \u043f\u043e\u0442\u043e\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0443 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u043c\u044b \u043c\u043e\u043b\u043e\u0434\u0446\u044b \u0438 \u043f\u0440\u0435\u043c\u0438\u044e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c! <br \/>  <\/h2>\n<p>  \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b:  <\/p>\n<table>\n<tr>\n<th> <font color=\"#337788\"><b>\u0421\u0435\u0440\u0432\u0438\u0441<\/b><\/font>   <\/th>\n<th> <font color=\"#337788\"><b>YAML-\u043a\u043e\u0434 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438<\/b><\/font>   <\/th>\n<\/tr>\n<tr>\n<td> <font color=\"#337788\"> <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Virtual host<\/b><\/p>\n<div class=\"spoiler_text\"> \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u00ab\u0436\u0438\u0432\u043e\u0439\u00bb \u0445\u043e\u0441\u0442 \u0438\u043b\u0438 \u043d\u0435\u0442.   <\/div>\n<\/div>\n<p>   <\/font><br \/>   <a href=\"https:\/\/habrastorage.org\/webt\/h-\/kk\/fc\/h-kkfch6gbf9sry882aqqotr7qe.png\"> <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/fa\/q_\/8m\/faq_8muc2rwor0d9jp4ywh86qe8.png\"><br \/>   <\/a>    <\/td>\n<td>\n<pre><code>    '%{::fqdn} virtual host' :         target: \/etc\/icinga2\/zones.d\/master\/%{::fqdn}.conf         apply: true         assign: [ 'host.name == %{::fqdn}' ]         display_name: '%{::fqdn} virtualhost'         check_command: 'http'         vars:             http_uri: \/             http_ssl: true             http_vhost: 'hostname'             http_address: \"%{lookup('host_address')}\"     <\/code><\/pre>\n<p>   <\/td>\n<\/tr>\n<tr>\n<td> <font color=\"#337788\"> <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">PostgreSQL<\/b><\/p>\n<div class=\"spoiler_text\"> \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0447\u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c\u0441\u044f \u0441 \u0411\u0414 PostgreSQL.   <\/div>\n<\/div>\n<p>   <\/font><br \/>   <a href=\"https:\/\/habrastorage.org\/webt\/6r\/uj\/f8\/6rujf81kgogbtwzm8q3b7axkea8.png\"> <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ct\/c2\/wz\/ctc2wzluely2l7lsbkxwx5du8i4.png\"><br \/>   <\/a>    <\/td>\n<td>\n<pre><code>    '%{::fqdn} PostgreSQL':         target: \/etc\/icinga2\/zones.d\/master\/%{::fqdn}.conf         apply: true         assign: [ 'host.name == %{::fqdn}' ]         display_name: 'PostgreSQL'         command_endpoint: '%{::fqdn}'         check_command: \"postgres\"         vars:             postgres_host: \"localhost\"             postgres_action: \"connection\"             phone_notifications: true     <\/code><\/pre>\n<p>   <\/td>\n<\/tr>\n<tr>\n<td> <font color=\"#337788\"> <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Nginx Status<\/b><\/p>\n<div class=\"spoiler_text\"> \u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043c \u0441\u0442\u0430\u0442\u0443\u0441 Nginx \u0447\u0435\u0440\u0435\u0437 stub_status.   <\/div>\n<\/div>\n<p>   <\/font><br \/>   <a href=\"https:\/\/habrastorage.org\/webt\/0v\/lm\/bb\/0vlmbbhhwqgrnnpfu_it1p7ysuq.png\"> <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ht\/el\/a9\/htela9efivyadlyw4vuxdouiqbk.png\"><br \/>   <\/a>    <\/td>\n<td>\n<pre><code>    '%{::fqdn} nginx status' :         target: \/etc\/icinga2\/zones.d\/master\/%{::fqdn}.conf         apply: true         assign: [ 'host.name == %{::fqdn}' ]         command_endpoint: '%{::fqdn}'         display_name: 'nginx status'         check_command: 'nginx_status'         vars:             nginx_status_host_address: localhost             nginx_status_servername: server.com             nginx_status_critical: '1600,60,30'             nginx_status_warn: '1500,55,25'     <\/code><\/pre>\n<p>   <\/td>\n<\/tr>\n<\/table>\n<p>  <\/p>\n<h2> 3. \u0427\u0442\u043e\u0431\u044b \u0432\u0441\u0451 \u0431\u044b\u043b\u043e \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e, \u043d\u0430\u0434\u0451\u0436\u043d\u043e \u0438 \u043a\u0440\u0430\u0441\u0438\u0432\u043e. \u0418 \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u0442\u044c \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 30 \u043c\u0438\u043d\u0443\u0442 \u043d\u0430 \u0432\u043e\u0437\u043d\u044e \u0441 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439. <br \/>  <\/h2>\n<p>  <i> \u0423 \u0432\u0430\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043e\u043f\u044b\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Docker&#8217;\u043e\u043c, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0438 \u0441 Linux \u2014 \u0441\u0430\u043c\u043e \u0441\u043e\u0431\u043e\u0439.<\/p>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u0442\u0430\u043f \u043e\u043f\u0438\u0441\u0430\u043d \u043f\u043e\u0434 Debian\/Ubuntu. \u0418, \u0445\u043e\u0442\u044f \u044f \u043d\u0435 \u0432\u0438\u0436\u0443 \u043f\u0440\u0438\u0447\u0438\u043d \u0435\u043c\u0443 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 Unix-\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445, \u0441\u0430\u043c \u044f \u0442\u0430\u043a\u0438\u0445 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0439 \u0434\u0430\u0442\u044c \u043d\u0435 \u043c\u043e\u0433\u0443. \u0423 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u043f\u0430\u0440\u0430 \u043c\u0430\u0448\u0438\u043d \u0441 CentOS, \u0442\u0430\u043c \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e, \u0432\u0441\u0451 \u0436\u0435 \u2014 \u044d\u0442\u043e Debian\/Ubuntu.<br \/>  <\/i>  <\/p>\n<h2>\u041d\u0430\u0447\u043d\u0451\u043c<\/h2>\n<p>  \u0421\u043a\u0430\u0436\u0443 \u0441\u0440\u0430\u0437\u0443, \u043c\u043d\u0435 \u0443\u0434\u043e\u0431\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0445\u043e\u0441\u0442\u0430 \u2014 \u0441\u0435\u0440\u0432\u0438\u0441\u044b, \u043a\u043e\u043d\u0444\u0438\u0433\u0438, \u0441\u043e\u0444\u0442, \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u044b \u0438 \u0442.\u043f. \u2014 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0434\u043d\u0438\u043c yaml-\u0444\u0430\u0439\u043b\u043e\u043c, \u044d\u0442\u043e \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0438 \u0434\u0430\u0451\u0442 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438. \u041e\u0442\u043a\u0440\u044b\u043b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 git-\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438, \u0433\u0434\u0435 \u0438\u043c\u0435\u043d\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0438\u043c\u0435\u043d\u0438 \u0445\u043e\u0441\u0442\u0430, \u0437\u0430\u0442\u0435\u043c \u043e\u0442\u043a\u0440\u044b\u043b \u043a\u043e\u043d\u0444\u0438\u0433 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430. \u0418 \u0441\u0440\u0430\u0437\u0443 \u0432\u0438\u0434\u043d\u043e, \u043a\u0430\u043a\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0435\u0441\u0442\u044c \u043d\u0430 \u0445\u043e\u0441\u0442\u0435, \u0447\u0442\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0431\u044d\u043a\u0430\u043f\u0438\u0442\u0441\u044f, \u0447\u0442\u043e \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u0442\u0441\u044f \u0438 \u0442.\u0434. <\/p>\n<p>  <b>\u0412\u043e\u0442 \u0442\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438:<\/b><\/p>\n<pre><code>project_1\/hostname1.com.yaml project_2\/hostname2.com.yaml project_3\/hostname3.com.yaml <\/code><\/pre>\n<p>  \u0423 \u0441\u0435\u0431\u044f \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0448\u0430\u0431\u043b\u043e\u043d, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043b\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code> #============================|INPUT DATA|=================================# #---------------------------------------|VARS|----------------------------# #---\/\/Information about variables, keys &amp; contacts\/\/----------------------#  host_address: x.x.x.x my_company:  my_mail_domain:  my_ssh_port:     #---------------------------------------|CLASSES|-------------------------# #---\/\/Classes are modules installed on the server.\/\/----------------------# #---\/\/These modules process the arguments typed below.\/\/------------------# #---\/\/Without classes nothing will work.\/\/--------------------------------# #---\/\/Class default_role is mandatory. This class will install\/\/----------# #---\/\/etckeeper, some required perl modules and manages all the logics.\/\/-#  classes:   - default_role  #---------------------------------------|TIMEZONE|------------------------# #---\/\/Set timezone, which will be used on the host.\/\/---------------------#  timezone::timezone: Europe\/Moscow  #---------------------------------------|FACTS|---------------------------# #---\/\/Facts are variables which puppet agent uses.\/\/----------------------#  facter::facts_hash:  role:    value: 'name'  company:    value: 'name of company'    file: 'location.txt' #=========================================================================#  #============================|PUPPET|=====================================# #---\/\/Settings for puppet agent.\/\/----------------------------------------#  puppet::runmode: cron puppet::ca_server: \"%{lookup('puppet_ca')}\"  puppet::puppetmaster: \"%{lookup('puppet_master')}\" #=========================================================================#   #============================|CRON TASKS|=================================#  cron_tasks:     Name:         command: \"\"         user:          minute: ''         hour: ''     #=========================================================================#  #============================|SUPERVISOR|=================================# #---\/\/Supervisor is a process manager\/\/-----------------------------------#  supervisord::install_pip: false supervisord::install_init: false supervisord::service_name: supervisor supervisord::package_provider: apt supervisord::executable: \/usr\/bin\/supervisord supervisord::executable_ctl: \/usr\/bin\/supervisorctl supervisord::config_file: \/etc\/supervisor\/supervisord.conf supervisord::programs:   'name':     ensure: present     command: 'su - rails -c \"\/home\/name\/s2\"'     autostart: no     autorestart: 'false'     directory: \/home\/name\/domainName\/current  #=========================================================================#   #============================|SECURITY|===================================# #-------------------------------------|FIREWALL|--------------------------# #---\/\/Iptables rules\/\/----------------------------------------------------#  firewall:     096 Allow inbound SSH:       dport: \"%{lookup('my_ssh_port')}\"       proto: tcp       action: accept  #-------------------------------------|FAIL2BAN|--------------------------#   #-------------------------------------|ACCESS|----------------------------# #--------------------------------------------|ACCOUNTS|-------------------# #---\/\/Discription of accounts which will be created on server.\/\/----------#  accounts:     user:         shell: '\/bin\/bash'         password: ''         locked: false         purge_sshkeys: true          groups:             - docker         sshkeys:             - \"%{alias('admins_ssh_keys')}\"     #--------------------------------------------|SUDO|-----------------------# #---\/\/Appointment permissions for users.\/\/--------------------------------#  sudo::config_file_replace: false sudo::configs:     user:         content: \"user ALL=(ALL) NOPASSWD: ALL\"      #--------------------------------------------|SSH|------------------------# #--------\/\/Settings for ssh server.\/\/-------------------------------------#  ssh::storeconfigs_enabled: true ssh::server_options:     Protocol: '2'     Port: \"%{lookup('my_ssh_port')}\"     PasswordAuthentication: 'yes'     PermitRootLogin: 'without-password'     SyslogFacility: 'AUTHPRIV'     UsePAM: 'yes'     X11Forwarding: 'no'  #--------------------------------------------|VPN|------------------------# #---\/\/Settings for vpn server.\/\/------------------------------------------#  openvpn::servers:   'namehost':     country: ''     province: ''     city: ''     organization: ''     email: ''     server: 'x.x.x.x 255.255.255.0'     dev: tun     local: \"%{lookup('host_address')}\"  openvpn::client_defaults:   server: 'namehost'  openvpn::clients:   # Firstname Lastname   'user': {}  openvpn::client_specific_configs:   'user':     server: 'namehost'     redirect_gateway: true     route:     - x.x.x.x 255.255.255.255  #=========================================================================#   #============================|OPERATING SYSTEM|===========================# #---------------------------------------------|SYSCTL|--------------------# #---\/\/set sysctl parameters\/\/---------------------------------------------#  sysctl::base::values:   fs.file-max:     value: '2097152000'   net.netfilter.nf_conntrack_max:     value: '1048576'   net.nf_conntrack_max:     value: '1048576'   net.ipv6.conf.all.disable_ipv6:     value: '1'   vm.oom_kill_allocating_task:     value: '1'       net.ipv4.ip_forward:     value: '0'   net.ipv4.tcp_keepalive_time:      value: '3'   net.ipv4.tcp_keepalive_intvl:     value: '60'   net.ipv4.tcp_keepalive_probes:     value: '9'      #---------------------------------------------|RCS|-----------------------# #---\/\/Managment of RC scenario\/\/------------------------------------------#  rcs::tmptime: '-1'  #---------------------------------------------|WEB SERVERS|---------------# #---------------------------------------------------------|HAPROXY|-------# #---\/\/HAProxy is software that provides a high availability load\/\/--------# #---\/\/balancer and proxy server for TCP and HTTP-based applications\/\/-----#  #---\/\/ that spreads requests across multiple servers.\/\/-------------------#  haproxy::merge_options: true haproxy::defaults_options:     log: global     maxconn: 20000     option: [         'tcplog',         'redispatch',         'dontlognull'     ]     retries: 3     stats: enable     timeout: [         'http-request 10s',         'queue 1m',         'check 10s',         'connect 300000000ms',         'client 300000000ms',         'server 300000000ms'     ]  haproxy_server:   stats:     ipaddress: \"%{lookup('host_address')}\"     ports: '9090'     options:       mode: 'http'       stats: [ 'uri \/', 'auth puppet:123123123' ]    postgres:     collect_exported: false     ipaddress: '0.0.0.0'     ports: '5432'      options:         option:             - tcplog         balance: roundrobin haproxy_balancemember:   hostname1:     listening_service: postgres     server_names: hostname1     ipaddresses: \"%{lookup('host1_ip')}\"     ports: 6432     options: check   hostname2:     listening_service: postgres     server_names: hostname2     ipaddresses: \"%{lookup('host2_ip')}\"     ports: 6432     options:         - check         - backup          #---------------------------------------------|NGINX|---------------------# #---\/\/Nginx is a web server which can also be used as a reverse proxy,\/\/--# #---\/\/load balancer, mail proxy and HTTP cache\/\/--------------------------#   nginx::nginx_cfg_prepend:   'load_module':       - modules\/ngx_http_geoip_module.so nginx::http_raw_append:   - 'real_ip_header X-Forwarded-For;'   - 'geoip_country \/usr\/share\/GeoIP\/GeoIP.dat;'   - 'set_real_ip_from 0.0.0.0\/0;' nginx::worker_rlimit_nofile: 16384 nginx::confd: true nginx::server_purrge: true nginx::server::maintenance: true    #---------------------------------------------nginx-|MAPS|----------------#  nginx::string_mappings:   allowed_country:     ensure: present     string: '$geoip_country_code'     mappings:       - key: 'default'         value: 'yes'       - key: 'US'         value: 'no'  #---------------------------------------------nginx-|UPSTREAMS|-----------# nginx::nginx_upstreams:   \"upstreamName\":     ensure: present     members:       - \"localhost:9999\" #---------------------------------------------nginx-|VHOSTS|--------------# nginx::nginx_servers:    'hostname':     proxy: 'http:\/\/'     location_raw_append:         - 'if ($allowed_country = no) {return 403;}'     try_files:     - ''     - \/index.html     - =404     ssl: true     ssl_cert: \"\/etc\/letsencrypt\/live\/hostname\/fullchain.pem\"     ssl_key: \"\/etc\/letsencrypt\/live\/hostname\/privkey.pem\"     ssl_trusted_cert: \"\/etc\/letsencrypt\/live\/hostname\/chain.pem\"     ssl_redirect: false     ssl_port: 443     error_pages:       '403': \/usa-restrict.html  #---------------------------------------------nginx-|HTTPAUTH|------------#  httpauth:   'admin':     file: \"\/etc\/nginx\/htaccess\"     password: ''     realm: realm     mechanism: basic     ensure: present  #---------------------------------------------nginx-|LOCATIONS|-----------#  nginx::nginx_locations:   'domain1.com\/usa-restricted':     location: \/usa-restrict.html     www_root: \/home\/clientName1\/clientName1-client-release\/current\/dist     server: domain1.com     ssl: true   '^~ domain2.com\/resources\/upload\/':     location: '^~ \/resources\/upload\/'     server: domain2.com     location_alias: '\/home\/clientName2\/upload\/'     raw_append:         - 'if ($allowed_country = no) {return 403;}'   '\/nginx_status-domain3.com':     location: \/nginx_status     stub_status: on     raw_append:         - access_log off;         - allow 127.0.0.1;         - deny all;        #---------------------------------------------nginx-|WELL-KNOWN|----------# #---\/\/These locations are needed for SSL certificates generating\/\/--------# #---\/\/with Letsencrypt.\/\/-------------------------------------------------#    'x.hostname.zz\/.well-known':     location: '\/.well-known'     server: x.hostname.zz     proxy: 'http:\/\/kibana'      auth_basic: \"ciao\"     auth_basic_user_file: \"\/etc\/nginx\/htaccess     www_root: \/var\/www\/html     ssl: true   'hostname.zz\/~* \\.(?:ico|css|js|html|map|gif|jpg|png|svg|ttf|woff|appcache|pdf)$':     location: '~* \\.(?:ico|css|js|html|map|gif|jpg|png|svg|ttf|woff|appcache|pdf)$'     www_root: '\/home\/hostname\/hostname-client-release\/current\/dist'     expires: max     raw_append:     - \"add_header Pragma public;\"     - 'add_header Cache-Control \"public, must-revalidate, proxy-revalidate\";'      #---------------------------------------------------|NGINS STATUS|--------#  #----------------------------|LETSENCRYPT|--------------------------------# #---\/\/Let's Encrypt is a certificate authority that provides #---\/\/free X.509 certificates for Transport Layer Security (TLS)\/\/--------# #---\/\/encryption via an automated process designed to eliminate\/\/---------# #---\/\/the hitherto complex process of manual creation, validation,\/\/------# #---\/\/signing, installation, and renewal of certificates\/\/----------------# #---\/\/for secure websites.\/\/----------------------------------------------#  letsencrypt::email: client@mail.com letsencrypt_certonly:     hostname:         manage_cron: true         domains:             - hostname         plugin: webroot         webroot_paths:             - '\/var\/www\/html'  #----------------------------|FILE SERVERS|-------------------------------# #-----------------------------------------|FILES|-------------------------# #---\/\/Creating files &amp; folders on the server.\/\/---------------------------#  file:     \"\/home\/hostname\/hostname-release\/shared\/ecosystem.config.js\":         ensure: present         owner: hostname         content: |             module.exports = {               \/**                * Application configuration section                * http:\/\/pm2.keymetrics.io\/docs\/usage\/application-declaration\/                *\/               apps : [                 \/\/ First application                 {                   name      : 'api',                   script    : '\/home\/hostname\/hostname-release\/current\/dist\/index.js',                   cwd       : '\/home\/hostname\/hostname-release\/current\/dist\/',                   watch     : false,                   ignore_watch : [\"logs\"],                   \"log_type\": \"format\",                   env: {                     COMMON_VARIABLE: 'true'                   },                   env_production : {                     NODE_ENV: 'production',                     PORT: 9999,                     DEBUG   : '*'                   },                   env_development : {                     NODE_ENV: 'development',                     PORT: 9999,                     DEBUG   : '*'                   }                 },                 \/\/ Second application                 {                   name      : 'WEB',                   script    : 'web.js'                 }               ],               \/**                * Deployment section                * http:\/\/pm2.keymetrics.io\/docs\/usage\/deployment\/                *\/               deploy : {                 production : {                   user : 'node',                   host : '0.0.0.0',                   ref  : 'origin\/master',                   repo : 'name@name.com:repo.git',                   path : '\/var\/www\/production',                   'post-deploy' : 'npm install &amp;&amp; pm2 reload ecosystem.config.js --env production'                 },                 dev : {                   user : 'node',                   host : '0.0.0.0',                   ref  : 'origin\/master',                   repo : 'name@name.com:repo.git',                   path : '\/var\/www\/development',                   'post-deploy' : 'npm install &amp;&amp; pm2 reload ecosystem.config.js --env dev',                   env  : {                     NODE_ENV: 'dev'                   }                 }               }             };  #-----------------------------------------|FTP|----------------------------# #---\/\/Very Secure FTP Daemon is an FTP server for Unix-like systems.\/\/-----#  vsftpd::ftpd_banner: 'ASCII FTP Server' vsftpd::anonymous_enable: 'NO' vsftpd::write_enable: 'YES' vsftpd::chroot_local_user: 'YES' vsftpd::allow_writeable_chroot: 'YES' vsftpd::userlist_enable: 'YES' vsftpd::userlist_deny: 'NO'  #-----------------------------------------|NFS|---------------------------# #---\/\/Network File System is a distributed file system protocol,\/\/--------# #---\/\/allowing a user on a client computer to access files over\/\/---------#  #---\/\/a computer network much like local storage is accessed.\/\/-----------#  nfs::server_enabled: true nfs::client_enabled :  false nfs::nfs_v4:  true nfs::nfs_v4_idmap_domain:  \"%{::domain}\" nfs::nfs_v4_export_root:  '\/share' nfs::nfs_v4_export_root_clients:  \"%{lookup('host_address')}\/32(rw,fsid=root,insecure,no_subtree_check,async,no_root_squash)\" nfs::nfs_exports_global:   \/var\/www: {}   \/var\/smb: {}  #----------------------------|PACKAGES|-----------------------------------# #---\/\/Install of packages to server.\/\/------------------------------------#  packages:     namePackage:         ensure: installed  #-------------------------------------|APT|-------------------------------# #---\/\/Management of repository of packages.\/\/---#  apt::sources:   'debian_unstable':     comment: 'This is the iWeb Debian unstable mirror'     location: 'http:\/\/debian.mirror.iweb.ca\/debian\/'     release: 'unstable'     repos: 'main contrib non-free'     pin: '-10'     key:       id: 'IDIDIDIDIDIDIDIDIDIDIDIDIDIDIDID'       server: 'subkeys.pgp.net'     include:       src: true       deb: true   'puppetlabs':     location: 'http:\/\/apt.puppetlabs.com'     repos: 'main'     key:       id: 'IDIDIDIDIDIDIDIDIDIDIDIDIDIDIDID'       server: 'pgp.mit.edu'   #-------------------------------------|PHP|-------------------------------#  php_pool:   myadmin:    listen: 'x.x.x.x:x'  #-------------------------------------|RVM|-------------------------------# #---\/\/Ruby Version Manager  is a unix-like software platform designed\/\/---# #---\/\/to manage multiple installations of Ruby on the same device.\/\/------#  rvm_ruby:   user1_rvm:     user: user1     version: ruby-2.5.1 white_label_platform: default  #-------------------------------------|PYTHON|----------------------------#  python::version: system python::dev: present python::virtualenv: true  #----------------------------|NODEJS|-------------------------------------# #-----------------------------------|NVM|---------------------------------# #---\/\/Node Version Manager for Node.js\/\/----------------------------------# #---\/\/Node.js lets developers use JavaScript to write Command Line\/\/------# #---\/\/tools and for server-side scripting\u2014running scripts server-side\/\/---# #---\/\/to produce dynamic web page content before the page is sent\/\/-------# #---\/\/to the user's web browser.\/\/----------------------------------------#  nodejs::repo_url_suffix: '8.x' nvm::user: name nvm::install_node: 8.10.0  #----------------------------|DOCKER|-------------------------------------# #---\/\/Docker's management\/\/-----------------------------------------------#   docker::run_instance::instance:   nats:     image: 'nats'     extra_parameters: '-p 8222:8222 -p 4222:4222 -p 6222:6222 --name nats --network admin_default' docker::compose::ensure: present docker_compose:     \/etc\/admin\/gitlab\/docker-compose.yaml:         ensure: present docker::iptables: false docker::tcp_bind: tcp:\/\/0.0.0.0:2375   docker::compose::ensure: present docker_swarm:     'agent':         ensure: present         join: true         advertise_addr: '%{::ipaddress_enp2s0}'         listen_addr: '%{::ipaddress_enp2s0}'         manager_ip: '%{lookup(\"host_address\")}'         token: ''   docker_registry:     'host.com:5000':        username: ''       password: ''       email: 'mail@mail.com'  #=========================================================================#   #============================|BACKUPS UPDATES|============================# #--------------------------------------------|UPDATES|--------------------# #---\/\/Unattended upgrades is the linux-like mechanism\/\/-------------------# #---\/\/automatic updates.\/\/------------------------------------------------#  unattended_upgrades::origins:     - \"o=Debian,n=${distro_codename}\"     - \"o=Debian,n=${distro_codename}-security\"     - \"o=Debian,n=${distro_codename}-updates\"     - \"o=Debian,n=${distro_codename}-proposed\"     - \"o=Debian,n=${distro_codename}-backports\"     - \"o=debian icinga,n=icinga-${distro_codename}\"     - \"o=Zabbix,n=${distro_codename}\"  #--------------------------------------------|BACKUPS|--------------------# #---\/\/The backups are processed by gembackup.\/\/---------------------------#  backup_jobs:     #Creates full backup     type_files:         types: ['archive']         add:             - '\/path'         storage_type: 'ftp'         storage_host: \"%{lookup('my_ftp_hostname')}\"         path: '\/files\/'         storage_username: \"%{lookup('my_backup_ftp_username')}\"         storage_password: \"%{lookup('my_backup_ftp_password')}\"         compressor: \"%{lookup('my_backup_compressor')}\"         keep: 7         weekday: [1-7]         hour: 0         minute: 0  #--------------------------------------------|MOUNT|----------------------# #---\/\/\u0421ontrol the mounting of remote &amp; local mount points.\/\/--------------#  mount:     #Mount folder from other server to keep backups     \"\/tmp\/mediastagetv_netbynet\":         device: \"%{lookup('host_address')}:\/\"         ensure: mounted         fstype: nfs4         options: defaults         atboot: false  #--------------------------------------------|S3 AMAZON|------------------# #---\/\/Simple Storage Service is a cloud computing web service.\/\/----------#  hostname1-archives: '\/home\/hostname1\/hostname1\/shared\/log_amazon' hostname2-archives: '\/home\/hostname2\/hostname2\/shared\/log_amazon' yas3fs::mounts:   #=========================================================================#   #============================|MONITORING|=================================# #---------------------------------------|ICINGA SERVICES|-----------------# #---\/\/Managment of monitoring system.\/\/-----------------------------------#  icinga2_service:         '%{::fqdn} virtual host' :         target: \/etc\/icinga2\/zones.d\/master\/%{::fqdn}.conf         apply: true         assign: [ 'host.name == %{::fqdn}' ]         display_name: '%{::fqdn} virtualhost'         check_command: 'http'         vars:             http_uri: \/             http_ssl: true             http_vhost: 'hostname'             http_address: \"%{lookup('host_address')}\"          '%{::fqdn} nginx status' :         target: \/etc\/icinga2\/zones.d\/master\/%{::fqdn}.conf         apply: true         assign: [ 'host.name == %{::fqdn}' ]         command_endpoint: '%{::fqdn}'         display_name: 'nginx status'         check_command: 'nginx_status'         vars:             nginx_status_host_address: localhost             nginx_status_servername: server.com             nginx_status_critical: '1600,60,30'             nginx_status_warn: '1500,55,25'          '%{::fqdn} redis':         target: \/etc\/icinga2\/zones.d\/master\/%{::fqdn}.conf         apply: true         assign: [ 'host.name == %{::fqdn}' ]         display_name: 'Redis'         command_endpoint: '%{::fqdn}'         check_command: \"redis\"         vars:             redis_hostname: localhost             redis_port: 6379             redis_perfvars: '*'  #=========================================================================#   #============================|MAIL &amp; LOGS|================================# #----------------------------------------|MAIL|---------------------------# #---------------------------------------------|POSTFIX|-------------------# #---\/\/Management of mail-server Postfix.\/\/--------------------------------#  postfix::manage_conffiles: false postfix_config:     relayhost:         ensure: present         value: \"%{lookup('host_address')}\"     virtual_maps:         value: hash:\/etc\/postfix\/virtual         ensure: present     sender_canonical_map:         value: hash:\/etc\/postfix\/canonical_sender         ensure: present postfix_hash:     '\/etc\/postfix\/virtual':         ensure: present         content: |           root %{lookup('hostname_admin_emails')}           rails %{lookup('hostname_emails')}     '\/etc\/postfix\/canonical_sender':         ensure: present         content: |             name@%{lookup('my_domain')} name@my_domain.com             root@%{lookup('my_domain')} root@my_domain.com  #----------------------------------------|LOGS|---------------------------# #---------------------------------------------|RSYSLOG|-------------------# #---\/\/Rsyslog is a software utility for forwarding log messages\/\/---------# #---\/\/in an IP network. It implements the basic syslog protocol,\/\/--------# #---\/\/extends it with content-based filtering, rich filtering\/\/-----------# #---\/\/capabilities, flexible configuration options and adds features\/\/----# #---\/\/such as using TCP for transport.\/\/----------------------------------#  rsyslog::client:   log_local: true  my_rsyslog_snippet:   99_everything:     content: \"*.*;auth,authpriv.none \/var\/log\/syslog\\n\"   01_mail:     content: \"mail.*  -\/var\/log\/mail.log\\n&amp; stop\"   02_auth:     content: \"auth,authpriv.* \/var\/log\/auth\\n&amp; stop\"   03_puppetagent:     content: \":programname,contains,\\\"puppet-agent\\\" \/var\/log\/puppetlabs\/puppet\/puppet-agent.log\\n&amp; stop\"   04_iptables:     content: \":msg,contains,\\\"IPTABLES INPUT\\\" \/var\/log\/iptables\/iptables.log\\n&amp; stop\"   05_pam_unix:     content: \":msg,regex,\\\".*session opened for.*(uid=0)\\\" \/var\/log\/admin\/auth.log\\n&amp; stop\"   06_sshd:     content: \":msg,regex,\\\".*publickey for username.*0.0.0.0\\\" \/var\/log\/admin\/auth.log\\n&amp; stop  #---------------------------------------------|LOGWATCH|------------------# #---\/\/Logwatch is a log-analysator for create short reports.\/\/------------#  logwatch::format: text logwatch::service:     # Ignore this servie     - -http     - -iptables  #---------------------------------------------|LOGROTATE|-----------------# #---\/\/Management of rotation of log files.\/\/------------------------------#  my_rclogs_path: '\/home\/hostname\/hostname\/shared\/log' my_rclogs_amazon_path: '\/home\/hostname1\/hostname1\/shared\/log_amazon' my_ttlogs_path: '\/home\/hostname2\/hostname2\/shared\/log' my_ttlogs_amazon_path: '\/home\/hostname\/hostname\/shared\/log_amazon' logrotate::ensure: latest logrotate::config:   dateext: true   compress: true logrotate::rules:   booking-logs:     path: '%{lookup(\"my_rclogs_path\")}\/booking_com.log'     size: 2500M     rotate: 20     copytruncate: true     delaycompress: true     dateext: true     dateformat: -%Y%m%d-%s     compress: true     postrotate: mv %{lookup('my_rclogs_path')}\/booking_com.log*.gz %{lookup('my_rclogs_amazon_path')}\/  #---------------------------------------------|ATOP|----------------------# #---\/\/ATOP service displays a new information about CPU\/\/-----------------# #---\/\/and memory utilization.\/\/-------------------------------------------#  atop::service: true atop::interval: 30  #----------------------------------------|DNS|----------------------------# #---\/\/Management of file \/etc\/resolv.conf\/\/-------------------------------#  resolv_conf::nameservers:     - 0.0.0.0     - 0.0.0.0  #=========================================================================#   #============================|DATABASES|==================================# #--------------------------------------|MYSQL|----------------------------# #---\/\/MySQL is a relational database management system.\/\/-----------------#  mysql::server::package_ensure: 'installed' #\u00b7 mysql::server::root_password: \"ooy5ieneePahnei\" mysql::server::manage_config_file: true mysql::server::service_name: 'mysql' # required for puppet module mysql::server::override_options:   'mysqld':     'bind-address': '*'          \"userName\": \"\",         \"password\": \"\",         \"databaseName\": \"\",  mysql::server::db:   \"hostname\":     user: \"\"     password: \"\"     host: \"%\"     grant:       - \"ALL\"  #-------------------------------------|ELASTICSEARCH|---------------------# #---\/\/Elasticsearch is a search engine based on Lucene.\/\/-----------------# #---\/\/It provides a distributed, multitenant-capable full-text search\/\/---# #---\/\/engine with an HTTP web interface and schema-free JSON documents.\/\/-#  elasticsearch::version: 5.5.1 elasticsearch::manage_repo: true elasticsearch::repo_version: 5.x elasticsearch::java_install: false elasticsearch::restart_on_change: true elasticsearch_instance:     'es-01':       ensure:  'present'  #-------------------------------------|REDIS|-----------------------------# #---\/\/Redis is an in-memory database project implementing\/\/---------------# #---\/\/a distributed, in-memory key-value store with\/\/---------------------# #---\/\/optional durability.\/\/----------------------------------------------#  redis::bind: 0.0.0.0  #-------------------------------------|ZOOKEPER|--------------------------# #---\/\/Zooker is a centralized service for distributed systems\/\/-----------# #---\/\/to a hierarchical key-value store, which is used to provide\/\/-------# #---\/\/a distributed configuration service, synchronization service,\/\/-----# #---\/\/and naming registry for large distributed systems.\/\/----------------#  zookeeper::init_limit: '1000' zookeeper::id: '1' zookeeper::purge_interval: '1' zookeeper::servers:   - \"%{lookup('host')}\"  #-------------------------------------|POSTGRES|--------------------------# #---\/\/Postgres, is an object-relational database management system\/\/------# #---\/\/with an emphasis on extensibility and standards compliance.\/\/-------# #---\/\/As a database server, its primary functions are to store  data\/\/----# #---\/\/securely and return that data in response to requests from other\/\/--# #---\/\/software applications.\/\/--------------------------------------------#  postgresql::server::postgres_password:  postgresql::server::ip_mask_allow_all_users: '0.0.0.0\/0'  postgresql::postgresql::server:   ip_mask_allow_all_users: '0.0.0.0\/32'  postgres_db:   master:     user:      password:    confluence:     user:      password:  postgres_config:     'max_connections':        value: 300  postgres_hba:     'Allow locals without password':         order: 1         description: 'locals postgres no password'         type: 'host'         address: '127.0.0.1\/32'         database: 'all'         user: 'all'         auth_method: 'trust'    #----------------------------------------------|PGBOUNCER|----------------# #---\/\/PgBouncer is a connection pooler for PostgreSQL\/\/-------------------#  pgbouncer::group: postgres pgbouncer::user: postgres pgbouncer::userlist:    - user:        password:   pgbouncer::databases:    - source_db: recommender      host: \"%{lookup('')}\"      dest_db: recommender      auth_user: recommender      pool_size: 200      auth_pass:     - source_db: master      host: \"%{lookup('')}\"      dest_db: recommender      auth_user: recommender      pool_size: 50      auth_pass:     - source_db: slave      host: \"%{lookup('')}\"      dest_db: recommender      auth_user: recommender      pool_size: 200      auth_pass:   #=========================================================================#  #==============================|APPLICATION SERVICES|=====================# #---------------------------------------------------|CONFLUENCE|----------# #---------------------------------------------------|JENKINS|-------------#  #=========================================================================#   <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u0435\u043a\u0446\u0438\u0438 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430: <\/h3>\n<p>  <\/p>\n<pre><code>#============================|MONITORING|=================================# #---------------------------------------|ICINGA SERVICES|-----------------# #---\/\/Managment of monitoring system.\/\/-----------------------------------#    icinga2_service:        '%{::fqdn} virtual host' :         target: \/etc\/icinga2\/zones.d\/master\/%{::fqdn}.conf         apply: true         assign: [ 'host.name == %{::fqdn}' ]         display_name: '%{::fqdn} virtualhost'         check_command: 'http'         vars:             http_uri: \/             http_ssl: true             http_vhost: 'hostname'             http_address: \"%{lookup('host_address')}\"            '%{::fqdn} nginx status' :         target: \/etc\/icinga2\/zones.d\/master\/%{::fqdn}.conf         apply: true         assign: [ 'host.name == %{::fqdn}' ]         command_endpoint: '%{::fqdn}'         display_name: 'nginx status'         check_command: 'nginx_status'         vars:             nginx_status_host_address: localhost             nginx_status_servername: server.com             nginx_status_critical: '1600,60,30'             nginx_status_warn: '1500,55,25'          '%{::fqdn} redis':         target: \/etc\/icinga2\/zones.d\/master\/%{::fqdn}.conf         apply: true         assign: [ 'host.name == %{::fqdn}' ]         display_name: 'Redis'         command_endpoint: '%{::fqdn}'         check_command: \"redis\"         vars:             redis_hostname: localhost             redis_port: 6379             redis_perfvars: '*'    #=========================================================================#  <\/code><\/pre>\n<h2>\u041e\u0431\u0449\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0442\u0430\u043a\u043e\u0439 \u0441\u0445\u0435\u043c\u044b \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0432 \u0434\u0432\u0443\u0445 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u0445:<\/h2>\n<p>  <\/p>\n<ol>\n<li> <b> \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c puppet \u043d\u0430 \u0445\u043e\u0441\u0442\u0435 \u2014 \u0445\u043e\u0441\u0442 \u0432\u0438\u0434\u0438\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0435\u043c\u0443 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0442 \u0438 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u0438\u0445 \u0432 puppetDB.<br \/>   <\/b>   <\/li>\n<li> <b> \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c puppet \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 icinga2 \u2014 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438\u0437 puppetdb \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 Icinga2.<br \/>   <\/b>   <\/li>\n<\/ol>\n<p>  \u0422\u0443\u0442 \u043c\u043d\u043e\u0433\u0438\u0435 \u0441\u043a\u0430\u0436\u0443\u0442: <i>\u00ab\u0410 \u0437\u0430\u0447\u0435\u043c \u043c\u043d\u0435 \u0432\u0441\u0451 \u044d\u0442\u043e \u0433\u043e\u0440\u043e\u0434\u0438\u0442\u044c, \u0435\u0441\u043b\u0438 \u044f \u043c\u043e\u0433\u0443 \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u043e\u0431\u044b\u0447\u043d\u0443\u044e icinga2 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u0443\u043a\u0430\u043c\u0438 \u0438\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441?\u00bb<\/i> <\/p>\n<p>  \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u0442\u044c \u0441 \u0434\u0435\u0441\u044f\u0442\u043e\u043a \u0445\u043e\u0441\u0442\u043e\u0432 \u0441 \u0441\u043e\u0442\u043d\u0435\u0439 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0438 \u0432\u044b \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u044b\u0439 \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u0441 \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u043f\u0430\u043c\u044f\u0442\u044c\u044e (\u0432 \u043f\u0440\u0438\u0440\u043e\u0434\u0435 \u043d\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f), \u0442\u043e \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u0433\u043e\u0440\u043e\u0434\u0438\u0442\u044c \u043e\u0433\u043e\u0440\u043e\u0434. \u0421\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0434\u0440\u0443\u0433\u043e\u0435 \u0434\u0435\u043b\u043e, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0438 \u0435\u0441\u0442\u044c \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0432\u044b \u0447\u0442\u043e-\u0442\u043e \u0433\u0434\u0435-\u0442\u043e \u043c\u043e\u0433\u043b\u0438 \u0437\u0430\u0431\u044b\u0442\u044c. \u0412 \u0442\u0430\u043a\u0438\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442, \u0442.\u043a. \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0440\u0430\u0437\u043b\u043e\u0436\u0438\u0442\u044c \u0432\u0441\u0451 \u043f\u043e \u043f\u043e\u043b\u043e\u0447\u043a\u0430\u043c \u0438 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c, \u0432\u043e \u043c\u043d\u043e\u0433\u043e\u043c, \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0444\u0430\u043a\u0442\u043e\u0440\u0430.<\/p>\n<h2>\u041e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u043b\u044e\u0441\u044b:<\/h2>\n<p>  <b>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0448\u0430\u0431\u043b\u043e\u043d:<\/b><\/p>\n<pre><code>icinga2_service:     '%{::fqdn} disk service':         target: \/etc\/icinga2\/zones.d\/master\/%{::fqdn}.conf         apply: true         assign: [ 'host.name == %{::fqdn}' ]         display_name: 'Disk usage'         command_endpoint: '%{::fqdn}'         check_command: 'disk'         vars:           #All disks           disk_all: true           disk_exclude_type:             - aufs             - tmpfs           disk_ignore_ereg_path:             - \/run\/docker\/*             - \/sys\/*             - \/var\/lib\/docker*             - \/var\/lib\/ureadahead\/debugfs\/*             - \/run\/user\/* <\/code><\/pre>\n<p>  <b>+ 1. \u042d\u0442\u043e\u0442 \u0448\u0430\u0431\u043b\u043e\u043d \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0432 Hiera \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043a\u043e \u0432\u0441\u0435\u043c \u0445\u043e\u0441\u0442\u0430\u043c \u0432 \u0442\u0430\u043a\u043e\u043c \u0432\u0438\u0434\u0435 \u2014 \u0442.\u0435. \u043e\u043d \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439. \u041a\u043e\u043d\u0444\u0438\u0433\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 Icinga2, \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430 \u0432 \u043d\u0430\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435, \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0430\u043c\u0438\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u0432 \u0445\u043e\u0441\u0442\u043e\u0432, \u043a\u043b\u044e\u0447\u0435\u0439, \u0437\u043e\u043d \u0438 \u043f\u0440\u043e\u0447\u0435\u0439 \u0440\u0430\u0434\u043e\u0441\u0442\u0438.<br \/>  <\/b><br \/>  <b>+ 2. \u041d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438\u043b\u0438 \u043d\u0435\u0442. \u0415\u0441\u043b\u0438 \u043f\u0430\u043f\u043f\u0435\u0442 \u043d\u0430 \u0445\u043e\u0441\u0442\u0435 \u0431\u044b\u043b \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u2014 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430 \u0441\u0433\u0435\u043d\u0435\u043d\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0432 \u043d\u0430\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430.<br \/>  <\/b><br \/>  <b>+ 3. \u041c\u044b \u043d\u0435 \u043f\u0435\u0440\u0435\u0436\u0438\u0432\u0430\u0435\u043c \u043e \u0431\u0435\u043a\u0430\u043f\u0430\u0445 \u043d\u0430\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430, \u0442.\u043a. \u0432\u0441\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0443 \u043d\u0430\u0441 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043f\u0430\u043f\u043f\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c, \u0438 \u0434\u0430\u0436\u0435 \u043f\u0440\u0438 \u043f\u043e\u043b\u043d\u043e\u0439 \u043f\u043e\u0442\u0435\u0440\u0435 \u0432\u0441\u0435\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u0432 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 Icinga2 \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043b\u0435\u0433\u043a\u043e \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0432 puppet \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 Icinga2.<br \/>  <\/b><br \/>  <b>+ 4. \u0422\u0430\u043a \u0442\u0430\u043a \u0432\u0441\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0443 \u043d\u0430\u0441 \u0445\u0440\u0430\u043d\u044f\u0442\u044c\u0441\u044f \u0432 \u0435\u0434\u0438\u043d\u043e\u0439 \u0431\u0430\u0437\u0435 puppetDB \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043e\u0449\u043d\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u043c \u044d\u0442\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. <br \/>  <\/b><\/p>\n<h2>\u0418\u0442\u0430\u043a, \u043f\u043e\u0435\u0445\u0430\u043b\u0438<\/h2>\n<p>  <\/p>\n<h3>1. \u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c puppet.<\/h3>\n<p>  \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 docker \u0438 docker-compose.<br \/>  \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e \u0438\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c: <br \/>  <a href=\"https:\/\/docs.docker.com\/install\/linux\/docker-ce\/ubuntu\/\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Docker&#8230;<\/a><br \/>  <a href=\"https:\/\/docs.docker.com\/compose\/install\/\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Docker-compose&#8230;<\/a><\/p>\n<h3>2. \u0421\u043a\u043b\u043e\u043d\u0438\u0440\u0443\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043a \u0441\u0435\u0431\u0435 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440:<\/h3>\n<p>  <\/p>\n<pre><code class=\"bash\">git clone http:\/\/git.comgress64.com\/external\/puppet-icinga2-how-to.git <\/code><\/pre>\n<p>  <\/p>\n<h3>3. \u041e\u0442\u043a\u0440\u043e\u0435\u043c docker-compose.yaml \u043b\u044e\u0431\u0438\u043c\u044b\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u043e\u043c \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043d\u0435\u0433\u043e.<\/h3>\n<p>  \u041c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0430\u0447\u043a\u0435 \u0443 \u043d\u0430\u0441 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0441\u0440\u0430\u0437\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u2014 PuppetServer, PuppetDb, PostgreSQL \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 PuppetBoard. \u0422\u0430\u043a \u0436\u0435 \u043c\u043e\u043d\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f volumes \u0438\u0437 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438. \u041d\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u044d\u0442\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0439\u0442\u0435 \u0441\u0432\u043e\u044e \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443. \u0423 \u043a\u043e\u0433\u043e-\u0442\u043e \u0443\u0436\u0435 \u0435\u0441\u0442\u044c PostgreSQL \u0441\u0435\u0440\u0432\u0435\u0440, \u043a\u0442\u043e-\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u2014 \u0442\u0443\u0442 \u0441\u0432\u043e\u0431\u043e\u0434\u0430 \u0434\u043b\u044f \u0442\u0432\u043e\u0440\u0447\u0435\u0441\u0442\u0432\u0430. \u041d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u044f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u2014 \u043a \u043d\u0435\u043c\u0443 \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043f\u043e\u0437\u0436\u0435. \u041f\u043e\u0434\u043d\u0438\u043c\u0435\u043c \u043d\u0430\u0448\u0443 \u043f\u0430\u0447\u043a\u0443 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0432\u044b\u0448\u043b\u043e:<\/p>\n<h3>4. \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 Puppet, Postgres, Puppetdb \u0438 Graphite<\/h3>\n<p>  <\/p>\n<pre><code class=\"bash\">#\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 Puppet, Postgres \u0438 Puppetdb #\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 Puppet, Postgres, Puppetdb \u0438 Graphite cd puppet-icinga2-how-to docker-compose up -d puppet puppetdb-postgres puppetdb graphite  &amp;&amp; docker-compose logs -f <\/code><\/pre>\n<p>  \u0421\u0435\u0439\u0447\u0430\u0441 \u0443 \u043d\u0430\u0441 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b\u043e\u0441\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0438\u0441\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b, \u0441\u043e\u0437\u0434\u0430\u043b\u0438\u0441\u044c \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 PostgreSQL. \u0414\u043e\u0436\u0434\u0435\u043c\u0441\u044f, \u043f\u043e\u043a\u0430 \u0432\u0441\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u044b \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u044b \u2014 \u043e\u0448\u0438\u0431\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0442.\u043a \u043e\u043d\u0438 \u0447\u0435\u0440\u0435\u0437 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f. \u0416\u043c\u0451\u043c Ctrl+C, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0439\u0442\u0438 \u0438\u0437 \u0440\u0435\u0436\u0438\u043c\u0430 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u043b\u043e\u0433\u043e\u0432.<\/p>\n<h3>5. \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u043d\u0430\u0448\u0435\u0433\u043e puppet master:<\/h3>\n<p>  <\/p>\n<pre><code class=\"bash\"> docker run --net puppeticinga2howto_default --link puppet:puppet puppet\/puppet-agent <\/code><\/pre>\n<p>  <\/p>\n<h3>6. \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u043e\u043a, \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0432\u044b\u0432\u043e\u0434:<\/h3>\n<p>  <\/p>\n<pre><code class=\"bash\">     Notice: Applied catalog in 0.03 seconds Changes:             Total: 1 Events:           Success: 1             Total: 1 Resources:           Changed: 1       Out of sync: 1             Total: 8 Time:          Schedule: 0.00              File: 0.00    Transaction evaluation: 0.01    Catalog application: 0.03    Convert catalog: 0.04    Config retrieval: 0.45    Node retrieval: 1.38          Last run: 1532605377    Fact generation: 2.24       Plugin sync: 4.50        Filebucket: 0.00             Total: 8.65 Version:            Config: 1532605376            Puppet: 5.5.1     <\/code><\/pre>\n<p>  \u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c c\u0435\u0440\u0432\u0435\u0440 Icinga2.<\/p>\n<h3>7. \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0437 \u0438\u0437 Dockerfile, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432:<\/h3>\n<p>  <\/p>\n<pre><code class=\"bash\"> docker-compose build icinga <\/code><\/pre>\n<p>  <\/p>\n<h3>8. \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0436\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 Icinga2.<\/h3>\n<p>  <\/p>\n<pre><code class=\"bash\"> docker-compose up -d icinga <\/code><\/pre>\n<p>  <\/p>\n<h3>9. \u041f\u043e\u043a\u0430 \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043f\u0443\u0441\u0442\u043e\u0439. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c icinga2 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043d\u0430\u0448\u0435\u0433\u043e Puppet \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432:<\/h3>\n<p>  <\/p>\n<pre><code class=\"bash\"> #\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u0438 \u0434\u043b\u044f puppet \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0432 librarian-puppet \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 puppet docker-compose exec puppet bash -c 'cd \/etc\/puppetlabs\/code &amp;&amp; gem install librarian-puppet &amp;&amp; librarian-puppet install --verbose' #\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c Puppet \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 Icinga \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 docker-compose exec icinga puppet agent --server puppet --waitforcert 60 --test <\/code><\/pre>\n<p>  <\/p>\n<h3>10. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0438 \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f Icinga, Icingaweb2 \u0438 Apache.<\/h3>\n<p>  <\/p>\n<h2>\u0412\u0430\u0448 \u0441\u0435\u0440\u0432\u0435\u0440 Icinga2 \u0433\u043e\u0442\u043e\u0432!<\/h2>\n<p>  <\/p>\n<h2>Icingaweb2<\/h2>\n<p>  <\/p>\n<h3>1. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c.<\/h3>\n<p>  \u0423\u0434\u043e\u0431\u043d\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c:<br \/>  \u041e\u0442\u043a\u0440\u043e\u0435\u043c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 <font color=\"#0000aa\"><u><code>http:\/\/ip_\u0430\u0434\u0440\u0435\u0441\u0441_\u0432\u0430\u0448\u0435\u0433\u043e_\u0445\u043e\u0441\u0442\u0430:8081\/icingaweb2<\/code><\/u><\/font> \u0438 \u0437\u0430\u0439\u0434\u0451\u043c \u0432 Icinga c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u043c \u043b\u043e\u0433\u0438\u043d\u043e\u043c: <b>icingaadmin\/icinga<\/b>.<\/p>\n<p>  <b>\u0412\u0438\u0434\u0438\u043c \u0432\u043e\u0442 \u0442\u0430\u043a\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443:<\/b><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/vg\/hr\/zn\/vghrznlioinsw68lgide-onot9o.png\"><\/p>\n<p>  <b>\u0427\u0435\u0440\u0435\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0438\u043d\u0443\u0442 \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0432\u0441\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438:<\/b><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ju\/5a\/ds\/ju5adsckudygkhbejybx4k7fmz4.png\"><\/p>\n<p>  <b>\u0413\u0440\u0430\u0444\u0438\u043a\u0438 \u0442\u043e\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442:<\/b><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/hy\/6i\/lw\/hy6ilwnlp0ua6fdoouzo-8t7rog.png\"><\/p>\n<p>  \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0447\u0430\u044f \u0432\u0435\u0431-\u0441\u0440\u0435\u0434\u0430 \u0434\u043b\u044f Icinga2, \u043d\u043e \u043f\u043e\u043a\u0430 \u0435\u0449\u0451 \u043d\u0435\u0442 \u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0451\u043d\u043d\u043e\u0433\u043e \u043a Icinga, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u043d\u0430\u0448 \u043f\u0435\u0440\u0432\u044b\u0439 \u0445\u043e\u0441\u0442.<\/p>\n<h3>2. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0445\u043e\u0441\u0442 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430<\/h3>\n<p>  \u0421\u0435\u0439\u0447\u0430\u0441 \u0443 \u043d\u0430\u0441 \u043a icinga2 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0445\u043e\u0441\u0442 \u2014 \u0441\u0430\u043c\u0430 Icinga. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d.<br \/>  \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432 \u0434\u043e\u043a\u0435\u0440\u0435, \u043d\u043e \u0432\u0441\u0451 \u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438 \u043d\u0430 \u0433\u043e\u043b\u043e\u043c \u0436\u0435\u043b\u0435\u0437\u0435: <\/p>\n<p>  <b>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d \u0438 \u0434\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0445\u043e\u0441\u0442\u0435 \u0434\u043b\u044f puppet:<\/b><\/p>\n<pre><code class=\"bash\"> #\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 cd puppet-icinga2-how-to\/code\/environments\/production\/hieradata\/nodes #\u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d \u0441 \u043d\u043e\u0432\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c(\u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043c\u0435\u043d\u0435\u043c \u0445\u043e\u0441\u0442\u0430) cp template.yaml example.com.yaml #\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0438\u043b \u043b\u044e\u0431\u0438\u043c\u044b\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u043e\u043c \u0438 \u043c\u0435\u043d\u044f\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435: host_address: 172.18.0.7 my_company: COMGRESS64 my_package_manager: apt my_ssh_port: 22 #\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0444\u0430\u0438\u043b \u0438 \u0432\u044b\u0445\u043e\u0434\u0438\u043c <\/code><\/pre>\n<p>  <b>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043e\u0431\u0440\u0430\u0437 \u0434\u043e\u043a\u0435\u0440\u0430. \u0422\u0443\u0442 \u0441\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0435\u043c\u0443 hostname \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u043a\u0430\u043a \u0443 \u0444\u0430\u0438\u043b\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043b\u0438:<\/b><\/p>\n<pre><code class=\"bash\"> docker run --hostname example.com --rm -t --link puppet:puppet --net puppeticinga2howto_default -i phusion\/baseimage:latest \/sbin\/my_init -- bash -l <\/code><\/pre>\n<p>  <b>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c puppet \u043d\u0430 \u043d\u0430\u0448\u0435\u043c \u0445\u043e\u0441\u0442\u0435:<\/b><\/p>\n<pre><code class=\"bash\"> apt-get update &amp;&amp; apt-get install -y ruby make gcc perl-modules &amp;&amp; gem install --no-ri --no-rdoc puppet <\/code><\/pre>\n<p>  <b>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c puppet:<\/b><\/p>\n<pre><code class=\"bash\"> puppet agent --server puppet --waitforcert 60 --test <\/code><\/pre>\n<p>  <b>\u0421\u0435\u0439\u0447\u0430\u0441 \u0443 \u043d\u0430\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0430\u0441\u044c icinga2 \u043d\u0430 \u043d\u0430\u0448 \u043d\u043e\u0432\u044b\u0439 \u0445\u043e\u0441\u0442 \u0438 \u0432\u0441\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0434\u043b\u044f \u043d\u0435\u0451 \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u043b\u0438\u0441\u044c \u0432 \u0431\u0430\u0437\u0443 puppetDB. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u0445 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 puppet \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 icinga2:<\/b><\/p>\n<pre><code class=\"bash\"> docker-compose exec icinga puppet agent --server puppet --waitforcert 60 --test <\/code><\/pre>\n<p>  <b>\u0421\u043c\u043e\u0442\u0440\u0438\u043c \u0447\u0435\u0440\u0435\u0437 \u0431\u0440\u0430\u0443\u0437\u0435\u0440, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c:<\/b><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/tc\/ko\/uc\/tckoucinbkuwoqh_bhquehthj-i.png\"><\/p>\n<p>  <b>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438\u0441\u044c \u0438 \u043e\u0436\u0438\u0434\u0430\u044e\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<\/b><br \/>  <b>\u0427\u0435\u0440\u0435\u0437 5 \u043c\u0438\u043d\u0443\u0442:<\/b><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/-9\/va\/dv\/-9vadvzxjwxepukpbjoinxt0h9a.png\"><\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u0436\u0435 \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0445\u043e\u0441\u0442\u044b \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443. \u0425\u043e\u0447\u0443 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0430\u0448\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e\u043c \u043a\u043e\u043d\u0446\u0435\u043f\u0442\u0430 \u0438 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u0432 \u0441\u0440\u0435\u0434\u0435 production \u0431\u0435\u0437 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043e\u043a.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0439, \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0430\u0437 \u044f \u043f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u0441\u044f\u043a\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u043f\u043e\u0434\u0435\u043b\u044e\u0441\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u0430\u043c\u0438 \u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u0440\u043e \u0432\u0441\u044f\u043a\u0438\u0435 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0438. \u0422\u0430\u043a\u0436\u0435, \u0435\u0441\u043b\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u0436\u0435\u043b\u0430\u043d\u0438\u0435, \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e \u0442\u043e\u043c \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438\u0437\u043d\u0443\u0442\u0440\u0438. <\/p>\n<p>  <b>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435!<\/b> <\/p>\n<hr>\n<p>  <b>\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u044d\u0442\u0443 \u0436\u0435 \u0441\u0442\u0430\u0442\u044c\u044e \u0432 Confluence:<\/b><br \/>  <i>\/\u0427\u0443\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438.\/<\/i><br \/>  <a href=\"https:\/\/docs.comgress64.com\/pages\/viewpage.action?pageId=8880176\"><b>docs.comgress64.com\/&#8230;<\/b><\/a><\/p>\n<p>  <b>\u0421\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b:<\/b><br \/>  <a href=\"https:\/\/github.com\/Icinga\/puppet-icinga2\">https:\/\/github.com\/Icinga\/puppet-icinga2<\/a><br \/>  <a href=\"https:\/\/forge.puppet.com\/icinga\/icingaweb2\">https:\/\/forge.puppet.com\/icinga\/icingaweb2<\/a><br \/>  <a href=\"https:\/\/docs.docker.com\/\">https:\/\/docs.docker.com\/<\/a><br \/>  <a href=\"https:\/\/docs.puppet.com\/\">https:\/\/docs.puppet.com\/<\/a><br \/>  <a href=\"https:\/\/docs.puppet.com\/hiera\/\">https:\/\/docs.puppet.com\/hiera\/<\/a><\/div>\n<p>        <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/post\/420199\/\"> https:\/\/habr.com\/post\/420199\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div data-io-article-url=\"https:\/\/habr.com\/post\/420199\/\" class=\"post__text post__text-html js-mediator-article\">\n<h1><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/do\/po\/ex\/dopoexqmfbzwvbyt6vlwvvaqqus.png\">\u00a0\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043d\u0430 \u0431\u0430\u0437\u0435 Icinga2 \u0438 Puppet<\/h1>\n<p>  <\/p>\n<h3>\u041f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u2026 Infrastructure as code (IaC).<\/h3>\n<p>  \u041d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 \u043f\u0440\u043e Icinga2, \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0436\u0435 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0440\u043e Puppet:<\/p>\n<p>  <a href=\"https:\/\/habr.com\/post\/326450\/\">Icinga2 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442<\/a><br \/>  <a href=\"https:\/\/habr.com\/post\/307358\/\">\u041f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u043c \u043c\u0438\u043a\u0440\u043e\u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 \u043d\u0430 icinga2 \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0437\u0430\u0442\u0440\u0430\u0442\u0430\u043c\u0438<\/a><br \/>  <a href=\"https:\/\/habr.com\/post\/229867\/\">\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<\/a><\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u0442\u0435\u043c\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u043f\u043e\u0442\u0440\u044f\u0441\u0430\u044e\u0449\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0430.<br \/>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435, \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043d\u0430 \u00ab\u0436\u0438\u0432\u043e\u043c\u00bb \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e, \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0432 \u044d\u0442\u0438 \u0434\u0432\u0435 <br \/>  \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0432\u0430\u0448\u0435\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0441\u043e \u0432\u0441\u0435\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0421\u0442\u0430\u0442\u044c\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u0440\u043e\u0434\u0430 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e\u043c \u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044e \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 \u00ab\u0432\u0441\u0435 \u0432 \u043e\u0434\u043d\u043e\u043c \u0444\u043b\u0430\u043a\u043e\u043d\u0435\u00bb. \u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u0443 \u0432\u0430\u0441 \u0432 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0440\u0430\u0431\u043e\u0447\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u00ab\u0434\u043e\u043f\u0438\u043b\u0438\u0432\u0430\u0442\u044c\u00bb \u043f\u043e\u0434 \u0441\u0435\u0431\u044f. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c!  <\/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-287303","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/287303","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=287303"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/287303\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=287303"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=287303"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=287303"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}