{"id":302898,"date":"2020-05-01T21:00:33","date_gmt":"2020-05-01T21:00:33","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=302898"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=302898","title":{"rendered":"\u041a\u0430\u043a \u043d\u0430\u0447\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c Ansible, \u043e\u0442\u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0437\u0430 \u0433\u043e\u0434 \u0438 \u043d\u0435 \u0441\u043b\u0435\u0442\u0435\u0442\u044c \u0441 \u043a\u0430\u0442\u0443\u0448\u0435\u043a"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/500058\/\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bk\/vw\/ds\/bkvwdsdsfvgvjf_ein3uddyocbm.png\"><\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0430 <a href=\"https:\/\/www.youtube.com\/watch?v=GdrJv5oypfg\" rel=\"nofollow\">\u0432\u044b\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f<\/a> \u043d\u0430 <a href=\"https:\/\/www.meetup.com\/DevOps-40\/events\/269140089\/\" rel=\"nofollow\">DevOps-40 2020-03-18<\/a>:<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441\u043e \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043a\u043e\u043c\u043c\u0438\u0442\u0430 \u043b\u044e\u0431\u043e\u0439 \u043a\u043e\u0434 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f legacy, \u0442.\u043a. \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u0434\u0443\u043c\u043a\u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0440\u0430\u0441\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0441 \u0441\u0443\u0440\u043e\u0432\u043e\u0439 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e. \u042d\u0442\u043e \u043d\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u0438 \u043d\u0435 \u043f\u043b\u043e\u0445\u043e, \u044d\u0442\u043e \u0434\u0430\u043d\u043d\u043e\u0441\u0442\u044c \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e \u0441\u043f\u043e\u0440\u0438\u0442\u044c \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f. \u0427\u0430\u0441\u0442\u044c\u044e \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433. \u0420\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433 Infrastructure as Code. \u0414\u0430 \u043d\u0430\u0447\u043d\u0435\u0442\u0441\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u043a\u0430\u043a \u043e\u0442\u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0442\u044c Ansible \u0437\u0430 \u0433\u043e\u0434 \u0438 \u043d\u0435 \u0441\u043b\u0435\u0442\u0435\u0442\u044c \u0441 \u043a\u0430\u0442\u0443\u0448\u0435\u043a.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"zarozhdenie-legacy\">\u0417\u0430\u0440\u043e\u0436\u0434\u0435\u043d\u0438\u0435 Legacy<\/h2>\n<p>  <\/p>\n<h3 id=\"den--1-nulevoy-pacient\">\u0414\u0435\u043d\u044c \u2116 1: \u041d\u0443\u043b\u0435\u0432\u043e\u0439 \u043f\u0430\u0446\u0438\u0435\u043d\u0442<\/h3>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/jm\/mn\/9q\/jmmn9qcfnbprr8maq3k2zpp27ww.png\"><\/p>\n<p>  <\/p>\n<p>\u0416\u0438\u043b \u0431\u044b\u043b \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. \u041d\u0430 \u043d\u0435\u043c \u0431\u044b\u043b\u0430 Dev \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 Ops \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u044b. \u041e\u043d\u0438 \u0440\u0435\u0448\u0430\u043b\u0438 \u043e\u0434\u043d\u0443 \u0438 \u0442\u0443 \u0436\u0435 \u0437\u0430\u0434\u0430\u0447\u0443: \u043a\u0430\u043a \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0431\u044b\u043b\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0440\u0435\u0448\u0430\u043b\u0430 \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u043e \u0441\u0432\u043e\u0435\u043c\u0443. \u041d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Ansible \u0434\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u043d\u0430\u043d\u0438\u0439 \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438 Dev \u0438 Ops.<\/p>\n<p>  <\/p>\n<h3 id=\"den--89-zarozhdenie-legacy\">\u0414\u0435\u043d\u044c \u2116 89: \u0417\u0430\u0440\u043e\u0436\u0434\u0435\u043d\u0438\u0435 Legacy<\/h3>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/p1\/gg\/sr\/p1ggsrxayo0fachydvmwhqtloek.png\"><\/p>\n<p>  <\/p>\n<p>\u0421\u0430\u043c\u0438 \u0442\u043e\u0433\u043e \u043d\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u0432, \u0445\u043e\u0442\u0435\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043b\u0443\u0447\u0448\u0435, \u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c legacy. \u041a\u0430\u043a \u0442\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f?<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0423 \u043d\u0430\u0441 \u0442\u0443\u0442 \u0441\u0440\u043e\u0447\u043d\u0430\u044f \u0442\u0430\u0441\u043a\u0430, \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0433\u0440\u044f\u0437\u043d\u044b\u0439 \u0445\u0430\u043a \u2014 \u043f\u043e\u0442\u043e\u043c \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043c.<\/li>\n<li>\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0438 \u0442\u0430\u043a \u0432\u0441\u0451 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0447\u0442\u043e \u0442\u0443\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442.<\/li>\n<li>\u042f \u0437\u043d\u0430\u044e Ansible \/ Python \/ Bash \/ Terraform! \u0421\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043a\u0430\u043a \u044f \u043c\u043e\u0433\u0443 \u0438\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f!<\/li>\n<li>\u042f Full Stack Overflow Deveopler \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b \u044d\u0442\u043e \u0441\u043e stackoverflow, \u043d\u0435 \u0437\u043d\u0430\u044e \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438\u043a\u043e\u043b\u044c\u043d\u043e \u0438 \u0440\u0435\u0448\u0430\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0443.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u043e\u0434 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0433\u043e \u0432\u0438\u0434\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u0442 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0447\u0442\u043e \u043e\u043d \u0434\u0435\u043b\u0430\u0435\u0442, \u043d\u0443\u0436\u0435\u043d \u043b\u0438 \u043e\u043d, \u043d\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0435\u0433\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c, \u0434\u043e\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u0441\u0442\u044b\u043b\u0438 \u0441 \u043f\u043e\u0434\u043f\u043e\u0440\u043a\u0430\u043c\u0438, \u0434\u0435\u043b\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0448\u0435 \u0445\u0443\u0436\u0435.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">- hosts: localhost   tasks:     - shell: echo -n Z &gt;&gt; a.txt &amp;&amp; cat a.txt       register: output       delay: 1       retries: 5       until: not output.stdout.find(&quot;ZZZ&quot;)<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"den--109-osoznanie-problemy\">\u0414\u0435\u043d\u044c \u2116 109: \u041e\u0441\u043e\u0437\u043d\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b<\/h3>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/52\/-m\/km\/52-mkm0nvoywmsugy7gscnstjh0.png\"><\/p>\n<p>  <\/p>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u0434\u0443\u043c\u0430\u043d\u043d\u0430\u044f \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c IaC \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0451\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \/ \u0431\u0438\u0437\u043d\u0435\u0441\u0430 \/ \u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434, \u0432\u0440\u0435\u043c\u044f \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0451\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u0435\u043c\u043b\u0438\u043c\u044b\u043c. \u0412 \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043f\u043e\u0440\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043c\u0435\u0440\u044b.<\/p>\n<p>  <\/p>\n<h2 id=\"refaktoring-iac\">\u0420\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433 IaC<\/h2>\n<p>  <\/p>\n<h3 id=\"den--139-a-vam-tochno-nuzhen-refaktoring\">\u0414\u0435\u043d\u044c \u2116 139: \u0410 \u0432\u0430\u043c \u0442\u043e\u0447\u043d\u043e \u043d\u0443\u0436\u0435\u043d \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433?<\/h3>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ih\/ty\/rh\/ihtyrh6qo2oufdjxheiflkp1erg.png\"><\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043a\u0438\u0434\u0430\u0442\u044c\u0441\u044f \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0442\u044c \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u0440\u044f\u0434 \u0432\u0430\u0436\u043d\u044b\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432:<\/p>\n<p>  <\/p>\n<ol>\n<li>\u0417\u0430\u0447\u0435\u043c \u0432\u0430\u043c \u0432\u0441\u0451 \u044d\u0442\u043e?<\/li>\n<li>\u0415\u0441\u0442\u044c \u043b\u0438 \u0443 \u0432\u0430\u0441 \u0432\u0440\u0435\u043c\u044f?<\/li>\n<li>\u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0438 \u0437\u043d\u0430\u043d\u0438\u0439?<\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0437\u043d\u0430\u0447\u0435\u0442\u0435 \u043a\u0430\u043a \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u0442\u043e \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u0441\u044f \u0442\u0430\u043a \u0438 \u043d\u0435 \u043d\u0430\u0447\u0430\u0432\u0448\u0438\u0441\u044c \u0438\u043b\u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0445\u0443\u0436\u0435. \u0422.\u043a. \u0431\u044b\u043b \u043e\u043f\u044b\u0442( <a href=\"https:\/\/habr.com\/en\/post\/467171\/\">\u0427\u0442\u043e \u044f \u0443\u0437\u043d\u0430\u043b, \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0432 200 000 \u0441\u0442\u0440\u043e\u043a \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430<\/a>), \u0442\u043e \u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043f\u0440\u0438\u0448\u0435\u043b \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e\u043c\u043e\u0449\u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0440\u043e\u043b\u0438 \u0438 \u043f\u043e\u043a\u0440\u044b\u0442\u044c \u0438\u0445 \u0442\u0435\u0441\u0442\u0430\u043c\u0438.<\/p>\n<p>  <\/p>\n<h3 id=\"den--149-podgotovka-reafktoringa\">\u0414\u0435\u043d\u044c \u2116 149: \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0440\u0435\u0430\u0444\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430<\/h3>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ml\/58\/cc\/ml58ccbdsrcynuz6be0o76uw4tm.png\"><\/p>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0432\u043e\u043e\u0447\u0435\u0440e\u0434\u043d\u043e\u0435 \u044d\u0442\u043e \u043d\u0430\u0434\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c\u0441\u044f. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u0431\u0449\u0430\u0435\u043c\u0441\u044f, \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0442\u043e\u0447\u043a\u0438 \u0438 \u043f\u0440\u0438\u043a\u0438\u0434\u044b\u0432\u0430\u0435\u043c \u0438\u0445 \u043f\u0443\u0442\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0442\u044b \u043a\u0430\u043a-\u0442\u043e \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u0442\u0430\u0442\u044c\u044f \u0432 confluence, \u0447\u0442\u043e \u0431\u044b \u043f\u0440\u0438 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u0430 &quot;\u043a\u0430\u043a \u043b\u0443\u0447\u0448\u0435?&quot; \u0438\u043b\u0438 &quot;\u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0435\u0435?&quot; \u043c\u044b \u043d\u0435 \u0441\u0431\u0438\u043b\u0438\u0441\u044c \u0441 \u043a\u0443\u0440\u0441\u0430. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0438\u0434\u0435\u0438 <em>\u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0439 \u0438 \u0432\u043b\u0430\u0441\u0442\u0432\u0443\u0439<\/em>: \u0434\u0440\u043e\u0431\u0438\u043c \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043d\u0430 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435 \u043a\u0443\u0441\u043e\u0447\u043a\u0438 \/ \u043a\u0438\u0440\u043f\u0438\u0447\u0438\u043a\u0438. \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0437\u044f\u0442\u044c \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u0443\u0441\u043e\u043a \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u043f\u043e\u043d\u044f\u0442\u044c \u0447\u0442\u043e \u043e\u043d \u0434\u0435\u043b\u0430\u0435\u0442, \u043f\u043e\u043a\u0440\u044b\u0442\u044c \u0435\u0433\u043e \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0435 \u043f\u043e\u0431\u043e\u044f\u0432\u0448\u0438\u0441\u044c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u043b\u043e\u043c\u0430\u0442\u044c.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/pn\/98\/jt\/pn98jtnydc1wupw_jvifjjc9mpc.png\"><\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043a\u0440\u0430\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u044b\u043c \u043a\u0430\u043c\u043d\u0435\u043c \u0438 \u0442\u0443\u0442 \u0441\u0442\u043e\u0438\u0442 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044c \u043f\u0438\u0440\u0430\u043c\u0438\u0434\u0443 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. \u0420\u043e\u0432\u043d\u043e \u0442\u0430\u0436\u0435 \u0438\u0434\u0435\u044f, \u0447\u0442\u043e \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435, \u043d\u043e \u0434\u043b\u044f \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b: \u0438\u0434\u0435\u043c \u043e\u0442 \u0434\u0435\u0448\u0435\u0432\u044b\u0445 \u0431\u044b\u0441\u0442\u0440\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0432\u0435\u0449\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0442\u0441\u0442\u0443\u043f\u044b, \u043a \u0434\u043e\u0440\u043e\u0433\u0438\u043c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u043c \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0445 \u0446\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443.<\/p>\n<p>  <\/p>\n<h4 id=\"popytki-testirovaniya-ansible\">\u041f\u043e\u043f\u044b\u0442\u043a\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Ansible<\/h4>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u043e\u0439\u0434\u0435\u043c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u043b\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 Ansible \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u043e\u043f\u0438\u0448\u0443 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u0432\u0435\u043b\u043e\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u043d\u0435\u0435, \u0447\u0442\u043e \u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439.<\/p>\n<p>  <\/p>\n<h5 id=\"den---997-sds-provision\">\u0414\u0435\u043d\u044c \u2116 -997: SDS provision<\/h5>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/wb\/sx\/vi\/wbsxviuyfwt5ngzmn92n6wpcs6a.png\"><\/p>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c Ansible \u0434\u043e\u0432\u0435\u043b\u043e\u0441\u044c \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043f\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 SDS (Software Defined Storage). \u0415\u0441\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443<br \/>  <a href=\"https:\/\/habr.com\/en\/post\/342216\/\">\u041a\u0430\u043a \u043d\u0430\u043b\u043e\u043c\u0430\u0442\u044c \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u043e\u0432 \u043f\u043e\u0432\u0435\u0440\u0445 \u043a\u043e\u0441\u0442\u044b\u043b\u0435\u0439 \u043f\u0440\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0432\u043e\u0435\u0433\u043e \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0430<\/a>, \u043d\u043e \u0435\u0441\u043b\u0438 \u043a\u0440\u0430\u0442\u043a\u043e, \u0442\u043e \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u043f\u0435\u0440\u0435\u0432\u0435\u0440\u043d\u0443\u0442\u0430\u044f \u043f\u0438\u0440\u0430\u043c\u0438\u0434\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u043d\u0438\u0435 \u043c\u044b \u0442\u0440\u0430\u0442\u0438\u043b\u0438 60-90 \u043c\u0438\u043d\u0443\u0442 \u043d\u0430 \u043e\u0434\u043d\u0443 \u0440\u043e\u043b\u044c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0434\u043e\u043b\u0433\u043e. \u041e\u0441\u043d\u043e\u0432\u0430 \u0431\u044b\u043b\u0430 e2e \u0442\u0435\u0441\u0442\u044b, \u0442.\u0435. \u043c\u044b \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043b\u0438 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0443\u044e \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u044e, \u0438 \u043f\u043e\u0442\u043e\u043c \u0435\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438. \u0415\u0449\u0435 \u043e\u0442\u044f\u0433\u0447\u0430\u044e\u0449\u0438\u043c \u0431\u044b\u043b\u043e \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0435\u043d\u0438\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u0430. \u041d\u043e \u043d\u0430\u0434\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u0442\u044c\u0441\u044f \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u043b\u043e \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e \u0440\u0435\u043b\u0438\u0437\u0438\u0442\u044c\u0441\u044f.<\/p>\n<p>  <\/p>\n<h5 id=\"den---701-ansible-i-test-kitchen\">\u0414\u0435\u043d\u044c \u2116 -701: Ansible \u0438 test kitchen<\/h5>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/kj\/la\/wd\/kjlawd4ptlxrpsoa9bhechz57jc.png\"><\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0432\u0438\u0442\u0438\u0435\u043c \u0438\u0434\u0435\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Ansible \u0441\u0442\u0430\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e test kitchen \/ kitchen-ci \u0438 inspec. \u0412\u044b\u0431\u043e\u0440 \u0431\u044b\u043b \u043e\u0431\u0443\u0441\u043b\u043e\u0432\u0435\u043d \u0437\u043d\u0430\u043d\u0438\u0435\u043c Ruby ( \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0439 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043d\u0430 \u0445\u0430\u0431\u0440\u0435: <a href=\"https:\/\/habr.com\/en\/post\/437004\/\">\u041c\u0435\u0447\u0442\u0430\u044e\u0442 \u043b\u0438 YML \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b \u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 ansible?<\/a>) \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 40 \u043c\u0438\u043d\u0443\u0442 \u043d\u0430 10 \u0440\u043e\u043b\u0435\u0439. \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0438 \u043f\u0430\u0447\u043a\u0443 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d \u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u0433\u043e\u043d\u044f\u043b\u0438 \u0442\u0435\u0441\u0442\u044b.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/jj\/7i\/ln\/jj7ilnbd5gav6wmc9ls3qapduwq.png\"><\/p>\n<p>  <\/p>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e, \u043d\u043e \u0431\u044b\u043b \u043e\u0441\u0430\u0434\u043e\u0447\u0435\u043a \u0438\u0437-\u0437\u0430 \u043d\u0435\u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u043e\u0441\u0442\u0438. \u041a\u043e\u0433\u0434\u0430 \u0436\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u0438 \u043a\u043e\u043b\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0434\u043e 13 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0440\u043e\u043b\u0435\u0439 \u0438 2 \u043c\u0435\u0442\u0430 \u0440\u043e\u043b\u0435\u0439 \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u0431\u043e\u043b\u0435\u0435 \u043c\u0435\u043b\u043a\u0438\u0435 \u0440\u043e\u043b\u0438, \u0442\u043e \u0432\u0434\u0440\u0443\u0433 \u0442\u0435\u0441\u0442\u044b \u0441\u0442\u0430\u043b\u0438 \u0431\u0435\u0436\u0430\u0442\u044c 70 \u043c\u0438\u043d\u0443\u0442, \u0447\u0442\u043e \u043f\u043e\u0447\u0442\u0438 \u0432 2 \u0440\u0430\u0437\u0430 \u0434\u043e\u043b\u044c\u0448\u0435. \u041e\u0431 XP (extreme programming) \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430\u0445 \u0431\u044b\u043b\u043e \u0441\u043b\u043e\u0436\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u0442.\u043a. \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0437\u0430\u0445\u043e\u0447\u0435\u0442 \u0436\u0434\u0430\u0442\u044c 70 \u043c\u0438\u043d\u0443\u0442. \u042d\u0442\u043e \u0441\u0442\u0430\u043b\u043e \u043f\u043e\u0434\u043e\u0432\u043e\u0434\u043e\u043c \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u0445\u043e\u0434\u0430<\/p>\n<p>  <\/p>\n<h5 id=\"den---601-ansible-i-molecule\">\u0414\u0435\u043d\u044c \u2116 -601: Ansible \u0438 molecule<\/h5>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/_n\/23\/w3\/_n23w3y7acelkugzgtt0hoqxmdc.png\"><\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u043d\u0446\u0435\u043f\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u044d\u0442\u043e \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 testkitchen, \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u044b \u043f\u0435\u0440\u0435\u0432\u0435\u043b\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u043e\u043b\u0435\u0439 \u0432 docker \u0438 \u0441\u043c\u0435\u043d\u0438\u043b\u0438 \u0441\u0442\u044d\u043a. \u0418\u0442\u043e\u0433\u043e\u043c, \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u043b\u043e\u0441\u044c \u0434\u043e \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0445 20-25 \u043c\u0438\u043d\u0443\u0442 \u0434\u043b\u044f 7 \u0440\u043e\u043b\u0435\u0439.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/u5\/tb\/n8\/u5tbn8xgqjzbnvtlqjpdsa17mmc.png\"><\/p>\n<p>  <\/p>\n<p>\u0423\u0432\u0435\u043b\u0438\u0447\u0438\u0432 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u043c\u044b\u0445 \u0440\u043e\u043b\u0435\u0439 \u0434\u043e 17 \u0438 \u043b\u0438\u043d\u0442\u043e\u0432\u043a\u0443 45 \u0440\u043e\u043b\u0435\u0439 \u043c\u044b \u043f\u0440\u043e\u0433\u043e\u043d\u044f\u043b\u0438 \u044d\u0442\u043e \u0437\u0430 28 \u043c\u0438\u043d\u0443\u0442 \u043d\u0430 2 jenkins slave.<\/p>\n<p>  <\/p>\n<h3 id=\"den--167-dobavlyaem-na-proekt-testy-ansible\">\u0414\u0435\u043d\u044c \u2116 167: \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442 \u0442\u0435\u0441\u0442\u044b Ansible<\/h3>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/di\/zi\/cz\/diziczzal8qnxt6azdlyhptniho.png\"><\/p>\n<p>  <\/p>\n<p>\u0421 \u043d\u0430\u0441\u043a\u043e\u043a\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430, \u0441\u043a\u043e\u0440\u0435\u0439 \u0432\u0441\u0435\u0433\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f. \u0417\u0430\u0434\u0430\u0447\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0438\u0437\u043c\u0435\u0440\u0438\u043c\u043e\u0439, \u0447\u0442\u043e \u0431\u044b \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0435\u0435 \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u043d\u0430 \u043c\u0435\u043b\u043a\u0438\u0435 \u043a\u0443\u0441\u043e\u0447\u043a\u0438 \u0438 \u0441\u044a\u0435\u0441\u0442\u044c \u0441\u043b\u043e\u043d\u0430 \u043f\u043e \u0447\u0430\u0441\u0442\u044f\u043c \u0447\u0430\u0439\u043d\u043e\u0439 \u043b\u043e\u0436\u043a\u043e\u0439. \u0414\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043b\u0438 \u0432\u044b \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u0434\u0435\u0442 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435, \u0434\u043e\u043b\u0433\u043e \u043b\u0438 \u0435\u0449\u0435 \u0438\u0434\u0442\u0438.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/rp\/hs\/tb\/rphstbmcna7nbyocuotat9hbwv0.png\"><\/p>\n<p>  <\/p>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c \u043d\u0435 \u0441\u0443\u0442\u044c \u0432\u0430\u0436\u043d\u043e \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 \u0431\u0443\u043c\u0430\u0436\u043a\u0443, \u043c\u043e\u0436\u043d\u043e \u043a\u043b\u0435\u0438\u0442\u044c \u0441\u0442\u0438\u043a\u0435\u0440\u044b \u043d\u0430 \u0448\u043a\u0430\u0444, \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0430\u0441\u043a\u0438 \u0432 jira, \u0430 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0432\u0435\u0441\u0442\u0438 google docs \u0418 \u0442\u0443\u0434\u0430 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0441\u0442\u0430\u0442\u0443\u0441. \u041d\u043e\u0433\u0438 \u0440\u0430\u0441\u0442\u0443\u0442 \u0438\u0437 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0435 \u0441\u0438\u044e\u043c\u0438\u043d\u0443\u0442\u043d\u044b\u0439, \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u043b\u0433\u0438\u0439 \u0438 \u043d\u0443\u0434\u043d\u044b\u0439. \u041c\u0430\u043b\u043e\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043a\u0442\u043e-\u0442\u043e \u0445\u043e\u0447\u0435\u0442, \u0447\u0442\u043e \u0431\u044b \u0437\u0430 \u0432\u0440\u0435\u043c\u044f \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0432\u044b \u043f\u0435\u0440\u0435\u0433\u043e\u0440\u0435\u043b\u0438 \u0438\u0434\u0435\u0439, \u0443\u0441\u0442\u0430\u043b\u0438 \u0438 \u0437\u0430\u0431\u0438\u043b\u0438.<\/p>\n<p>  <\/p>\n<p>\u0420\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433 \u043f\u0440\u043e\u0441\u0442:<\/p>\n<p>  <\/p>\n<ul>\n<li>Eat.<\/li>\n<li>Sleep.<\/li>\n<li>Code.<\/li>\n<li>IaC test.<\/li>\n<li>Repeat<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0438 \u0442\u0430\u043a \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c \u043f\u043e\u043a\u0430 \u043d\u0435 \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0435\u043c \u043d\u0430\u043c\u0435\u0447\u0435\u043d\u043d\u043e\u0439 \u0446\u0435\u043b\u0438.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/wf\/h8\/tg\/wfh8tgcdwlkb60nb-kfsyqjrxgy.png\"><\/p>\n<p>  <\/p>\n<p>\u0412\u0441\u0435 \u0441\u0440\u0430\u0437\u0443 \u043d\u0430\u0447\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0443 \u043d\u0430\u0441 \u043f\u0435\u0440\u0432\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0431\u044b\u043b\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u0441 \u043b\u0438\u043d\u0442\u043e\u0432\u043a\u0438 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430. <\/p>\n<p>  <\/p>\n<h3 id=\"den--181-green-build-master\">\u0414\u0435\u043d\u044c \u2116 181: Green Build Master<\/h3>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/lw\/ow\/xi\/lwowxis0izoohgthm9db7nheih4.png\"><\/p>\n<p>  <\/p>\n<p>\u041b\u0438\u043d\u0442\u043e\u0432\u043a\u0430 \u044d\u0442\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 \u0448\u0430\u0433 \u043a Green Build Master. \u042d\u0442\u043e \u043f\u043e\u0447\u0442\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0441\u043b\u043e\u043c\u0430\u0435\u0442, \u043d\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043e\u0442\u043b\u0430\u0434\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0435\u043b\u0435\u043d\u0435\u043d\u044c\u043a\u0438\u0435 \u0431\u0438\u043b\u0434\u044b \u0432 jenkins. \u0418\u0434\u0435\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0431\u044b \u0432\u044b\u0440\u0430\u0431\u0430\u0442\u044c \u043f\u0440\u0438\u0432\u044b\u0447\u043a\u0438 \u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u041a\u0440\u0430\u0441\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u043f\u043b\u043e\u0445\u043e.<\/li>\n<li>\u041f\u0440\u0438\u0448\u0451\u043b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0437\u0430\u043e\u0434\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0439 \u043a\u043e\u0434 \u0447\u0443\u0442\u044c \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c \u043e\u043d \u0431\u044b\u043b \u0434\u043e \u0442\u0435\u0431\u044f.<\/li>\n<\/ul>\n<p>  <\/p>\n<h3 id=\"den--193-ot-lintovki-k-unit-testam\">\u0414\u0435\u043d\u044c \u2116 193: \u041e\u0442 \u043b\u0438\u043d\u0442\u043e\u0432\u043a\u0438 \u043a unit \u0442\u0435\u0441\u0442\u0430\u043c<\/h3>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/eq\/v-\/0b\/eqv-0bs92a557nhsifvggktxmps.png\"><\/p>\n<p>  <\/p>\n<p>\u0412\u044b\u0441\u0442\u0440\u043e\u0438\u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0432 \u043c\u0430\u0441\u0442\u0435\u0440 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u044d\u0442\u0430\u043f\u043d\u043e\u0433\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u2014 \u0437\u0430\u043c\u0435\u043d\u044f\u044f \u043b\u0438\u043d\u0442\u043e\u0432\u043a\u0443 \u043d\u0430 \u0437\u0430\u043f\u0443\u0441\u043a \u0440\u043e\u043b\u0435\u0439, \u043c\u043e\u0436\u043d\u043e \u0434\u0430\u0436\u0435 \u0431\u0435\u0437 \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u0438. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u044f\u043d\u0442\u044c \u043a\u0430\u043a \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0440\u043e\u043b\u0438, \u043a\u0430\u043a \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442.<\/p>\n<p>  <\/p>\n<h3 id=\"den--211-ot-unit-k-integration-testam\">\u0414\u0435\u043d\u044c \u2116 211: \u041e\u0442 unit \u043a integration \u0442\u0435\u0441\u0442\u0430\u043c<\/h3>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/2c\/xt\/8a\/2cxt8avymduqf-k8seavlobvvqa.png\"><\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 unit \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u043f\u043e\u043a\u0440\u044b\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0440\u043e\u043b\u0435\u0439 \u0438 \u0432\u0441\u0451 \u043b\u0438\u043d\u0442\u0443\u0435\u0442\u0441\u044f, \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u043a \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432. \u0422.\u0435. \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u043d\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u0438\u0440\u043f\u0438\u0447\u0438\u043a\u0430 \u0432 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435, \u0430 \u0438\u0445 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/rh\/_h\/0w\/rh_h0wompfe15rx5arn9afnna2w.png\"><\/p>\n<p>  <\/p>\n<p>\u041d\u0430 jenkins \u043c\u044b \u0433\u0435\u043d\u0435\u043d\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0430\u0434\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c \u043b\u0438\u043d\u0442\u043e\u0432\u0430\u043b\u0438 \u0440\u043e\u043b\u0438 \/ \u043f\u043b\u044d\u0439\u0431\u0443\u043a\u0438, \u043f\u043e\u0442\u043e\u043c \u044e\u043d\u0438\u0442 \u0442\u0435\u0441\u0442\u044b \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445 \u0438 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b.<\/p>\n<p>  <\/p>\n<h4 id=\"jenkins--docker--ansible--tests\">Jenkins + Docker + Ansible = Tests<\/h4>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/e6\/3d\/0s\/e63d0sm28xvpn-hlhze5bo4c8jo.png\"><\/p>\n<p>  <\/p>\n<ol>\n<li>Checkout\u00a0repo\u00a0and generate build stages.<\/li>\n<li>Run lint playbook stages in parallel.<\/li>\n<li>Run lint role stages in parallel.<\/li>\n<li>Run\u00a0syntax check role stages in parallel.<\/li>\n<li>Run\u00a0test role stages in parallel.<br \/> \n<ol>\n<li>Lint role.<\/li>\n<li>Check dependency on other roles.<\/li>\n<li>Check syntax.<\/li>\n<li>Create docker instance<\/li>\n<li>Run molecule\/default\/playbook.yml.<\/li>\n<li>Check\u00a0idempotency.<\/li>\n<\/ol>\n<\/li>\n<li>Run integration tests<\/li>\n<li>Finish<\/li>\n<\/ol>\n<p>  <\/p>\n<h3 id=\"den--271-bus-factor\">\u0414\u0435\u043d\u044c \u2116 271: Bus Factor<\/h3>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/cj\/tb\/wg\/cjtbwgo4xb1j7umm75vvpjph8wk.png\"><\/p>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u043e\u043c \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u0430\u0441\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0433\u0440\u0443\u043f\u043f\u0430 \u043b\u044e\u0434\u0435\u0439 \u0432 \u043f\u0430\u0440\u0443-\u0442\u0440\u043e\u0439\u043a\u0443 \u0447\u0435\u043b\u043e\u0432\u0435\u043a. \u041e\u043d\u0438 \u0434\u0435\u043b\u0430\u043b\u0438 \u0440\u0435\u0432\u044c\u044e \u043a\u043e\u0434\u0430 \u0432 \u043c\u0430\u0441\u0442\u0435\u0440e. \u0421\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u0432\u044b\u0440\u0430\u0431\u0430\u0442\u043e\u043b\u043e\u0441\u044c \u0437\u043d\u0430\u043d\u0438\u0435 \u043a\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u0438 code review \u0441\u043f\u043e\u0441\u043e\u0431\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044e \u0437\u043d\u0430\u043d\u0438\u0439 \u043e\u0431 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0438 \u0442\u043e\u043c \u043a\u0430\u043a \u043e\u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u0430. \u0418\u0437\u044e\u043c\u0438\u043d\u043a\u043e\u0439 \u0437\u0434\u0435\u0441\u044c \u0431\u044b\u043b\u043e, \u0442\u043e \u0447\u0442\u043e \u0440\u0435\u0432\u044c\u044e\u0432\u0435\u0440\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u043b\u0438\u0441\u044c \u043f\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438, \u043f\u043e \u0433\u0440\u0430\u0444\u0438\u043a\u0443, \u0442.\u0435. \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0434\u043e\u043b\u0435\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0442\u044b \u0437\u0430\u043b\u0435\u0437\u0435\u0448\u044c \u0432 \u043d\u043e\u0432\u044b\u0439 \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/mr\/9n\/f3\/mr9nf3at9k4h1ishpfypwehqlqo.png\"><\/p>\n<p>  <\/p>\n<p>\u0418 \u0437\u0434\u0435\u0441\u044c \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u043e. \u0423\u0434\u043e\u0431\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0435\u0432\u044c\u044e, \u0432\u0438\u0434\u0435\u0442\u044c \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u0430\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u043e\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e, \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0439. \u041c\u044b \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438 jenkins + bitbucket + jira.<\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u043a\u0430\u043a \u0442\u0430\u043a\u043e\u0432\u043e\u0435 \u0440\u0435\u0432\u044c\u044e \u043d\u0435 \u043f\u0430\u043d\u0430\u0446\u0435\u044f, \u043a\u0430\u043a-\u0442\u043e, \u0443 \u043d\u0430\u0441 \u043f\u0440\u043e\u043b\u0435\u0437 \u0432 \u043c\u0430\u0441\u0442\u0435\u0440 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0434\u0435\u043b\u0430\u043b \u043d\u0430\u043c \u0444\u043b\u0430\u043f\u0430\u044e\u0449\u0438\u0435 \u0442\u0435\u0441\u0442\u044b:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">- get_url:     url: &quot;{{ actk_certs }}\/{{ item.1 }}&quot;     dest: &quot;{{ actk_src_tmp }}\/&quot;     username: &quot;{{ actk_mvn_user }}&quot;     password: &quot;{{ actk_mvn_pass }}&quot;   with_subelements:     - &quot;{{ actk_cert_list }}&quot;     - &quot;{{ actk_certs }}&quot;   delegate_to: localhost  - copy:     src: &quot;{{ actk_src_tmp }}\/{{ item.1 }}&quot;     dest: &quot;{{ actk_dst_tmp }}&quot;   with_subelements:     - &quot;{{ actk_cert_list }}&quot;     - &quot;{{ actk_certs }}&quot;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0442\u043e\u043c \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0438, \u043d\u043e \u043e\u0441\u0430\u0434\u043e\u0447\u0435\u043a \u043e\u0441\u0442\u0430\u043b\u0441\u044f.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">get_url:     url: &quot;{{ actk_certs }}\/{{ actk_item }}&quot;     dest: &quot;{{ actk_src_tmp }}\/{{ actk_item }}&quot;     username: &quot;{{ actk_mvn_user }}&quot;     password: &quot;{{ actk_mvn_pass }}&quot;   loop_control:     loop_var: actk_item   with_items: &quot;{{ actk_cert_list }}&quot;   delegate_to: localhost  - copy:     src: &quot;{{ actk_src_tmp }}\/{{ actk_item }}&quot;     dest: &quot;{{ actk_dst_tmp }}&quot;   loop_control:     loop_var: actk_item   with_items: &quot;{{ actk_cert_list }}&quot;<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"den--311-uskoryaem-testy\">\u0414\u0435\u043d\u044c \u2116 311: \u0423\u0441\u043a\u043e\u0440\u044f\u0435\u043c \u0442\u0435\u0441\u0442\u044b<\/h3>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/an\/sq\/6h\/ansq6hsvm8jzb23p9fb6aowij1y.png\"><\/p>\n<p>  <\/p>\n<p>\u0421\u043e \u0432\u0440\u0435\u043d\u0435\u043c \u0442\u0435\u0441\u0442\u043e\u0432 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u043e\u0441\u044c \u0431\u043e\u043b\u044c\u0448\u0435, \u0431\u0438\u043b\u0434\u044b \u0431\u0435\u0436\u0430\u043b\u0438 \u043c\u0435\u0434\u043b\u0435\u043d\u0435\u0435 \u0434\u043e \u0447\u0430\u0441\u0430 \u0432 \u043f\u043b\u043e\u0445\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435. \u041d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0440\u0435\u0442\u0440\u043e \u0431\u044b\u043b\u0430 \u0444\u0440\u0430\u0437\u0430 \u043f\u043e \u0442\u0438\u043f\u0443 &quot;\u0445\u043e\u0440\u043e\u0448\u043e \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0442\u0435\u0441\u0442\u044b, \u043d\u043e \u043e\u043d\u0438 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0435&quot;. \u0412 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u043e\u0442\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u043e\u0442 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d\u0430\u0445 \u0438 \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u043f\u043e\u0434 docker, \u0434\u0430\u0431\u044b \u0431\u044b\u043b\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435. \u0422\u0430\u043a \u0436\u0435 \u0437\u0430\u043c\u0435\u043d\u0438\u043b\u0438 testinfra \u043d\u0430 ansible verifier \u0447\u0442\u043e \u0431\u044b \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u043a\u043e\u043b-\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/hl\/y5\/ix\/hly5ixtdz684mku874jgc2hb8su.png\"><\/p>\n<p>  <\/p>\n<p>\u0421\u0442\u0440\u043e\u0433\u043e \u0433\u043e\u0432\u043e\u0440\u044f \u0442\u0443\u0442 \u0431\u044b\u043b \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441 \u043c\u0435\u0440:<\/p>\n<p>  <\/p>\n<ol>\n<li>\u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 docker.<\/li>\n<li>\u0423\u0431\u0440\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u043e\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0434\u0443\u0431\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0437\u0430 \u0441\u0447\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/li>\n<li>\u0423\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u043a\u043e\u043b-\u0432\u043e \u0441\u043b\u044d\u0439\u0432\u043e\u0432.<\/li>\n<li>\u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0442\u0435\u0441\u0442\u043e\u0432.<\/li>\n<li>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043b\u0438\u043d\u0442\u043e\u0432\u0430\u0442\u044c <strong>\u0412\u0421\u0401<\/strong> \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439.<\/li>\n<\/ol>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/0t\/re\/rf\/0trerfuwmb5rigsb7ueykjyrbvg.png\"><\/p>\n<p>  <\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 Pipeline \u043d\u0430 jenkins \u0442\u043e\u0436\u0435 \u0443\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f<\/p>\n<p>  <\/p>\n<ol>\n<li>Generate build stages.<\/li>\n<li>Lint all in parallel.<\/li>\n<li>Run\u00a0test role stages in parallel.<\/li>\n<li>Finish.<\/li>\n<\/ol>\n<p>  <\/p>\n<h2 id=\"lessons-learned\">Lessons learned<\/h2>\n<p>  <\/p>\n<h3 id=\"avoid-global-variables\">Avoid global variables<\/h3>\n<p>  <\/p>\n<p>Ansible \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0435\u0441\u0442\u044c \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u0439 workaround \u0432 \u0432\u0438\u0434\u0435 <a href=\"https:\/\/docs.ansible.com\/ansible\/latest\/reference_appendices\/config.html#default-private-role-vars\" rel=\"nofollow\">private_role_vars<\/a>, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u043f\u0430\u043d\u0430\u0446\u0435\u044f. <\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440. \u041f\u0443\u0441\u0442\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c <code>role_a<\/code> \u0438 <code>role_b<\/code><\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\"># cat role_a\/defaults\/main.yml --- msg: a  # cat role_a\/tasks\/main.yml --- - debug:     msg: role_a={{ msg }}<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\"># cat role_b\/defaults\/main.yml --- msg: b  # cat role_b\/tasks\/main.yml --- - set_fact:     msg: b - debug:     msg: role_b={{ msg }}<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">- hosts: localhost   vars:     msg: hello   roles:     - role: role_a     - role: role_b   tasks:     - debug:         msg: play={{msg}}<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yo\/6j\/mn\/yo6jmnxymfxjseigrda7hcjkysk.png\"><\/p>\n<p>  <\/p>\n<p>\u0417\u0430\u0431\u0430\u0432\u043d\u0430\u044f \u0432\u0435\u0449\u044c, \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043b\u044d\u0439\u0431\u0443\u043a\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0441\u0442\u0438 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0440\u043e\u043b\u0435\u0439. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u044d\u0442\u043e \u0432 \u043d\u0430\u0442\u0443\u0440\u0435 Ansible \u0438 \u043b\u0443\u0447\u0448\u0435\u0435 \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u043d\u0443\u0442\u0440\u0438 \u0440\u043e\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432 \u044d\u0442\u043e\u0439 \u0440\u043e\u043b\u0438.<\/p>\n<p>  <\/p>\n<p><strong>BAD<\/strong>: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\"># cat roles\/some_role\/tasks\/main.yml --- debug:   var: java_home<\/code><\/pre>\n<p>  <\/p>\n<p><strong>GOOD<\/strong>: \u0412 <code>defaults<\/code> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438 \u043f\u043e\u0437\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0445.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\"># cat roles\/some_role\/defaults\/main.yml --- r__java_home:  &quot;{{ java_home | default('\/path') }}&quot;  # cat roles\/some_role\/tasks\/main.yml --- debug:   var: r__java_home <\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"prefix-role-variables\">Prefix role variables<\/h3>\n<p>  <\/p>\n<p><strong>BAD<\/strong>: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\"># cat roles\/some_role\/defaults\/main.yml --- db_port: 5432<\/code><\/pre>\n<p>  <\/p>\n<p><strong>GOOD<\/strong>: \u0412 \u0440\u043e\u043b\u0438 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043e\u043c \u0438\u043c\u0435\u043d\u0438 \u0440\u043e\u043b\u0438, \u044d\u0442\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u043d\u0430 inventory \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043f\u0440\u043e\u0449\u0435 \u043f\u043e\u043d\u044f\u0442\u044c \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\"># cat roles\/some_role\/defaults\/main.yml --- some_role__db_port: 5432<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"use-loop-control-variable\">Use loop control variable<\/h3>\n<p>  <\/p>\n<p><strong>BAD<\/strong>: \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0446\u0438\u043a\u043b\u0430\u0445 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>item<\/code>, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e\u0442 \u0442\u0430\u0441\u043a\/\u043f\u043b\u044d\u0439\u0431\u0443\u043a \u0431\u0443\u0434\u0435\u0442 \u0433\u0434\u0435-\u0442\u043e \u0437\u0430\u0438\u043d\u043a\u043b\u044e\u0434\u0430\u043d \u0442\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043d\u0435 \u043f\u0440\u0435\u0434\u0432\u0438\u0434\u0435\u043d\u043d\u043e\u043c\u0443 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">--- - hosts: localhost   tasks:     - debug:         msg: &quot;{{ item }}&quot;       loop:         - item1         - item2 <\/code><\/pre>\n<p>  <\/p>\n<p><strong>GOOD<\/strong>: \u041f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0432 \u0446\u0438\u043a\u043b\u0435 \u0447\u0435\u0440\u0435\u0437 <code>loop_var<\/code>.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">--- - hosts: localhost   tasks:     - debug:         msg: &quot;{{ item_name }}&quot;       loop:         - item1         - item2       loop_control:         loop_var: item_name <\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"check-input-variables\">Check input variables<\/h3>\n<p>  <\/p>\n<p>\u041c\u044b \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u043b\u0438\u0441\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u044b \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043b\u0438\u0448\u043d\u0438\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0447\u0442\u043e \u043e\u043d\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u043a\u0430\u043a \u043c\u044b \u043e\u0436\u0438\u0434\u0430\u0435\u043c \u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0435 \u0431\u044b\u043b\u0438 \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0442\u044b \u043f\u0443\u0441\u0442\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c<\/p>\n<p>  <\/p>\n<p><strong>GOOD<\/strong>: \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">- name: &quot;Verify that required string variables are defined&quot;   assert:     that: ahs_var is defined and ahs_var | length &gt; 0 and ahs_var != None     fail_msg: &quot;{{ ahs_var }} needs to be set for the role to work &quot;     success_msg: &quot;Required variables {{ ahs_var }} is defined&quot;   loop_control:     loop_var: ahs_var   with_items:     - ahs_item1     - ahs_item2     - ahs_item3<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"avoid-hashes-dictionaries-use-flat-structure\">Avoid hashes dictionaries, use flat structure<\/h3>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0440\u043e\u043b\u044c \u043e\u0436\u0438\u0434\u0430\u0435\u0442 hash\/dictionary \u0432 \u043e\u0434\u043d\u043e\u043c\u0443 \u0438\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0442\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u0437\u0430\u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u0437 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0432\u0435\u0441\u044c hash\/dictionary, \u0447\u0442\u043e \u043f\u043e\u0432\u044b\u0441\u0438\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p><strong>BAD<\/strong>: \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c hash\/dictionary.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">--- user:   name: admin   group: admin<\/code><\/pre>\n<p>  <\/p>\n<p><strong>GOOD<\/strong>: \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043b\u043e\u0441\u043a\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">--- user_name: admin user_group: &quot;{{ user_name }}&quot;<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"create-idempotent-playbooks--roles\">Create idempotent playbooks &amp; roles<\/h3>\n<p>  <\/p>\n<p>\u0420\u043e\u043b\u0438 \u0438 \u043f\u043b\u044d\u0439\u0431\u0443\u043a\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u044b\u043c\u0438, \u0442.\u043a. \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442 configuration drift \u0438 \u0441\u0442\u0440\u0430\u0445 \u0441\u043b\u043e\u043c\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e. \u041d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 molecule \u0442\u043e \u044d\u0442\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<p>  <\/p>\n<h3 id=\"avoid-using-command-shell-modules\">Avoid using command shell modules<\/h3>\n<p>  <\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 shell \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0438\u043c\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u0440\u0430\u0434\u0438\u0433\u043c\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f, \u0432\u043c\u0435\u0441\u0442\u043e \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 Ansible.<\/p>\n<p>  <\/p>\n<h3 id=\"test-your-roles-via-molecule\">Test your roles via molecule<\/h3>\n<p>  <\/p>\n<p>Molecule \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0435\u0441\u044c\u043c\u0430 \u0433\u0438\u0431\u043a\u0430 \u0448\u0442\u0443\u043a\u0430, \u0434\u0430\u0432\u0430\u0439 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432.<\/p>\n<p>  <\/p>\n<h4 id=\"molecule-multiple-instances\">Molecule Multiple instances<\/h4>\n<p>  <\/p>\n<p>\u0412 <code>molecule.yml<\/code> \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 <code>platforms<\/code> \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0445\u043e\u0441\u0442\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">---     driver:       name: docker     platforms:       - name: postgresql-instance         hostname: postgresql-instance         image: registry.example.com\/postgres10:latest         pre_build_image: true         override_command: false         network_mode: host       - name: app-instance         hostname: app-instance         pre_build_image: true         image: registry.example.com\/docker_centos_ansible_tests         network_mode: host<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0432\u0435\u043d\u043d\u043e \u044d\u0442\u0438 \u0445\u043e\u0441\u0442\u044b, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0442\u043e\u043c \u0432 <code>converge.yml<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">--- - name: Converge all   hosts: all   vars:     ansible_user: root   roles:     - role: some_role  - name: Converge db   hosts: db-instance   roles:     - role: some_db_role  - name: Converge app   hosts: app-instance   roles:     - role: some_app_role<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"ansible-verifier\">Ansible verifier<\/h4>\n<p>  <\/p>\n<p>\u0412 molecule \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c ansible \u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0438\u043d\u0441\u0442\u0430\u043d\u0441 \u0431\u044b\u043b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e \u044d\u0442\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0441 3 \u0440\u0435\u043b\u0438\u0437\u0430. \u042d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u0433\u0438\u0431\u043a\u043e \u043a\u0430\u043a testinfra\/inspec, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c, \u0447\u0442\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0430\u0448\u0438\u043c \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">--- - name: Verify   hosts: all   tasks:     - name: copy config       copy:         src: expected_standalone.conf         dest: \/root\/wildfly\/bin\/standalone.conf         mode: &quot;0644&quot;         owner: root         group: root       register: config_copy_result      - name: Certify that standalone.conf changed       assert:         that: not config_copy_result.changed<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418\u043b\u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441, \u0434\u043e\u0436\u0434\u0430\u0442\u044c\u0441\u044f \u0435\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c smoke test:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">---   - name: Verify     hosts: solr     tasks:       - command: \/blah\/solr\/bin\/solr start -s \/solr_home -p 8983 -force       - uri:           url: http:\/\/127.0.0.1:8983\/solr           method: GET           status_code: 200         register: uri_result         until: uri_result is not failed         retries: 12         delay: 10       - name: Post documents to solr         command: \/blah\/solr\/bin\/post -c master \/exampledocs\/books.csv<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"put-complex-logic-into-modules--plugins\">Put complex logic into modules &amp; plugins<\/h3>\n<p>  <\/p>\n<p>Ansible \u043f\u0440\u043e\u043f\u043e\u0432\u0435\u0434\u0443\u0442 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0434\u0435\u043b\u0430\u0435\u0442\u0435 \u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430, \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445, shell \u043c\u043e\u0434\u0443\u043b\u0438, \u0442\u043e \u043a\u043e\u0434 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u043e \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c. \u0427\u0442\u043e \u0431\u044b \u043f\u043e\u0431\u043e\u0440\u043e\u0442\u044c\u0441\u044f \u0441 \u044d\u0442\u0438\u043c \u0438 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f, \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043b\u0438\u0448\u043d\u0438\u043c, \u0431\u043e\u0440\u043e\u0442\u044c\u0441\u044f \u0441 \u044d\u0442\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0443\u0442\u0451\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439.<\/p>\n<p>  <\/p>\n<h3 id=\"summorize-tips--tricks\">Summorize Tips &amp; Tricks<\/h3>\n<p>  <\/p>\n<ol>\n<li>Avoid global variables.<\/li>\n<li>Prefix role variables.<\/li>\n<li>Use loop control variable.<\/li>\n<li>Check input variables.<\/li>\n<li>Avoid hashes dictionaries, use flat structure.<\/li>\n<li>Create idempotent playbooks &amp; roles.<\/li>\n<li>Avoid using command shell modules.<\/li>\n<li>Test your roles via molecule.<\/li>\n<li>Put complex logic into modules &amp; plugins.<\/li>\n<\/ol>\n<p>  <\/p>\n<h2 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ih\/ty\/rh\/ihtyrh6qo2oufdjxheiflkp1erg.png\"><\/p>\n<p>  <\/p>\n<p>\u041d\u0435\u043b\u044c\u0437\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a \u0432\u0437\u044f\u0442\u044c \u0438 \u043e\u0442\u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0442\u044c \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 IaC. \u042d\u0442\u043e \u0434\u043e\u043b\u0433\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u0439 \u0442\u0435\u0440\u043f\u0435\u043d\u0438\u044f, \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0437\u043d\u0430\u043d\u0438\u0439.<\/p>\n<p>  <\/p>\n<h2 id=\"links\">Links<\/h2>\n<p>  <\/p>\n<ul>\n<li>Slides <a href=\"https:\/\/cloud.mail.ru\/public\/266x\/3hJ2mQBzf\" rel=\"nofollow\">How to test Ansible and don&#8217;t go nuts<\/a><\/li>\n<li>Video <a href=\"https:\/\/www.youtube.com\/watch?v=GdrJv5oypfg\" rel=\"nofollow\">How to test Ansible and don&#8217;t go nuts<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/en\/post\/467171\">\u0427\u0442\u043e \u044f \u0443\u0437\u043d\u0430\u043b, \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0432 200 000 \u0441\u0442\u0440\u043e\u043a \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/en\/post\/500040\/\">Ansible: \u041c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 120 VM c Coreos \u043d\u0430 Centos \u0437\u0430 18 \u043c\u0435\u0441\u044f\u0446\u0435\u0432<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/en\/post\/342216\/\">\u041a\u0430\u043a \u043d\u0430\u043b\u043e\u043c\u0430\u0442\u044c \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u043e\u0432 \u043f\u043e\u0432\u0435\u0440\u0445 \u043a\u043e\u0441\u0442\u044b\u043b\u0435\u0439 \u043f\u0440\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0432\u043e\u0435\u0433\u043e \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0430<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/en\/post\/437004\/\">\u041f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0439 \u043c\u0435\u043d\u044f \u0435\u0441\u043b\u0438 \u0441\u043c\u043e\u0436\u0435\u0448\u044c \u0438\u043b\u0438 \u043c\u0435\u0447\u0442\u0430\u044e\u0442 \u043b\u0438 YML \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b \u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 ansible?<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/ultral\/awesome-iac-testing\" rel=\"nofollow\">A list of awesome IaC testing articles, speeches &amp; links<\/a><\/li>\n<li><a href=\"http:\/\/www.goncharov.xyz\/it\/ansible-testing-ru.html\" rel=\"nofollow\">\u043a\u0440\u043e\u0441\u0441 \u043f\u043e\u0441\u0442<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<p><strong>UPD1 2020.05.01 20:30<\/strong> \u2014 \u0414\u043b\u044f \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043b\u044d\u0439\u0431\u0443\u043a\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>callback_whitelist = profile_tasks<\/code> \u0447\u0442\u043e \u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u043e\u043b\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u043f\u043e <a href=\"https:\/\/shadow-soft.com\/turbo-charge-your-ansible\/\" rel=\"nofollow\">\u043a\u043b\u0430\u0441\u0441\u0438\u043a\u0435 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f ansible<\/a>. \u041c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/mitogen.networkgenomics.com\/ansible_detailed.html\" rel=\"nofollow\">mitogen<\/a><\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/500058\/\"> https:\/\/habr.com\/ru\/post\/500058\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/500058\/\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bk\/vw\/ds\/bkvwdsdsfvgvjf_ein3uddyocbm.png\"><\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0430 <a href=\"https:\/\/www.youtube.com\/watch?v=GdrJv5oypfg\" rel=\"nofollow\">\u0432\u044b\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f<\/a> \u043d\u0430 <a href=\"https:\/\/www.meetup.com\/DevOps-40\/events\/269140089\/\" rel=\"nofollow\">DevOps-40 2020-03-18<\/a>:<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441\u043e \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043a\u043e\u043c\u043c\u0438\u0442\u0430 \u043b\u044e\u0431\u043e\u0439 \u043a\u043e\u0434 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f legacy, \u0442.\u043a. \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u0434\u0443\u043c\u043a\u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0440\u0430\u0441\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0441 \u0441\u0443\u0440\u043e\u0432\u043e\u0439 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e. \u042d\u0442\u043e \u043d\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u0438 \u043d\u0435 \u043f\u043b\u043e\u0445\u043e, \u044d\u0442\u043e \u0434\u0430\u043d\u043d\u043e\u0441\u0442\u044c \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e \u0441\u043f\u043e\u0440\u0438\u0442\u044c \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f. \u0427\u0430\u0441\u0442\u044c\u044e \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433. \u0420\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433 Infrastructure as Code. \u0414\u0430 \u043d\u0430\u0447\u043d\u0435\u0442\u0441\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u043a\u0430\u043a \u043e\u0442\u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0442\u044c Ansible \u0437\u0430 \u0433\u043e\u0434 \u0438 \u043d\u0435 \u0441\u043b\u0435\u0442\u0435\u0442\u044c \u0441 \u043a\u0430\u0442\u0443\u0448\u0435\u043a.<\/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-302898","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/302898","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=302898"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/302898\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=302898"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=302898"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=302898"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}