{"id":265105,"date":"2015-09-07T16:12:04","date_gmt":"2015-09-07T12:12:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=265105"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=265105","title":{"rendered":"Ansible \u0438 Rails \u2014 \u0433\u0438\u0431\u043a\u0430\u044f \u0437\u0430\u043c\u0435\u043d\u0430 Capistrano \u0441 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u0437\u043d\u0430\u043a\u043e\u043c\u043e\u0433\u043e \u043a\u043e\u043c\u0444\u043e\u0440\u0442\u0430"},"content":{"rendered":"<p>             Capistrano \u2014 \u043b\u044e\u0431\u0438\u043c\u044b\u0439 \u043c\u043d\u043e\u0433\u0438\u043c\u0438 rails-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u0431\u0435\u0437 \u0437\u0430\u043c\u043e\u0440\u043e\u0447\u0435\u043a \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. <a href=\"https:\/\/github.com\/capistrano\/capistrano\">Capistrano<\/a> \u2014 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u0434\u0435-\u0444\u0430\u043a\u0442\u043e \u0434\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f RoR, must-know \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u0443\u0432\u0430\u0436\u0430\u044e\u0449\u0435\u0433\u043e \u0441\u0435\u0431\u044f \u0440\u0443\u0431\u0438\u0441\u0442\u0430, \u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0432 \u0441\u0432\u043e\u0439 \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u0432\u0438\u0434\u043e\u0432\u0430\u043b\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043d\u0430 python \u0438 PHP.<br \/>  \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043a\u043e\u043c\u0444\u043e\u0440\u0442, \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043e\u0442\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f, \u0447\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043c\u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0440\u0435\u0448\u0430\u0442\u044c, \u0442\u0435\u043c \u0447\u0430\u0449\u0435 Capistrano \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043b \u0441\u0435\u0431\u044f \u043a \u043d\u0438\u043c \u043d\u0435 \u043f\u0440\u0438\u0441\u043f\u043e\u0441\u043e\u0431\u043b\u0435\u043d\u043d\u044b\u043c.<\/p>\n<p>  \u042f \u043e\u0442\u043c\u0435\u0442\u0438\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438:  <\/p>\n<ul>\n<li>\u0418\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e. \u0412\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u0441\u0432\u043e\u0435\u0439 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438, Capistrano \u0434\u0435\u043f\u043b\u043e\u0438\u0442 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044f \u043b\u0438\u0448\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438 \u0432\u044b\u0437\u043e\u0432\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<\/li>\n<li>\u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0434\u0435\u043f\u043b\u043e\u0439. \u041d\u0435\u0431\u044b\u0441\u0442\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u043e \u0443\u043c\u043d\u043e\u0436\u0438\u0442\u044c \u043d\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432.<\/li>\n<li>\u0421\u0438\u043b\u044c\u043d\u0430\u044f \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0441\u0442\u044c \u0441 \u0440\u0435\u043b\u044c\u0441\u0430\u043c\u0438. \u041a\u043e\u043d\u0444\u0438\u0433\u0438 \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 Capistrano \u043f\u0435\u0440\u0435\u043f\u043b\u0435\u0442\u0430\u044e\u0442\u0441\u044f \u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c, \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0441\u044c \u0435\u0433\u043e \u0447\u0430\u0441\u0442\u044c\u044e. \u041d\u0435\u043b\u044c\u0437\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435-\u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0434\u043b\u044f \u0440\u0430\u043d\u043d\u0435\u0433\u043e \u0432\u044b\u043a\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430) \u0431\u0435\u0437 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e rails-\u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f. \u0412 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445 Capistrano \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0443\u0445\u043e\u0434\u0438\u0442\u044c \u043e\u0442 \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0438 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e development, test \u0438 production \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f.<\/li>\n<li>\u041f\u043b\u0430\u0433\u0438\u043d\u044b \u2014 \u043f\u0430\u043b\u043a\u0430 \u043e \u0434\u0432\u0443\u0445 \u043a\u043e\u043d\u0446\u0430\u0445. \u0414\u0430\u0432\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u201c\u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c\u201d \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0442\u043e\u0439 \u0438\u043b\u0438 \u0438\u043d\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u043b\u0438\u0448\u0430\u044e\u0442 \u0432\u0430\u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a, \u043a\u0430\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u043b\u0430\u0433\u0438\u043d\u0430. \u041e \u0432\u043b\u0438\u044f\u043d\u0438\u0438 \u043b\u0438\u0448\u043d\u0438\u0445 \u201c\u0442\u0435\u043b\u043e\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0439\u201d \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u043d\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0434\u0435\u043f\u043b\u043e\u044f \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0432\u044b\u0448\u0435.<\/li>\n<li>\u0421\u043b\u043e\u0436\u043d\u044b\u0439 \u0434\u0435\u043f\u043b\u043e\u0439 \u0433\u0435\u0442\u0435\u0440\u043e\u0433\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u0422\u0440\u0435\u043d\u0434\u043e\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u043b\u0435\u0442 \u0432 \u0440\u0435\u043b\u044c\u0441\u0430\u0445 \u0441\u0442\u0430\u043b\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u0430\u043c\u044b\u0445 \u0442\u044f\u0436\u0435\u043b\u044b\u0445 (\u0431\u0435\u043a\u0433\u0440\u0430\u0443\u043d\u0434\u043d\u044b\u0445 \u0438\u043b\u0438 \u0441\u0435\u0442\u0435\u0432\u044b\u0445) \u0437\u0430\u0434\u0430\u0447 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b, \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 ruby. \u0412 \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 capistrano \u043b\u0438\u0431\u043e \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0430\u0441 \u043f\u043b\u043e\u0434\u0438\u0442\u044c \u0437\u043e\u043e\u043f\u0430\u0440\u043a \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u0438 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439.<\/li>\n<\/ul>\n<p>  \u041c\u043d\u043e\u0433\u0438\u0435 ruby-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u0435\u0440\u0435\u0448\u043b\u0438 \u043d\u0430 <a href=\"https:\/\/github.com\/mina-deploy\/mina\">Mina<\/a> \u0438\u043b\u0438 \u0440\u0435\u0448\u0430\u044e\u0442 \u0441\u0432\u043e\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0435\u0449\u0451 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u043c\u0438 \u0432\u0440\u043e\u0434\u0435 <a href=\"https:\/\/www.chef.io\/chef\/\">Chef<\/a> \u0438 <a href=\"https:\/\/puppetlabs.com\/\">Puppet<\/a>. \u0412\u0441\u0435 \u043e\u043d\u0438 \u0438\u043c\u0435\u044e\u0442 \u0441\u0432\u043e\u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438 \u0438 \u0432 \u0440\u0430\u0437\u043d\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0440\u0435\u0448\u0430\u044e\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432\u044b\u0448\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. \u041c\u043d\u0435 \u0436\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0438\u0445 \u0440\u0435\u0448\u0438\u0442\u044c \u0438\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"http:\/\/www.ansible.com\/home\">Ansible<\/a>, \u043d\u0435 \u0440\u0430\u0441\u0442\u0435\u0440\u044f\u0432 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432 Capistrano, \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u044f \u043f\u0440\u0438\u0432\u044b\u043a.<\/p>\n<p>  Ansible \u044d\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u043c\u0438 \u0438 \u0432 \u0435\u0433\u043e \u0437\u0430\u0434\u0430\u0447\u0438 \u0432\u0445\u043e\u0434\u0438\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445 \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c, \u043d\u043e \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0433\u043e \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0445\u0440\u0430\u043d\u0438\u043c\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 (\u0440\u043e\u043b\u0435\u0439 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Ansible). \u0410 \u0437\u043d\u0430\u0447\u0438\u0442 Ansible (\u043a\u0430\u043a \u0432\u043f\u0440\u043e\u0447\u0435\u043c \u0438 Chef \u0438 Puppet) \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c Capistrano \u0438 \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0441\u0447\u0435\u0442\u0435 \u043e\u043d\u0438 \u0432\u0441\u0435 \u043d\u0435 \u0438\u0434\u0443\u0442 \u0441 \u043d\u0438\u043c \u043d\u0438 \u0432 \u043a\u0430\u043a\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435. \u041e\u0434\u043d\u0430\u043a\u043e, \u0437\u0430\u0434\u0430\u0447\u0430 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0434\u0430\u0442\u044c rails-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u0434\u043b\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0438 \u0440\u0430\u0437\u044a\u044f\u0441\u043d\u0438\u0442\u044c \u043d\u0430 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043e\u0441\u043d\u043e\u0432\u044b Ansible. \u0412 \u043a\u043e\u043d\u0446\u0435 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u0432\u043e\u043b\u0448\u0435\u0431\u043d\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 <em>cap production deploy<\/em> \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u0432 <em>ansible-playbook deploy.yml -i inventory\/production<\/em><br \/>  \u041a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043a\u0430\u043a \u2014 \u043f\u0440\u043e\u0448\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430<\/h2>\n<p>  Ansible \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 \u043f\u0438\u0442\u043e\u043d\u0435. \u041d\u0435 \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0440\u0443\u0431\u0438\u0441\u0442\u0443 \u044d\u0442\u043e \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f, \u043d\u043e \u044f \u0440\u0430\u0437\u0432\u0435\u044e \u0441\u0442\u0440\u0430\u0445\u0438 \u0441\u0440\u0430\u0437\u0443 \u2014 \u043d\u0438 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u043d\u0430 \u201c\u0432\u0440\u0430\u0436\u0435\u0441\u043a\u043e\u043c\u201d \u0432\u0430\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f. \u041f\u0440\u0438\u0442\u044f\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0438\u043b\u0430 Ansible \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u0441\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0434\u0435\u043f\u043b\u043e\u044f \u044d\u0442\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u0432 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435 yml \u0441 \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0438 \u043c\u043e\u0449\u043d\u044b\u043c \u043e\u043f\u0438\u0441\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u043e\u043c.<\/p>\n<p>  \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0440\u043e\u0441\u0442\u0430\u044f ansible \u0442\u043e\u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0438 \u0431\u044b\u0441\u0442\u0440\u0430\u044f. \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c ansible \u043d\u0443\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435:  <\/p>\n<pre><code class=\"bash\">sudo easy_isntall pip sudo pip install -U ansible <\/code><\/pre>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u0443\u0442\u0438\u043b\u0438\u0442\u0430\u043c\u0438 python \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 <em>ansible-playbook<\/em>, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0438 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0435\u043f\u043b\u043e\u0439. \u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0438\u043c\u0435\u0435\u0442 \u043b\u0438\u0448\u044c \u043e\u0434\u0438\u043d \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u2014 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a playbook-\u0444\u0430\u0439\u043b\u0443.<\/p>\n<h2>Ansible-playbook<\/h2>\n<p>  <a href=\"http:\/\/docs.ansible.com\/ansible\/playbooks.html\">Playbook-\u0444\u0430\u0439\u043b<\/a> \u044d\u0442\u043e \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u043e\u0432. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e \u0441\u043b\u043e\u044f\u043c \u0438 \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u043c \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0443\u0436\u043d\u043e.<br \/>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0432\u043e\u0437\u044c\u043c\u0435\u043c <em>myawesomestartup<\/em> \u2014 \u044d\u0442\u043e \u043d\u0435\u043a\u043e\u0435 rails-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043e \u0441\u0432\u044f\u0437\u043a\u043e\u0439 passenger 5 standalone \u0438 nginx \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 <a href=\"https:\/\/github.com\/mperham\/sidekiq\">sidekiq<\/a> \u0434\u043b\u044f \u0444\u043e\u043d\u043e\u0432\u044b\u0445 \u0437\u0430\u0434\u0430\u0447. \u0424\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u2014 \u0434\u0432\u0430 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u043d \u0441\u0435\u0440\u0432\u0435\u0440\u0430:  <\/p>\n<pre><code>prima.myawesomestartup.com secunda.myawesomestartup.com <\/code><\/pre>\n<p>  \u0418 \u043e\u0434\u0438\u043d \u0441\u0442\u0435\u0439\u0434\u0436\u0438\u043d\u0433:  <\/p>\n<pre><code>plebius.myawesomestartup.com <\/code><\/pre>\n<p>  \u0412 \u043f\u0430\u043f\u043a\u0435 ansible \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043c\u0430\u0441\u0442\u0435\u0440-\u043f\u043b\u0435\u0439\u0431\u0443\u043a <em>deploy.yml<\/em>, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u0438,  <\/p>\n<pre><code>--- - hosts: hosts - include: release.yml # \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0440\u0435\u043b\u0438\u0437\u0430 - include: app.yml     # \u0437\u0430\u043f\u0443\u0441\u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432\u0435\u0431-\u043f\u0440\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f - include: sidekiq.yml # \u0437\u0430\u043f\u0443\u0441\u043a \u0432\u043e\u0440\u043a\u0435\u0440\u043e\u0432 sidekiq <\/code><\/pre>\n<p>  \u041a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <em>ansible-playbook deploy.yml<\/em>, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0434\u0435\u043f\u043b\u043e\u0439 \u0446\u0435\u043b\u0438\u043a\u043e\u043c. \u041e\u0434\u043d\u0430\u043a\u043e, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u0438 \u0438 \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0435\u0437 \u0432\u044b\u043a\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u0440\u0435\u043b\u0438\u0437\u0430.<br \/>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <em>hosts<\/em> \u0432 \u043d\u0435\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435. \u042d\u0442\u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 ansible, \u043e\u0434\u043d\u0430\u043a\u043e \u043c\u044b \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u043c \u043f\u043e \u0434\u0440\u0443\u0433\u043e\u043c\u0443, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c \u0438\u043d\u0432\u0435\u043d\u0442\u0430\u0440\u043d\u044b\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438.<\/p>\n<h2>\u0418\u043d\u0432\u0435\u043d\u0442\u0430\u0440\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h2>\n<p>  \u0414\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0433\u0440\u0443\u043f\u043f \u0445\u043e\u0441\u0442\u043e\u0432, \u0438\u0445 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0432 ansible \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b <a href=\"http:\/\/docs.ansible.com\/ansible\/intro_inventory.html\">\u0438\u043d\u0432\u0435\u043d\u0442\u0430\u0440\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b<\/a>. \u042d\u0442\u043e ini-\u0444\u0430\u0439\u043b\u044b \u0441 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u043e\u043c.<\/p>\n<p>  \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0433\u0440\u0443\u043f\u043f\u0443 \u0445\u043e\u0441\u0442\u043e\u0432:  <\/p>\n<pre><code>[hosts:children] prima secunda <\/code><\/pre>\n<p>  \u0412 \u0433\u0440\u0443\u043f\u043f\u0435 \u043e\u0431\u044a\u044f\u0432\u0438\u043c \u0441\u0430\u043c\u0438 \u0445\u043e\u0441\u0442\u044b:  <\/p>\n<pre><code>[prima] prima.myawesomestartup.com  [secunda] secunda.myawesomestartup.com <\/code><\/pre>\n<p>  \u041e\u0431\u044a\u044f\u0432\u0438\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430:  <\/p>\n<pre><code>[prima:vars] ansible_env_name=production rails_env_name=production database_name={{ lookup('env', 'PRIMA_DB_NAME') }} database_username={{ lookup('env', 'PRIMA_DB_LOGIN') }} database_password={{ lookup('env', 'PRIMA_DB_PASSWORD') }} database_host={{ lookup('env', 'PRIMA_DB_HOST') }} database_port={{ lookup('env', 'PRIMA_DB_PORT') }} <\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0435 \u043d\u0430 \u0441\u043a\u043e\u0431\u043a\u0438 \u2014 \u0432 ansible \u0432\u0441\u0435 \u0444\u0430\u0439\u043b\u044b \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c\u0438 <a href=\"http:\/\/jinja.pocoo.org\/docs\/dev\/\">Jinja2<\/a>. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0447\u0435\u0440\u0435\u0437 \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440 \u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <a href=\"http:\/\/docs.ansible.com\/ansible\/playbooks_lookups.html\">lookup<\/a> \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u0441 \u043c\u0430\u0448\u0438\u043d\u044b, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435. \u042d\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u0439 \u043a\u0430\u043a\u0443\u044e \u043b\u0438\u0431\u043e \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u0432\u0440\u043e\u0434\u0435 \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u043a\u043b\u044e\u0447\u0435\u0439 \u0438\u043b\u0438 \u0441\u0442\u0440\u043e\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0411\u0414.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 \u0432\u0430\u0448\u0435\u043c <em>~\/.bashrc<\/em> \u0438\u043b\u0438 <em>~\/.zshrc<\/em> \u0438\u043b\u0438 (\u0447\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u0438 \u043c\u0435\u043d\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e) \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u044b\u043c \u0434\u0435\u043f\u043b\u043e\u0435\u043c:  <\/p>\n<pre><code class=\"bash\">export PRIMA_DB_NAME=myawesomestartup_production export PRIMA_DB_LOGIN=myawesomestartup export PRIMA_DB_PASSWORD=secret export PRIMA_DB_HOST=db.myawesomestartup.com export PRIMA_DB_PASSWORD=3306 <\/code><\/pre>\n<p>  \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0444\u0430\u0439\u043b\u044b <em>inventory\/production<\/em> \u0438 <em>inventory\/staging<\/em> \u0446\u0435\u043b\u0438\u043a\u043e\u043c:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">inventory\/production<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>; production  [prima] prima.myawesomestartup.com  [prima:vars] ansible_env_name=production rails_env_name=production database_name={{ lookup('env', 'PRIMA_DB_NAME') }} database_username={{ lookup('env', 'PRIMA_DB_LOGIN') }} database_password={{ lookup('env', 'PRIMA_DB_PASSWORD') }} database_host{{ lookup('env', 'PRIMA_DB_HOST') }} database_port={{ lookup('env', 'PRIMA_DB_PORT') }} git_branch=master app_path=\/srv\/www\/prima.myawesomestartup.com custom_server_options=--no-friendly-error-pages sidekiq_process_number=4  [secunda] secunda.myawesomestartup.com  [secunda:vars] ansible_env_name=production rails_env_name=production database_name={{ lookup('env', 'SECUNDA_DB_NAME') }} database_username={{ lookup('env', 'SECUNDA_DB_LOGIN') }} database_password={{ lookup('env', 'SECUNDA_DB_PASSWORD') }} database_host={{ lookup('env', 'SECUNDA_DB_HOST') }} database_port={{ lookup('env', 'SECUNDA_DB_PORT') }} git_branch=master app_path=\/srv\/www\/secunda.myawesomestartup.com custom_server_options=--no-friendly-error-pages sidekiq_process_number=4  [hosts:children] prima secunda <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">inventory\/staging<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code> ; staging  [plebius] plebius.myawesomestartup.com  [plebius:vars] ansible_env_name=staging rails_env_name=production database_name={{ lookup('env', 'PLEBIUS_DB_NAME') }} database_username={{ lookup('env', 'PLEBIUS_DB_LOGIN') }} database_password={{ lookup('env', 'PLEBIUS_DB_PASSWORD') }} database_host={{ lookup('env', 'PLEBIUS_DB_HOST') }} database_port={{ lookup('env', 'PLEBIUS_DB_PORT') }} git_branch=develop app_path=\/srv\/www\/plebius.myawesomestartup.com custom_server_options=--friendly-error-pages sidekiq_process_number=4  [hosts:children] plebius <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0428\u0430\u0431\u043b\u043e\u043d\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u0432 \u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0432 \u043f\u0430\u043f\u043a\u0443 ansible\/configs:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">configs\/database.yml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code># configs\/database.yml {{rails_env_name}}:   adapter: mysql2   database: {{database_name}}   username: {{database_username}}   password: {{database_password}}   host: {{database_host}}   port: {{database_port}}   secure_auth: false <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u043b\u044f \u0442\u0435\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u044f \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e <a href=\"https:\/\/github.com\/bkeepers\/dotenv\">dotenv<\/a>.<br \/>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u043f\u0430\u043f\u043a\u0435 ansible\/environments:  <\/p>\n<pre><code>production\/     prima.env     secunda.env staging\/     plebius.env <\/code><\/pre>\n<h2>\u0420\u0435\u043b\u0438\u0437\u044b \u043a\u0430\u043a \u0432 Capistrano<\/h2>\n<p>  Capistrano \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0434\u0443\u043c\u0430\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435.  <\/p>\n<pre><code>releases\/   20150631130156\/   20150631130233\/   20150631172431\/   20150704162516\/   20150712165952\/ current - -&gt; \/www\/domain\/releases\/20150712165952\/ shared\/ <\/code><\/pre>\n<p>  \u041f\u0430\u043f\u043a\u0430 <em>releases<\/em> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u044f\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0440\u0435\u043b\u0438\u0437\u043e\u0432 \u0432 \u043f\u0430\u043f\u043a\u0430\u0445 \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u0432\u0438\u0434\u0430 <em>20150812165952<\/em>, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0445 \u0432 \u0441\u0435\u0431\u0435 \u0442\u0430\u0439\u043c\u0441\u0442\u0430\u043c\u043f \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0434\u0435\u043f\u043b\u043e\u044f \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u043b\u0438\u0437\u0430. \u0412\u043d\u0443\u0442\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0440\u0435\u043b\u0438\u0437\u0430 \u043b\u0435\u0436\u0438\u0442 \u0444\u0430\u0439\u043b <em>REVISION<\/em> \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0432 \u0441\u0435\u0431\u0435 \u0445\u0435\u0448 \u043a\u043e\u043c\u043c\u0438\u0442\u0430 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u044b\u043b \u0441\u0434\u0435\u043b\u0430\u043d \u0440\u0435\u043b\u0438\u0437.<br \/>  \u0421\u0438\u043c\u043b\u0438\u043d\u043a <em>current<\/em> \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0440\u0435\u043b\u0438\u0437 \u0432 \u043f\u0430\u043f\u043a\u0435 <em>releases<\/em>.<br \/>  \u041f\u0430\u043f\u043a\u0430 <em>shared<\/em> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0431\u0449\u0438\u0435 \u0434\u043b\u044f \u0432\u0441\u0435 \u0440\u0435\u043b\u0438\u0437\u043e\u0432 \u0444\u0430\u0439\u043b\u044b (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <em>.pid<\/em> \u0438 <em>.sock<\/em>) \u0438 \u0442\u0435 \u0444\u0430\u0439\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0438\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u0439 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <em>database.yml<\/em>). \u0412\u0441\u0435 \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u043e\u0442\u043a\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0431\u043e\u044f \u0434\u0435\u043f\u043b\u043e\u044f \u0438\u043b\u0438 \u0432\u044b\u043a\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0441 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0431\u0430\u0433\u0430\u043c\u0438.<br \/>  \u041f\u043e\u0432\u0442\u043e\u0440\u0438\u043c \u044d\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Ansible:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">ansible\/release.yml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code># ansible\/release.yml --- - hosts: hosts # \u0445\u043e\u0441\u0442\u044b \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u044b \u0432 inventory-\u0444\u0430\u0439\u043b\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f   tasks:     # \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432\u0440\u043e\u0434\u0435 app_path \u0438 shared_path \u0432\u044b\u043d\u0435\u0441\u0435\u043d\u0430 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0438\u043a\u0441\u0438\u043d. \u041e\u0431 \u044d\u0442\u043e\u043c \u043d\u0438\u0436\u0435     - include: tasks\/_set_vars.yml tags=always     # \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0430\u0439\u043c\u0441\u0442\u0430\u043c\u043f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0440\u0435\u043b\u0438\u0437\u0430 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043f\u0430\u043f\u043a\u0443     - set_fact: timestamp=&quot;{{ lookup('pipe', 'date +%Y%m%d%H%M%S') }}&quot;     - set_fact: release_path=&quot;{{ app_path }}\/releases\/{{ timestamp }}&quot;     # \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043f\u0430\u043f\u043e\u043a. \u0415\u0441\u043b\u0438 \u0438\u0445 \u043d\u0435\u0442 ansible \u0438\u0445 \u0441\u043e\u0437\u0434\u0430\u0441\u0442     - name: Ensure shared directory exists       file: path={{ shared_path }} state=directory     - name: Ensure shared\/assets directory exists       file: path={{ shared_path }}\/assets state=directory     - name: Ensure tmp directory exists       file: path={{ shared_path }}\/tmp state=directory     - name: Ensure log directory exists       file: path={{ shared_path }}\/log state=directory     - name: Ensure bundle directory exists       file: path={{ shared_path }}\/bundle state=directory     # \u041e\u0441\u0442\u0430\u0432\u0438\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u043f\u044f\u0442\u044c \u0440\u0435\u043b\u0438\u0437\u043e\u0432 \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0442\u0435\u043a\u0443\u0449\u0438\u0439     - name: Leave only last releases       shell: &quot;cd {{ app_path }}\/releases &amp;&amp; find .\/ -maxdepth 1 | grep -G .............. | sort -r | tail -n +{{ keep_releases }} | xargs rm -rf&quot;     - name: Create release directory       file: path={{ release_path }} state=directory     # \u0421\u043a\u0430\u0447\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u0439     - name: Checkout git repo into release directory       git:         repo={{ git_repo }}         dest={{ release_path }}         version={{ git_branch }}         accept_hostkey=yes     # \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0445\u0435\u0448 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u043a\u043e\u043c\u043c\u0438\u0442\u0430 \u0434\u043b\u044f \u0444\u0430\u0439\u043b\u0430 REVISION \u0438 \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0435\u0433\u043e     - name: Get git branch head hash       shell: &quot;cd {{ release_path }} &amp;&amp; git rev-parse --short HEAD&quot;       register: git_head_hash     - name: Create REVISION file in the release path       copy: content=&quot;{{ git_head_hash.stdout }}&quot; dest={{ release_path }}\/REVISION     # \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0438\u043c\u043b\u0438\u043d\u043a\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f rails \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f     - name: Set assets link       file: src={{ shared_path }}\/assets path={{ release_path }}\/public\/assets state=link     - name: Set tmp link       file: src={{ shared_path }}\/tmp path={{ release_path }}\/tmp state=link     - name: Set log link       file: src={{ shared_path }}\/log path={{ release_path }}\/log state=link     # \u0441\u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u044b .env \u0438 database.yml \u0432 \u043d\u043e\u0432\u044b\u0439 \u0440\u0435\u043b\u0438\u0437. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u044f\u0442\u0441\u044f \u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430.     - name: Copy .env file       template: src=environments\/{{ansible_env_name}}\/{{ansible_hostname}}.env dest={{ release_path }}\/.env     - name: Copy database.yml       template: src=configs\/database.yml dest={{ release_path }}\/config     - set_fact: rvm_wrapper_command=&quot;cd {{ release_path }} &amp;&amp; RAILS_ENV={{ rails_env_name }} rvm ruby-{{ ruby_version }}@{{ full_gemset_name }} --create do&quot;     # Bundle, \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0430\u0441\u0441\u0435\u0442\u043e\u0432...     - name: Run bundle install       shell: &quot;{{ rvm_wrapper_command }} bundle install --path {{ shared_path }}\/bundle --deployment --without development test&quot;     - name: Run db:migrate       shell: &quot;{{ rvm_wrapper_command }} rake db:migrate&quot;     - name: Precompile assets       shell: &quot;{{ rvm_wrapper_command }} rake assets:precompile&quot;     # \u0421\u0438\u043c\u043b\u0438\u043d\u043a\u043d\u0435\u043c \u043d\u0430\u0448 \u0440\u0435\u043b\u0438\u0437 \u0432 \u043f\u0430\u043f\u043a\u0443 current     - name: Update app version       file: src={{ release_path }} path={{ app_path }}\/current state=link <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0431\u044b\u043b\u0430 \u0432\u044b\u043d\u0435\u0441\u0435\u043d\u0430 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443-\u043c\u0438\u043a\u0441\u0438\u043d, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u043e\u0432 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432:  <\/p>\n<pre><code># ansible\/tasks\/_set_vars.yml --- - set_fact: app_name=&quot;myawesomestartup&quot; - set_fact: ruby_version=&quot;2.2.2&quot; - set_fact: ruby_gemset=&quot;myawesomestartup&quot; - set_fact: git_repo=&quot;ilpagency\/rails-sidekiq-ansible-sample&quot; - set_fact: keep_releases=&quot;5&quot; - set_fact: full_app_name=&quot;{{ app_name }}-{{ ansible_env_name }}&quot; - set_fact: full_gemset_name=&quot;{{ ruby_gemset }}-{{ ansible_env_name }}&quot; - set_fact: current_path=&quot;{{ app_path }}\/current&quot; - set_fact: shared_path=&quot;{{ app_path }}\/shared&quot; <\/code><\/pre>\n<h2>\u0417\u0430\u043f\u0443\u0441\u043a passenger \u0438 sidekiq \u2014 \u0442\u0435\u0433\u0438 \u0438 \u0446\u0438\u043a\u043b\u044b Ansible<\/h2>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043f\u043b\u0435\u0439\u0431\u0443\u043a \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f <em>ansible\/app.yml<\/em>, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c, \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c. \u041a\u0430\u043a \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u0438, \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e, \u043b\u0438\u0431\u043e \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u044c \u043c\u0430\u0441\u0442\u0435\u0440-\u043f\u043b\u0435\u0439\u0431\u0443\u043a\u0430.<br \/>  \u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c <a href=\"http:\/\/docs.ansible.com\/ansible\/playbooks_tags.html\">\u0442\u0435\u0433\u0438<\/a> <em>app_stop<\/em> \u0438 <em>app_start<\/em>. \u0422\u0435\u0433\u0438, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u0447\u0430\u0441\u0442\u0438 \u0437\u0430\u0434\u0430\u0447, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u043f\u0440\u0438 \u0434\u0435\u043f\u043b\u043e\u0435. \u0415\u0441\u043b\u0438 \u043d\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0442\u0435\u0433\u0438 \u043f\u0440\u0438 \u0434\u0435\u043f\u043b\u043e\u0435 \u2014 \u043f\u043b\u0435\u0439\u0431\u0443\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0446\u0435\u043b\u0438\u043a\u043e\u043c.<\/p>\n<p>  \u0412\u043e\u0442 \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435:  <\/p>\n<pre><code class=\"bash\"># \u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435: ansible-playbook app.yml -i inventory\/production # \u0422\u043e\u043b\u044c\u043a\u043e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c: ansible-playbook app.yml -i inventory\/production -t &quot;app_stop&quot; # \u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c: ansible-playbook app.yml -i inventory\/production -t &quot;app_start&quot; # \u042d\u0442\u043e \u0442\u043e\u0436\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a: ansible-playbook app.yml -i inventory\/production -t &quot;app_stop,app_start&quot; <\/code><\/pre>\n<p>  \u0410 \u0432\u043e\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">ansible\/app.yml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code># ansible\/app.yml --- - hosts: hosts # \u0445\u043e\u0441\u0442\u044b \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u044b \u0432 inventory-\u0444\u0430\u0439\u043b\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f   tasks:     - include: tasks\/_set_vars.yml tags=always # always \u044d\u0442\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u0433, \u0437\u0430\u0434\u0430\u0447\u0430 \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043d\u0430\u044f \u0438\u043c \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u0432\u0441\u0435\u0433\u0434\u0430, \u043f\u0440\u0438 \u043b\u044e\u0431\u044b\u0445 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u0434\u0435\u043f\u043b\u043e\u044f \u0442\u0435\u0433\u0430\u0445     - set_fact: socks_path={{ shared_path }}\/tmp\/socks       tags: always     - name: Ensure sockets directory exists       file: path={{ socks_path }} state=directory       tags: always     - set_fact: app_sock={{ socks_path }}\/app.sock       tags: always     - set_fact: pids_path={{ shared_path }}\/tmp\/pids       tags: always     - name: Ensure pids directory exists       file: path={{ pids_path }} state=directory       tags: always     - set_fact: app_pid={{ pids_path }}\/passenger.pid       tags: always     - set_fact: rvm_wrapper_command=&quot;cd {{ current_path }} &amp;&amp; RAILS_ENV={{ rails_env_name }} rvm ruby-{{ ruby_version }}@{{ full_gemset_name }} --create do&quot;       tags: always     - include: tasks\/app_stop.yml tags=app_stop #\u044d\u0442\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0449\u0443\u0435\u043d\u0430 \u0435\u0441\u043b\u0438 \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d \u043d\u0438 \u043e\u0434\u0438\u043d \u0442\u0435\u0433 \u0438\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u043d \u0442\u0435\u0433 app_start     - include: tasks\/app_start.yml tags=app_start # \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c\u0443, \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u0433 - app_stop <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0417\u0430\u0434\u0430\u0447\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u044b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0432 \u0444\u0430\u0439\u043b\u044b <em>ansible\/tasks\/app_start.yml<\/em> \u0438 <em>ansible\/tasks\/app_stop.yml<\/em>:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">ansible\/tasks\/app_start.yml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code># ansible\/tasks\/app_start.yml --- - name: start passenger   shell: &quot;{{ rvm_wrapper_command }} bundle exec passenger start -d -S {{ app_sock }} --environment {{ rails_env_name }} --pid-file {{ app_pid }} {{ custom_server_options }}&quot; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">ansible\/tasks\/app_stop.yml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code># ansible\/tasks\/app_stop.yml --- - name: stop passenger   shell: &quot;{{ rvm_wrapper_command }} bundle exec passenger stop --pid-file {{ app_pid }}&quot;   ignore_errors: yes # \u0435\u0441\u043b\u0438 \u0432\u0434\u0440\u0443\u0433 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043e... \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0438. \u041b\u0443\u0447\u0448\u0435 - \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u044f\u0432\u043d\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443. <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0421 sidekiq \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0441\u0445\u043e\u0436\u0430\u044f. \u0414\u043b\u044f \u043d\u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u043b\u0435\u0439\u0431\u0443\u043a <em>ansible\/sidekiq.yml<\/em> \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0442\u0435\u0433\u0438 <em>sidekiq_stop<\/em> \u0438 <em>sidekiq_start<\/em>:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">ansible\/app.yml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code># ansible\/sidekiq.yml --- - hosts: hosts   tasks:     - include: tasks\/_set_vars.yml tags=always     - set_fact: pids_path={{ shared_path }}\/tmp\/pids       tags: always     - name: Ensure pids directory exists       file: path={{ pids_path }} state=directory       tags: always     - set_fact: rvm_wrapper_command=&quot;cd {{ current_path }} &amp;&amp; RAILS_ENV={{ rails_env_name }} rvm ruby-{{ ruby_version }}@{{ full_gemset_name }} --create do&quot;       tags: always     - include: tasks\/sidekiq_stop.yml tags=sidekiq_stop     - include: tasks\/sidekiq_start.yml tags=sidekiq_start <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0417\u0430\u0434\u0430\u0447\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0442\u0430\u043a-\u0436\u0435 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u044b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0432 \u0444\u0430\u0439\u043b\u044b <em>ansible\/tasks\/sidekiq_start.yml<\/em> \u0438 <em>ansible\/tasks\/sidekiq_stop.yml<\/em>. \u041f\u043e\u043c\u0438\u043c\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 sidekiq, \u0432 \u044d\u0442\u0438\u0445 \u0437\u0430\u0434\u0430\u0447\u0430\u0445 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f <a href=\"http:\/\/docs.ansible.com\/ansible\/playbooks_loops.html\">\u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0446\u0438\u043a\u043b\u0430\u043c\u0438<\/a> \u0432 Ansible \u0438 \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\/\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0441\u0440\u0430\u0437\u0443:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">ansible\/tasks\/sidekiq_start.yml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code># ansible\/tasks\/sidekiq_start.yml --- - name: start sidekiq   shell: &quot;{{ rvm_wrapper_command }} bundle exec sidekiq --index {{ item }} --pidfile {{ pids_path }}\/sidekiq-{{ item }}.pid --environment {{ rails_env_name }} --logfile {{ shared_path }}\/log\/sidekiq.log --daemon&quot; # \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f item - \u0441\u0443\u0442\u044c i \u0432 \u0446\u0438\u043a\u043b\u0435. \u0415\u0441\u043b\u0438 \u0432 with_sequence \u0443\u043a\u0430\u0437\u0430\u0442\u044c 4, \u0442\u043e item \u0431\u0443\u0434\u0435\u0442 1,2,3,4   with_sequence: count={{ sidekiq_process_number }} # \u0447\u0438\u0441\u043b\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 sidekiq \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u0438\u043d\u0432\u0435\u043d\u0442\u0430\u0440\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">ansible\/tasks\/sidekiq_stop.yml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code># ansible\/tasks\/sidekiq_stop.yml --- - name: stop sidekiq   shell: &quot;{{ rvm_wrapper_command }} bundle exec sidekiqctl stop {{ pids_path }}\/sidekiq-{{ item }}.pid 20&quot;   ignore_errors: yes # \u0418 \u0441\u043d\u043e\u0432\u0430, \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0430 \u0442\u043e, \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u043b\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u0430 \u043d\u0435 \u0438\u0433\u043e\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438.   with_sequence: count={{ sidekiq_process_number }} <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f Ansible \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f rails \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439:  <\/p>\n<pre><code class=\"bash\">cd myawesomestartup\/ansible  # \u0414\u0435\u043f\u043b\u043e\u0439: ansible-playbook deploy.yml -i inventory\/production # \u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435: ansible-playbook app.yml -i inventory\/production # \u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c sidekiq: ansible-playbook sidekiq.yml -i inventory\/production # \u0414\u0435\u043f\u043b\u043e\u0439 \u0432 \u0441\u0442\u0435\u0439\u0434\u0436\u0438\u043d\u0433 \u0438\u0437 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0439 \u0432\u0435\u0442\u043a\u0438: ansible-playbook deploy.yml -i inventory\/staging -e git_branch=&quot;hotfix\/14082015-777-production_bug&quot; <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0434\u0430\u0451\u0442 \u043b\u0438\u0448\u044c \u043f\u0440\u0438\u043c\u0435\u0440 (\u043f\u0443\u0441\u0442\u044c \u0438 \u0440\u0430\u0431\u043e\u0447\u0438\u0439), \u043e\u0442\u043c\u0435\u0447\u0443 \u043f\u0443\u0442\u0438, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0439\u0442\u0438 \u0434\u0430\u043b\u044c\u0448\u0435:  <\/p>\n<ol>\n<li>\u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/www.phusionpassenger.com\/library\/admin\/standalone\/restart_app.html\">graceful restart<\/a> \u0434\u043b\u044f Passenger.<\/li>\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"http:\/\/docs.ansible.com\/ansible\/playbooks_roles.html\">\u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0440\u043e\u043b\u0435\u0439<\/a> Ansible \u0432\u043c\u0435\u0441\u0442\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u043e\u0432.<\/li>\n<li>\u0418 \u0432\u043e\u043e\u0431\u0449\u0435 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u044d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0432 \u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441 <a href=\"http:\/\/docs.ansible.com\/ansible\/playbooks_best_practices.html\">\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044f\u043c\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432<\/a>.<\/li>\n<\/ol>\n<p>  \u0418 \u0441\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435. Ansible \u043c\u043e\u0436\u0435\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u0432\u044b\u043a\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0440\u0435\u043b\u0438\u0437\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0412\u0435\u0434\u044c, \u043f\u043e\u0432\u0442\u043e\u0440\u044e\u0441\u044c, ansible \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0434\u043b\u044f \u0434\u0435\u043f\u043b\u043e\u044f, \u0430 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u043c\u0438. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u043e\u043b\u0435\u0439 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u043d\u0443\u043b\u044f, \u043f\u0440\u044f\u043c\u043e \u043d\u0430 \u0433\u043e\u043b\u043e\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0435 \u0436\u0435\u043b\u0435\u0437\u043e. \u0410 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 yml-\u043d\u043e\u0442\u0430\u0446\u0438\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441 \u043b\u0451\u0433\u043a\u043e\u0441\u0442\u044c\u044e \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u043e\u0434 \u0441\u0432\u043e\u0438 \u043d\u0443\u0436\u0434\u044b.<\/p>\n<p>  \u0412\u0441\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u043a\u043e\u0434\u044b \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/github.com\/ilpagency\/rails-sidekiq-ansible-sample\">\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043d\u0430 GitHub<\/a>. \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435.               <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/266353\/\"> http:\/\/habrahabr.ru\/post\/266353\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>             Capistrano \u2014 \u043b\u044e\u0431\u0438\u043c\u044b\u0439 \u043c\u043d\u043e\u0433\u0438\u043c\u0438 rails-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u0431\u0435\u0437 \u0437\u0430\u043c\u043e\u0440\u043e\u0447\u0435\u043a \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. <a href=\"https:\/\/github.com\/capistrano\/capistrano\">Capistrano<\/a> \u2014 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u0434\u0435-\u0444\u0430\u043a\u0442\u043e \u0434\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f RoR, must-know \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u0443\u0432\u0430\u0436\u0430\u044e\u0449\u0435\u0433\u043e \u0441\u0435\u0431\u044f \u0440\u0443\u0431\u0438\u0441\u0442\u0430, \u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0432 \u0441\u0432\u043e\u0439 \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u0432\u0438\u0434\u043e\u0432\u0430\u043b\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043d\u0430 python \u0438 PHP.<br \/>  \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043a\u043e\u043c\u0444\u043e\u0440\u0442, \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043e\u0442\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f, \u0447\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043c\u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0440\u0435\u0448\u0430\u0442\u044c, \u0442\u0435\u043c \u0447\u0430\u0449\u0435 Capistrano \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043b \u0441\u0435\u0431\u044f \u043a \u043d\u0438\u043c \u043d\u0435 \u043f\u0440\u0438\u0441\u043f\u043e\u0441\u043e\u0431\u043b\u0435\u043d\u043d\u044b\u043c.<\/p>\n<p>  \u042f \u043e\u0442\u043c\u0435\u0442\u0438\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438:  <\/p>\n<ul>\n<li>\u0418\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e. \u0412\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u0441\u0432\u043e\u0435\u0439 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438, Capistrano \u0434\u0435\u043f\u043b\u043e\u0438\u0442 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044f \u043b\u0438\u0448\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438 \u0432\u044b\u0437\u043e\u0432\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<\/li>\n<li>\u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0434\u0435\u043f\u043b\u043e\u0439. \u041d\u0435\u0431\u044b\u0441\u0442\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u043e \u0443\u043c\u043d\u043e\u0436\u0438\u0442\u044c \u043d\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432.<\/li>\n<li>\u0421\u0438\u043b\u044c\u043d\u0430\u044f \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0441\u0442\u044c \u0441 \u0440\u0435\u043b\u044c\u0441\u0430\u043c\u0438. \u041a\u043e\u043d\u0444\u0438\u0433\u0438 \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 Capistrano \u043f\u0435\u0440\u0435\u043f\u043b\u0435\u0442\u0430\u044e\u0442\u0441\u044f \u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c, \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0441\u044c \u0435\u0433\u043e \u0447\u0430\u0441\u0442\u044c\u044e. \u041d\u0435\u043b\u044c\u0437\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435-\u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0434\u043b\u044f \u0440\u0430\u043d\u043d\u0435\u0433\u043e \u0432\u044b\u043a\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430) \u0431\u0435\u0437 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e rails-\u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f. \u0412 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445 Capistrano \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0443\u0445\u043e\u0434\u0438\u0442\u044c \u043e\u0442 \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0438 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e development, test \u0438 production \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f.<\/li>\n<li>\u041f\u043b\u0430\u0433\u0438\u043d\u044b \u2014 \u043f\u0430\u043b\u043a\u0430 \u043e \u0434\u0432\u0443\u0445 \u043a\u043e\u043d\u0446\u0430\u0445. \u0414\u0430\u0432\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u201c\u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c\u201d \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0442\u043e\u0439 \u0438\u043b\u0438 \u0438\u043d\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u043b\u0438\u0448\u0430\u044e\u0442 \u0432\u0430\u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a, \u043a\u0430\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u043b\u0430\u0433\u0438\u043d\u0430. \u041e \u0432\u043b\u0438\u044f\u043d\u0438\u0438 \u043b\u0438\u0448\u043d\u0438\u0445 \u201c\u0442\u0435\u043b\u043e\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0439\u201d \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u043d\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0434\u0435\u043f\u043b\u043e\u044f \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0432\u044b\u0448\u0435.<\/li>\n<li>\u0421\u043b\u043e\u0436\u043d\u044b\u0439 \u0434\u0435\u043f\u043b\u043e\u0439 \u0433\u0435\u0442\u0435\u0440\u043e\u0433\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u0422\u0440\u0435\u043d\u0434\u043e\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u043b\u0435\u0442 \u0432 \u0440\u0435\u043b\u044c\u0441\u0430\u0445 \u0441\u0442\u0430\u043b\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u0430\u043c\u044b\u0445 \u0442\u044f\u0436\u0435\u043b\u044b\u0445 (\u0431\u0435\u043a\u0433\u0440\u0430\u0443\u043d\u0434\u043d\u044b\u0445 \u0438\u043b\u0438 \u0441\u0435\u0442\u0435\u0432\u044b\u0445) \u0437\u0430\u0434\u0430\u0447 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b, \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 ruby. \u0412 \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 capistrano \u043b\u0438\u0431\u043e \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0430\u0441 \u043f\u043b\u043e\u0434\u0438\u0442\u044c \u0437\u043e\u043e\u043f\u0430\u0440\u043a \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u0438 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439.<\/li>\n<\/ul>\n<p>  \u041c\u043d\u043e\u0433\u0438\u0435 ruby-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u0435\u0440\u0435\u0448\u043b\u0438 \u043d\u0430 <a href=\"https:\/\/github.com\/mina-deploy\/mina\">Mina<\/a> \u0438\u043b\u0438 \u0440\u0435\u0448\u0430\u044e\u0442 \u0441\u0432\u043e\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0435\u0449\u0451 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u043c\u0438 \u0432\u0440\u043e\u0434\u0435 <a href=\"https:\/\/www.chef.io\/chef\/\">Chef<\/a> \u0438 <a href=\"https:\/\/puppetlabs.com\/\">Puppet<\/a>. \u0412\u0441\u0435 \u043e\u043d\u0438 \u0438\u043c\u0435\u044e\u0442 \u0441\u0432\u043e\u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438 \u0438 \u0432 \u0440\u0430\u0437\u043d\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0440\u0435\u0448\u0430\u044e\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432\u044b\u0448\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. \u041c\u043d\u0435 \u0436\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0438\u0445 \u0440\u0435\u0448\u0438\u0442\u044c \u0438\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"http:\/\/www.ansible.com\/home\">Ansible<\/a>, \u043d\u0435 \u0440\u0430\u0441\u0442\u0435\u0440\u044f\u0432 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432 Capistrano, \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u044f \u043f\u0440\u0438\u0432\u044b\u043a.<\/p>\n<p>  Ansible \u044d\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u043c\u0438 \u0438 \u0432 \u0435\u0433\u043e \u0437\u0430\u0434\u0430\u0447\u0438 \u0432\u0445\u043e\u0434\u0438\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445 \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c, \u043d\u043e \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0433\u043e \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0445\u0440\u0430\u043d\u0438\u043c\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 (\u0440\u043e\u043b\u0435\u0439 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Ansible). \u0410 \u0437\u043d\u0430\u0447\u0438\u0442 Ansible (\u043a\u0430\u043a \u0432\u043f\u0440\u043e\u0447\u0435\u043c \u0438 Chef \u0438 Puppet) \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c Capistrano \u0438 \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0441\u0447\u0435\u0442\u0435 \u043e\u043d\u0438 \u0432\u0441\u0435 \u043d\u0435 \u0438\u0434\u0443\u0442 \u0441 \u043d\u0438\u043c \u043d\u0438 \u0432 \u043a\u0430\u043a\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435. \u041e\u0434\u043d\u0430\u043a\u043e, \u0437\u0430\u0434\u0430\u0447\u0430 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0434\u0430\u0442\u044c rails-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u0434\u043b\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0438 \u0440\u0430\u0437\u044a\u044f\u0441\u043d\u0438\u0442\u044c \u043d\u0430 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043e\u0441\u043d\u043e\u0432\u044b Ansible. \u0412 \u043a\u043e\u043d\u0446\u0435 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u0432\u043e\u043b\u0448\u0435\u0431\u043d\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 <em>cap production deploy<\/em> \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u0432 <em>ansible-playbook deploy.yml -i inventory\/production<\/em><br \/>  \u041a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043a\u0430\u043a \u2014 \u043f\u0440\u043e\u0448\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442.  <\/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-265105","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/265105","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=265105"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/265105\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=265105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=265105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=265105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}