{"id":282696,"date":"2016-12-19T14:00:04","date_gmt":"2016-12-19T11:00:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=282696"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=282696","title":{"rendered":"\u0414\u0435\u043f\u043b\u043e\u0439 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Ansistrano"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/bc4\/9fd\/9d2\/bc49fd9d21d24c83814a517cb24c1543.png\"\/>  <\/p>\n<p>  <\/p>\n<p>  <\/p>\n<p><strong>ansistrano.deploy<\/strong> \u0438 <strong>ansistrano.rollback<\/strong> \u2014 \u0440\u043e\u043b\u0438 Ansible, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432\u044b\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, PHP, Python \u0438 Ruby). \u041f\u043e \u0441\u0443\u0442\u0438 \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f Capistrano \u0432 Ansible.<\/p>\n<p>  <\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Ansistrano \u0434\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430: <\/p>\n<p>  <\/p>\n<ul>\n<li>\u043e\u0442\u043a\u0430\u0442 \u0437\u0430 \u0441\u0435\u043a\u0443\u043d\u0434\u044b (\u0441 \u0440\u043e\u043b\u044c\u044e ansistrano.rollback);<\/li>\n<li>\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u0432-\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u00ab\u0434\u043e\u00bb \u0438 \u00ab\u043f\u043e\u0441\u043b\u0435\u00bb \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0430\u0436\u043d\u044b\u0445 \u0448\u0430\u0433\u043e\u0432;<\/li>\n<li>\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0438\u0441\u043a\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0437\u0430 \u0441\u0447\u0435\u0442 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0440\u0435\u043b\u0438\u0437\u043e\u0432;<\/li>\n<li>\u0432\u044b\u0431\u043e\u0440 \u043c\u0435\u0436\u0434\u0443 SCP, RSYNC, GIT, SVN, HTTP Download \u0438\u043b\u0438 S3 GET-\u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f\u043c\u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f (\u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <em>unarchive<\/em>).<\/li>\n<\/ul>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h4 id=\"kak-poyavilsya-ansistrano\">\u041a\u0430\u043a \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f Ansistrano<\/h4>\n<p>  <\/p>\n<p>\u0412\u043d\u0430\u0447\u0430\u043b\u0435 \u0431\u044b\u043b <a href=\"http:\/\/capistranorb.com\/\">Capistrano<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438; \u0435\u0433\u043e \u0442\u0435\u043a\u0443\u0449\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u2014 \u043f\u043e\u0434 \u043d\u043e\u043c\u0435\u0440\u043e\u043c 3. <a href=\"https:\/\/github.com\/capistrano\/capistrano\/tree\/legacy-v2\">\u0412\u0435\u0440\u0441\u0438\u044f 2.0<\/a> \u0431\u044b\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f RoR-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0435-Rails \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430 PHP \u0438\u043b\u0438 Python, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f, \u0441\u0440\u0435\u0434\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435. \u0418 \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0445\u043e\u0440\u043e\u0448\u043e.<\/p>\n<p>  <\/p>\n<p>Capistrano 2 \u2014 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440. \u041d\u043e \u043e\u043d \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u043b\u0438\u0441\u044c \u043d\u0430 \u0442\u0440\u0435\u0442\u044c\u044e \u0432\u0435\u0440\u0441\u0438\u044e. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c, \u043f\u043e \u043c\u043d\u0435\u043d\u0438\u044e \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u0435\u0439 Ansistrano, Capistrano 3 \u043c\u0435\u043d\u0435\u0435 \u0433\u0438\u0431\u043a\u0438\u0439 \u0438 \u043d\u0435 \u0442\u0430\u043a\u043e\u0439 \u043c\u043e\u0449\u043d\u044b\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435 \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u0442\u0435\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u0443 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0434\u0440\u0443\u0433\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Ansible), \u043d\u0435 \u0441\u0442\u043e\u044f\u0442 \u043d\u0430 \u043c\u0435\u0441\u0442\u0435 \u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u0443\u044e\u0442\u0441\u044f.<\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 Ansistrano \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u044e\u0442 \u043e\u0442\u043a\u0430\u0437 \u043e\u0442 Capistrano \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435\u043c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0432\u0435\u0440\u0441\u0438\u0438 2 \u0438 \u043d\u0435\u0445\u0432\u0430\u0442\u043a\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432 v3, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0442\u0435\u043c, \u0447\u0442\u043e \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c\u044b \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Ansible. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 Fabric \u0438 Chef Solo.<\/p>\n<p>  <\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u2014 Ansistrano \u2014 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043f\u0443\u0442\u0435\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f Ansible \u0438 Capistrano. <\/p>\n<p>  <\/p>\n<h4 id=\"anonimnaya-statistika-ispolzovaniya-ansistrano\">\u0410\u043d\u043e\u043d\u0438\u043c\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Ansistrano<\/h4>\n<p>  <\/p>\n<p>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u0432 Ansistrano \u0431\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0448\u0430\u0433, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0430\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u0437\u043d\u0430\u0442\u044c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u044e\u0434\u0435\u0439 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u044e\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Ansistrano. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 Ansible Galaxy \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u043f\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430\u043c \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e, \u0430\u0432\u0442\u043e\u0440\u044b Ansistrano \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u044e\u0442, \u0447\u0442\u043e \u044d\u0442\u043e \u0431\u044b\u043b \u0447\u0443\u0442\u044c \u043b\u0438 \u043d\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u0434 \u043f\u043e \u0441\u0431\u043e\u0440\u0443 \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u0441\u043c. <a href=\"https:\/\/github.com\/ansistrano\/ansistrano.com\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u044d\u0442\u043e\u0442 <del>\u0437\u043e\u043d\u0434<\/del> \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 \u0432 <em>false<\/em> \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 <code>ansistrano_allow_anonymous_stats<\/code> \u0432\u043e \u0432\u0441\u0435\u0445 \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u0430\u0445.<\/p>\n<p>  <\/p>\n<h4 id=\"kto-ispolzuet-ansistrano\">\u041a\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 Ansistrano?<\/h4>\n<p>  <\/p>\n<p>\u0413\u043e\u0442\u043e\u0432 \u043b\u0438 Ansistrano \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e? <\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u043e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 Ansistrano:<\/b><\/p>\n<div class=\"spoiler_text\">\n<ul>\n<li><a href=\"http:\/\/www.atrapalo.com\">Atr\u00e1palo<\/a><\/li>\n<li><a href=\"http:\/\/www.anotherplaceproductions.com\">Another Place Productions<\/a><\/li>\n<li><a href=\"http:\/\/www.suntransfers.com\">Suntransfers<\/a><\/li>\n<li><a href=\"https:\/\/www.ulabox.com\">Ulabox<\/a><\/li>\n<li><a href=\"http:\/\/euromillions.com\/\">Euromillions.com<\/a><\/li>\n<li><a href=\"http:\/\/www.uvinum.com\">Uvinum<\/a><\/li>\n<li><a href=\"http:\/\/www.cycloid.io\">Cycloid<\/a><\/li>\n<li><a href=\"https:\/\/www.spotahome.com\">Spotahome<\/a><\/li>\n<li><a href=\"http:\/\/www.ofertix.com\">Ofertix<\/a><\/li>\n<li><a href=\"http:\/\/www.niceandcrazy.com\">Nice&amp;Crazy<\/a><\/li>\n<li><a href=\"http:\/\/www.g-stock.es\">Gstock<\/a><\/li>\n<li><a href=\"http:\/\/www.teamcmp.com\">CMP Group<\/a><\/li>\n<li><a href=\"http:\/\/jolicode.com\/\">Jolicode<\/a><\/li>\n<li><a href=\"http:\/\/monitoring.wavecontrol.com\/ca\/public\/demo\/\">Wavecontrol<\/a><\/li>\n<li><a href=\"http:\/\/www.enalquiler.com\/\">EnAlquiler<\/a><\/li>\n<li><a href=\"http:\/\/www.abaenglish.com\/\">ABA English<\/a><\/li>\n<li><a href=\"http:\/\/oferplan.com\/\">Oferplan<\/a><\/li>\n<li><a href=\"https:\/\/yubl.me\/\">Yubl<\/a><\/li>\n<li><a href=\"http:\/\/www.fluxus.io\/\">Fluxus<\/a><\/li>\n<li>TechPump<\/li>\n<li><a href=\"http:\/\/www.nodoambar.com\/\">Nodo \u00c1mbar<\/a><\/li>\n<li><a href=\"https:\/\/www.cabissimo.com\">Cabissimo<\/a><\/li>\n<li><a href=\"https:\/\/www.unicef.es\">UNICEF Comit\u00e9 Espa\u00f1ol<\/a><\/li>\n<li><a href=\"http:\/\/www.claranet.fr\/\">Claranet France<\/a><\/li>\n<li><a href=\"http:\/\/opsway.com\">OpsWay Software Factory<\/a><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<p>  <\/p>\n<h4 id=\"ustanovka-i-obnovlenie\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435<\/h4>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 Ansistrano \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f:<\/p>\n<p>  <\/p>\n<ul>\n<li>Ansible \u043d\u0430 \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435;<\/li>\n<li><code>rsync<\/code> \u043d\u0430 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 (\u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f <code>rsync<\/code>, <code>git<\/code> \u0438\u043b\u0438 <code>ansistrano_current_via = rsync<\/code>).<\/li>\n<\/ul>\n<p>  <\/p>\n<p>Ansistrano \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0447\u0435\u0440\u0435\u0437 <a href=\"https:\/\/galaxy.ansible.com\/\">Ansible Galaxy<\/a>. \u0427\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ ansible-galaxy install carlosbuenosvinos.ansistrano-deploy carlosbuenosvinos.ansistrano-rollback<\/code><\/pre>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c Ansistrano, \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <strong>&#8212;force<\/strong>:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ ansible-galaxy install --force carlosbuenosvinos.ansistrano-deploy carlosbuenosvinos.ansistrano-rollback<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"osnovnaya-shema-raboty\">\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b<\/h4>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 Ansistrano \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u0442\u043e\u0439 \u0436\u0435 \u0441\u0445\u0435\u043c\u0435, \u0447\u0442\u043e \u0438 \u0432 Capistrano.<\/p>\n<p>  <\/p>\n<ul>\n<li>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 (Setup): \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0440\u0435\u043b\u0438\u0437\u043e\u0432.<\/li>\n<li>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 (Code update): \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0440\u0435\u043b\u0438\u0437\u0430 \u043d\u0430 \u0446\u0435\u043b\u0435\u0432\u044b\u0435 \u043c\u0430\u0448\u0438\u043d\u044b.<\/li>\n<li>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0441\u044b\u043b\u043e\u043a (Symlink): \u043f\u043e\u0441\u043b\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u0440\u0435\u043b\u0438\u0437\u0430 \u043d\u0430 \u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u043c\u0430\u0448\u0438\u043d\u0430\u0445 \u0441\u0441\u044b\u043b\u043a\u0430 <code>current<\/code> \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043d\u043e\u0432\u044b\u0439 \u0440\u0435\u043b\u0438\u0437.<\/li>\n<li>\u041e\u0447\u0438\u0441\u0442\u043a\u0430 (Cleanup): \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 <code>ansistrano_keep_releases<\/code> \u0443\u0434\u0430\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u0442\u0430\u0440\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 (\u0441\u043c. \u00ab\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0440\u043e\u043b\u0438\u00bb).<\/li>\n<\/ul>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/134\/9bc\/5e5\/1349bc5e5eb745a28888380aaec5713c.png\"\/>  <\/p>\n<p>  <\/p>\n<p>  <\/p>\n<h4 id=\"peremennye-roli\">\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0440\u043e\u043b\u0438<\/h4>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0434\u043b\u044f \u0441\u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 Ansistrano.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u043f\u0438\u0441\u043e\u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0440\u043e\u043b\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">- vars:   ansistrano_deploy_from: &quot;{{ playbook_dir }}&quot; # \u0420\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 (\u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0438\u043b\u0438 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0439 \u043f\u0443\u0442\u044c).   ansistrano_deploy_to: &quot;\/var\/www\/my-app&quot; # \u041f\u0443\u0442\u044c \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f.   ansistrano_version_dir: &quot;releases&quot; # \u0418\u043c\u044f \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u0441 \u0440\u0435\u043b\u0438\u0437\u0430\u043c\u0438.   ansistrano_current_dir: &quot;current&quot; # \u0418\u043c\u044f \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0440\u0435\u043b\u0438\u0437, \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u0434\u043a\u043e.   ansistrano_current_via: &quot;symlink&quot; # \u0421\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 &quot;current&quot;. \u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b: &quot;symlink&quot; \u0438\u043b\u0438 &quot;rsync&quot;.   ansistrano_shared_paths: [] # \u041e\u0431\u0449\u0438\u0435 \u043f\u0443\u0442\u0438 \u0434\u043b\u044f \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0441 \u0440\u0435\u043b\u0438\u0437\u043e\u043c.   ansistrano_shared_files: [] # \u041e\u0431\u0449\u0438\u0435 \u0444\u0430\u0439\u043b\u044b \u0434\u043b\u044f \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0441 \u0440\u0435\u043b\u0438\u0437\u043e\u043c.   ansistrano_keep_releases: 0 # \u0420\u0435\u043b\u0438\u0437\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c. \u0421\u043c. \u00ab\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0440\u044b\u0445 \u0440\u0435\u043b\u0438\u0437\u043e\u0432\u00bb.   ansistrano_deploy_via: &quot;rsync&quot; # \u041c\u0435\u0442\u043e\u0434 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u043a\u043e\u0434\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440. \u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b: &quot;copy&quot;, &quot;rsync&quot;, &quot;git&quot;, &quot;svn&quot;, &quot;s3&quot; \u0438\u043b\u0438 &quot;download&quot;. \u0414\u043b\u044f &quot;copy&quot;, &quot;download&quot; \u0438 &quot;s3&quot; \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u0430\u0442\u044c (unarchive) \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b (\u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c &quot;_unarchive&quot;). \u041f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043e\u043f\u0446\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 *tasks\/update-code*.   ansistrano_allow_anonymous_stats: yes    # \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u043f\u0440\u0438 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f &quot;rsync&quot;    ansistrano_rsync_extra_params: &quot;&quot; # \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u043f\u0440\u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e rsync \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439. \u0425\u043e\u0442\u044f Ansible \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 &quot;--include&quot;. \u0421\u043c. \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043e\u0442\u0447\u0435\u0442 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 https:\/\/github.com\/ansistrano\/deploy\/commit\/e98942dc969d4e620313f00f003a7ea2eab67e86   ansistrano_rsync_set_remote_user: yes # \u0421\u043c. [ansible synchronize module](http:\/\/docs.ansible.com\/ansible\/synchronize_module.html). \u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b: &quot;yes&quot;, &quot;no&quot;.    # \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u043f\u0440\u0438 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f Git   ansistrano_git_repo: git@github.com:USERNAME\/REPO.git # \u0420\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f git.   ansistrano_git_branch: master # \u041a\u0430\u043a\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0446\u0435\u043b\u044b\u0439 40-\u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u044b\u0439 \u0445\u0435\u0448 SHA-1, \u043b\u0438\u0442\u0435\u0440\u0430\u043b HEAD, \u0438\u043c\u044f \u0432\u0435\u0442\u043a\u0438 \u0438\u043b\u0438 \u0438\u043c\u044f \u0442\u0435\u0433\u0430 (tag name).   ansistrano_git_repo_tree: &quot;&quot; # \u0415\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0435\u0432\u043e (subtree) \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f.   ansistrano_git_identity_key_path: &quot;&quot; # \u0415\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u043e, \u0442\u043e \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430 \u0434\u043b\u044f \u043a\u043e\u043c\u0430\u043d\u0434 git, \u043f\u0443\u0442\u044c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f.    # \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u043f\u0440\u0438 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f SVN    # \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435: \u0432 Ansible 1.8.x \u0431\u044b\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 subversion (https:\/\/github.com\/ansible\/ansible-modules-core\/issues\/370), \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u044d\u0442\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0441 Ansible 1.9.   ansistrano_svn_repo: &quot;https:\/\/svn.company.com\/project&quot; # \u0420\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f svn   ansistrano_svn_branch: &quot;trunk&quot; # \u041a\u0430\u043a\u0443\u044e \u0432\u0435\u0442\u043a\u0443 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c.   ansistrano_svn_revision: &quot;HEAD&quot; # \u041a\u0430\u043a\u0443\u044e \u0440\u0435\u0432\u0438\u0437\u0438\u044e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c.   ansistrano_svn_username: &quot;user&quot; # SVN authentication username   ansistrano_svn_password: &quot;Pa$$word&quot; # SVN authentication password    # \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u043f\u0440\u0438 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f download    ansistrano_get_url: https:\/\/github.com\/someproject\/somearchive.tar.gz    # \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u043f\u0440\u0438 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f S3    ansistrano_s3_bucket: s3bucket   ansistrano_s3_object: s3object.tgz # \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u0443\u0444\u0444\u0438\u043a\u0441 _unarchive \u043a  ansistrano_deploy_via, \u0435\u0441\u043b\u0438 \u0432\u0430\u0448 \u043e\u0431\u044a\u0435\u043a\u0442 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0430\u043a\u0435\u0442\u043e\u043c (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, s3_unarchive)   ansistrano_s3_region: eu-west-1   ansistrano_s3_rgw: false # \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c Ansible &gt;= 2.2, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 Ceph RGW (\u043a\u043e\u0433\u0434\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u0432 &quot;true&quot;, \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0439\u0442\u0435 ansistrano_s3_region)   ansistrano_s3_url: http:\/\/rgw.example.com # \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 Ceph RGW \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 url   # \u041d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e   ansistrano_s3_aws_access_key: YOUR_AWS_ACCESS_KEY   ansistrano_s3_aws_secret_key: YOUR_AWS_SECRET_KEY    # Hooks: (\u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439)   ansistrano_before_setup_tasks_file: &quot;{{ playbook_dir }}\/&lt;your-deployment-config&gt;\/my-before-setup-tasks.yml&quot;   ansistrano_after_setup_tasks_file: &quot;{{ playbook_dir }}\/&lt;your-deployment-config&gt;\/my-after-setup-tasks.yml&quot;   ansistrano_before_update_code_tasks_file: &quot;{{ playbook_dir }}\/&lt;your-deployment-config&gt;\/my-before-update-code-tasks.yml&quot;   ansistrano_after_update_code_tasks_file: &quot;{{ playbook_dir }}\/&lt;your-deployment-config&gt;\/my-after-update-code-tasks.yml&quot;   ansistrano_before_symlink_shared_tasks_file: &quot;{{ playbook_dir }}\/&lt;your-deployment-config&gt;\/my-before-symlink-shared-tasks.yml&quot;   ansistrano_after_symlink_shared_tasks_file: &quot;{{ playbook_dir }}\/&lt;your-deployment-config&gt;\/my-after-symlink-shared-tasks.yml&quot;   ansistrano_before_symlink_tasks_file: &quot;{{ playbook_dir }}\/&lt;your-deployment-config&gt;\/my-before-symlink-tasks.yml&quot;   ansistrano_after_symlink_tasks_file: &quot;{{ playbook_dir }}\/&lt;your-deployment-config&gt;\/my-after-symlink-tasks.yml&quot;   ansistrano_before_cleanup_tasks_file: &quot;{{ playbook_dir }}\/&lt;your-deployment-config&gt;\/my-before-cleanup-tasks.yml&quot;   ansistrano_after_cleanup_tasks_file: &quot;{{ playbook_dir }}\/&lt;your-deployment-config&gt;\/my-after-cleanup-tasks.yml&quot;<\/code><\/pre>\n<p>  <\/p>\n<p><code>{{ playbook_dir }}<\/code> \u2014 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f Ansible, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0445\u0440\u0430\u043d\u0438\u0442 \u043f\u0443\u0442\u044c \u043a \u0442\u0435\u043a\u0443\u0449\u0435\u043c\u0443 \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u0443.<\/p>\n<\/div>\n<\/div>\n<p>  <\/p>\n<h4 id=\"razvertyvanie\">\u0420\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435<\/h4>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Ansistrano, \u0441\u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0448\u0430\u0433\u043e\u0432.<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b <code>hosts<\/code>. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 <a href=\"http:\/\/docs.ansible.com\/intro_inventory.html\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043f\u043e Ansible Inventory<\/a>. \u0412 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u0446\u0435\u043b\u0435\u0432\u044b\u0435 \u043c\u0430\u0448\u0438\u043d\u044b. <\/li>\n<li>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 \u043f\u043b\u0435\u0439\u0431\u0443\u043a \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>deploy.yml<\/code>).<\/li>\n<li>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0440\u043e\u043b\u0438.<\/li>\n<li>\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0440\u043e\u043b\u044c <code>carlosbuenosvinos.ansistrano-deploy<\/code> \u0432 \u0441\u043a\u0440\u0438\u043f\u0442 (play).<\/li>\n<li>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043f\u043b\u0435\u0439\u0431\u0443\u043a.<\/li>\n<\/ul>\n<p>  <\/p>\n<pre><code class=\"bash\">ansible-playbook -i hosts deploy.yml<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u0431\u044b\u043b\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u044d\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435. \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435, \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043a\u0430\u0442\u0430\u043b\u043e\u0433 <em>hosts<\/em> \u043f\u043e\u0441\u043b\u0435 \u043e\u0434\u043d\u043e\u0433\u043e, \u0434\u0432\u0443\u0445 \u0438 \u0442\u0440\u0435\u0445 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0439.<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">-- \/var\/www\/my-app.com |-- current -&gt; \/var\/www\/my-app.com\/releases\/20100509145325 |-- releases |   |-- 20100509145325 |-- shared<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">-- \/var\/www\/my-app.com |-- current -&gt; \/var\/www\/my-app.com\/releases\/20100509150741 |-- releases |   |-- 20100509150741 |   |-- 20100509145325 |-- shared<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">-- \/var\/www\/my-app.com |-- current -&gt; \/var\/www\/my-app.com\/releases\/20100512131539 |-- releases |   |-- 20100512131539 |   |-- 20100509150741 |   |-- 20100509145325 |-- shared<\/code><\/pre>\n<p>  <\/p>\n<h5 id=\"posledovatelnye-razvertyvaniya\">\u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f<\/h5>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u043a \u043f\u0440\u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0438 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043e\u043f\u0446\u0438\u0438 <a href=\"http:\/\/docs.ansible.com\/playbooks_delegation.html#rolling-update-batch-size\"><code>serial<\/code><\/a>, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>ansistrano_release_version<\/code>.<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">ansible-playbook -i hosts -e &quot;ansistrano_release_version=`date -u +%Y%m%d%H%M%SZ`&quot; deploy.yml<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"otkat\">\u041e\u0442\u043a\u0430\u0442<\/h4>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043e\u0442\u043a\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u0441 Ansistrano, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u043b\u0435\u0439\u0431\u0443\u043a \u043e\u0442\u043a\u0430\u0442\u0430.<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">ansible-playbook -i hosts rollback.yml<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u043e\u0442\u043a\u0430\u0442\u0430 \u0441 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044b\u0445 \u0440\u0435\u043b\u0438\u0437\u043e\u0432, \u0440\u0430\u0432\u043d\u044b\u043c 1 \u0438\u043b\u0438 0, \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0432\u044b\u0434\u0430\u0441\u0442 \u043e\u0448\u0438\u0431\u043a\u0443; \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u043e\u0442\u043a\u0430\u0442\u0430 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435\u043c \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">- vars:   ansistrano_deploy_to: &quot;\/var\/www\/my-app&quot; # \u041f\u0443\u0442\u044c \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f.   ansistrano_version_dir: &quot;releases&quot; # \u0418\u043c\u044f \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u0441 \u0440\u0435\u043b\u0438\u0437\u0430\u043c\u0438.   ansistrano_current_dir: &quot;current&quot; # \u0418\u043c\u044f \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0440\u0435\u043b\u0438\u0437, \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u0434\u043a\u043e.    # Hooks: (\u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439)   ansistrano_before_symlink_tasks_file: &quot;{{ playbook_dir }}\/&lt;your-deployment-config&gt;\/my-before-symlink-tasks.yml&quot;   ansistrano_after_symlink_tasks_file: &quot;{{ playbook_dir }}\/&lt;your-deployment-config&gt;\/my-after-symlink-tasks.yml&quot;   ansistrano_before_cleanup_tasks_file: &quot;{{ playbook_dir }}\/&lt;your-deployment-config&gt;\/my-before-cleanup-tasks.yml&quot;   ansistrano_after_cleanup_tasks_file: &quot;{{ playbook_dir }}\/&lt;your-deployment-config&gt;\/my-after-cleanup-tasks.yml&quot;<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"mnogostadiynye-sredy-multistage-environments--devel-preprod-prod-i-t-d\">\u041c\u043d\u043e\u0433\u043e\u0441\u0442\u0430\u0434\u0438\u0439\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u044b (multistage environments) (devel, preprod, prod \u0438 \u0442. \u0434.)<\/h4>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0438 \u0432 \u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u044b (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <em>devel<\/em>, <em>preprod<\/em> \u0438 <em>prod<\/em>) \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043d\u0438\u0445 \u0440\u0430\u0437\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b <em>hosts<\/em>. \u041e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043f\u043b\u0435\u0439\u0431\u0443\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 <em>hosts<\/em>-\u0444\u0430\u0439\u043b\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 <strong>-i<\/strong>. \u0412 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437 \u044d\u0442\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0445 (\u0438\u043c\u0435\u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043f\u0430\u0440\u043e\u043b\u0438, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u0438 \u0442. \u0434.).<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">ansible-playbook -i hosts_devel deploy.yml ansible-playbook -i hosts_preprod deploy.yml ansible-playbook -i hosts_prod deploy.yml<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"hooks-polzovatelskie-zadachi-custom-tasks\">Hooks: \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 (custom tasks)<\/h4>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0448\u0430\u0433\u0430 <code>Symlink<\/code> \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440, \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0434 <code>Code update<\/code> \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0432 <em>production<\/em> \u043f\u0435\u0440\u0435\u0434 <code>Symlink<\/code>. \u0418\u0442\u0430\u043a, \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 (hooks), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 Ansistrano \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442 \u0434\u043e \u0438\u043b\u0438 \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 3 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0448\u0430\u0433\u043e\u0432. <\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">-- \/my-local-machine\/my-app.com |-- hosts |-- deploy.yml |-- my-custom-tasks |   |-- before-code-update.yml |   |-- after-code-update.yml |   |-- before-symlink.yml |   |-- after-symlink.yml |   |-- before-cleanup.yml |   |-- after-cleanup.yml<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c Apache \u043f\u043e\u0441\u043b\u0435 \u0448\u0430\u0433\u0430 <code>Symlink<\/code>, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 <code>after-symlink.yml<\/code> \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<p>  <\/p>\n<pre><code>- name: Restart Apache   service: name=httpd state=reloaded<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u043e \u043f\u043e\u0447\u0442\u0435 \u0438\u043b\u0438 \u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u043a\u0435\u0448? \u041e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e! \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0440\u043e\u043b\u0438 <code>ansistrano_before_*_tasks_file<\/code> \u0438 <code>ansistrano_after_*_tasks_file<\/code> \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c\u0438 \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438 \u0434\u043b\u044f \u0442\u043e\u0447\u0435\u043a \u00ab\u0434\u043e\u00bb \u0438 \u00ab\u043f\u043e\u0441\u043b\u0435\u00bb \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0448\u0430\u0433\u0430. <\/p>\n<p>  <\/p>\n<h4 id=\"peremennye-v-polzovatelskih-zadachah\">\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0437\u0430\u0434\u0430\u0447\u0430\u0445<\/h4>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0432 Ansistrano:<\/p>\n<p>  <\/p>\n<ul>\n<li><code>{{ ansistrano_release_path.stdout }}<\/code>: \u043f\u0443\u0442\u044c \u043a \u0442\u0435\u043a\u0443\u0449\u0435\u043c\u0443 \u0440\u0435\u043b\u0438\u0437\u0443 \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f (\u044d\u0442\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0441\u0430\u043c\u0430\u044f \u043d\u0443\u0436\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f);<\/li>\n<li><code>{{ ansistrano_releases_path.stdout }}<\/code>: \u043f\u0443\u0442\u044c \u043a \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0443 \u0441 \u0440\u0435\u043b\u0438\u0437\u0430\u043c\u0438;<\/li>\n<li><code>{{ ansistrano_shared_path.stdout }}<\/code>: \u043f\u0443\u0442\u044c \u043a \u043e\u0431\u0449\u0435\u0439 \u043f\u0430\u043f\u043a\u0435 (\u0433\u0434\u0435 \u043c\u043e\u0433\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u043e\u0431\u0449\u0438\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0440\u0435\u043b\u0438\u0437\u043e\u0432 \u0444\u0430\u0439\u043b\u044b);<\/li>\n<li><code>{{ ansistrano_release_version }}<\/code>: \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0438\u043c\u044f \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u0441 \u0440\u0435\u043b\u0438\u0437\u043e\u043c (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0440\u0430\u0432\u043d\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u0435\u0442\u043a\u0435 (timestamp) \u0432 \u0437\u043e\u043d\u0435 UTC).<\/li>\n<\/ul>\n<p>  <\/p>\n<h4 id=\"udalenie-staryh-relizov\">\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0440\u044b\u0445 \u0440\u0435\u043b\u0438\u0437\u043e\u0432<\/h4>\n<p>  <\/p>\n<p>\u0412 \u0441\u0440\u0435\u0434\u0430\u0445, \u0433\u0434\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f Continuous delivery, \u0432 \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0443\u044e \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u044e, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0441\u0434\u0430\u0435\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e \u0440\u0435\u043b\u0438\u0437\u043e\u0432. \u0422\u0435 \u0441\u0447\u0430\u0441\u0442\u043b\u0438\u0432\u0447\u0438\u043a\u0438, \u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0430 \u0434\u0438\u0441\u043a\u0430\u0445 \u0438\u0437\u0431\u044b\u0442\u043e\u043a \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043d\u0435 \u0443\u0432\u0438\u0434\u044f\u0442 \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u043d\u043e \u043e\u0431\u0449\u0435\u043f\u0440\u0438\u043d\u044f\u0442\u043e\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043b\u0438\u0448\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0440\u0435\u043b\u0438\u0437\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0441\u0442\u0430\u0440\u044b\u0435 \u0440\u0435\u043b\u0438\u0437\u044b \u043f\u043e\u0441\u043b\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f, \u0437\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>ansistrano_keep_releases<\/code> \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c.<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u0435\u0441\u0442\u0438 \u0441\u0435\u0431\u044f Ansistrano \u043f\u0440\u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0438 \u0442\u0440\u0435\u0445 \u0440\u0435\u043b\u0438\u0437\u043e\u0432 \u0438 <code>ansistrano_keep_releases: 2<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">-- \/var\/www\/my-app.com |-- current -&gt; \/var\/www\/my-app.com\/releases\/20100509145325 |-- releases |   |-- 20100509145325 |-- shared<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">-- \/var\/www\/my-app.com |-- current -&gt; \/var\/www\/my-app.com\/releases\/20100509150741 |-- releases |   |-- 20100509150741 |   |-- 20100509145325 |-- shared<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">-- \/var\/www\/my-app.com |-- current -&gt; \/var\/www\/my-app.com\/releases\/20100512131539 |-- releases |   |-- 20100512131539 |   |-- 20100509150741 |-- shared<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u043c\u0435\u0442\u044c\u0442\u0435, \u0447\u0442\u043e \u0440\u0435\u043b\u0438\u0437 <code>20100509145325<\/code> \u0431\u044b\u043b \u0443\u0434\u0430\u043b\u0435\u043d.<\/p>\n<p>  <\/p>\n<h4 id=\"primer-pleybuka\">\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u0430<\/h4>\n<p>  <\/p>\n<p>\u0412 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <code>example<\/code> \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f <a href=\"https:\/\/github.com\/ansistrano\/deploy\">Ansistrano<\/a> \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. <\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c, \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f Vagrant \u0438 \u0440\u043e\u043b\u0438 Ansistrano. \u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Vagrant \u0441\u043c. <a href=\"https:\/\/www.vagrantup.com\">https:\/\/www.vagrantup.com<\/a>.<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ cd example\/my-playbook $ vagrant up $ ansible-playbook -i hosts deploy.yml<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0444\u0430\u0439\u043b <em>index.html<\/em>, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <code>my-app<\/code>, \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442 \u043d\u0430 \u043e\u0431\u0435 \u043c\u0430\u0448\u0438\u043d\u044b, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Vagrant.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0442\u043a\u0430\u0442\u0430 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c <em>deploy.yml<\/em> \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0434\u0432\u0430\u0436\u0434\u044b (\u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043a \u0447\u0435\u043c\u0443 \u043e\u0442\u043a\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f). \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ ansible-playbook -i hosts rollback.yml<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u043f\u0430\u043f\u043a\u0435 <em>test<\/em> \u0435\u0441\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 Travis-CI.<\/p>\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:\/\/habrahabr.ru\/post\/317922\/\"> https:\/\/habrahabr.ru\/post\/317922\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/bc4\/9fd\/9d2\/bc49fd9d21d24c83814a517cb24c1543.png\"\/>  <\/p>\n<p>  <\/p>\n<p>  <\/p>\n<p><strong>ansistrano.deploy<\/strong> \u0438 <strong>ansistrano.rollback<\/strong> \u2014 \u0440\u043e\u043b\u0438 Ansible, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432\u044b\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, PHP, Python \u0438 Ruby). \u041f\u043e \u0441\u0443\u0442\u0438 \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f Capistrano \u0432 Ansible.<\/p>\n<p>  <\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Ansistrano \u0434\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430: <\/p>\n<p>  <\/p>\n<ul>\n<li>\u043e\u0442\u043a\u0430\u0442 \u0437\u0430 \u0441\u0435\u043a\u0443\u043d\u0434\u044b (\u0441 \u0440\u043e\u043b\u044c\u044e ansistrano.rollback);<\/li>\n<li>\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u0432-\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u00ab\u0434\u043e\u00bb \u0438 \u00ab\u043f\u043e\u0441\u043b\u0435\u00bb \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0430\u0436\u043d\u044b\u0445 \u0448\u0430\u0433\u043e\u0432;<\/li>\n<li>\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0438\u0441\u043a\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0437\u0430 \u0441\u0447\u0435\u0442 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0440\u0435\u043b\u0438\u0437\u043e\u0432;<\/li>\n<li>\u0432\u044b\u0431\u043e\u0440 \u043c\u0435\u0436\u0434\u0443 SCP, RSYNC, GIT, SVN, HTTP Download \u0438\u043b\u0438 S3 GET-\u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f\u043c\u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f (\u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <em>unarchive<\/em>).<\/li>\n<\/ul>\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-282696","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/282696","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=282696"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/282696\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=282696"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=282696"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=282696"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}