{"id":39985,"date":"2026-08-05T20:07:51","date_gmt":"2026-08-05T17:07:51","guid":{"rendered":"https:\/\/itedu.center\/ua\/blog\/?p=39985"},"modified":"2026-08-11T20:36:35","modified_gmt":"2026-08-11T17:36:35","slug":"yak-napysaty-ansible-playbook","status":"publish","type":"post","link":"https:\/\/itedu.center\/ua\/blog\/articles\/yak-napysaty-ansible-playbook\/","title":{"rendered":"\u042f\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u0438 \u043f\u0435\u0440\u0448\u0438\u0439 Ansible-\u043f\u043b\u0435\u0439\u0431\u0443\u043a"},"content":{"rendered":"\n<p>\u042f\u043a\u0449\u043e \u0434\u043b\u044f \u043a\u0435\u0440\u0443\u0432\u0430\u043d\u043d\u044f \u043a\u0456\u043b\u044c\u043a\u043e\u043c\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438 \u0432\u0438 \u0434\u043e\u0441\u0456 \u043f\u0456\u0434\u043a\u043b\u044e\u0447\u0430\u0454\u0442\u0435\u0441\u044f \u0434\u043e \u043a\u043e\u0436\u043d\u043e\u0433\u043e \u0447\u0435\u0440\u0435\u0437 SSH \u0456 \u0432\u0440\u0443\u0447\u043d\u0443 \u0432\u0438\u043a\u043e\u043d\u0443\u0454\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0438 \u0432 \u0442\u0435\u0440\u043c\u0456\u043d\u0430\u043b\u0456, \u043d\u0430\u0441\u0442\u0430\u0432 \u0447\u0430\u0441 \u0437\u043c\u0456\u043d\u0438\u0442\u0438 \u043f\u0456\u0434\u0445\u0456\u0434. \u0420\u0443\u0447\u043d\u0435 \u0430\u0434\u043c\u0456\u043d\u0456\u0441\u0442\u0440\u0443\u0432\u0430\u043d\u043d\u044f \u0441\u043f\u043e\u0432\u0456\u043b\u044c\u043d\u044e\u0454 \u0440\u043e\u0431\u043e\u0442\u0443 \u0442\u0430 \u043d\u0435\u043c\u0438\u043d\u0443\u0447\u0435 \u043f\u0440\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0434\u043e \u043f\u043e\u043c\u0438\u043b\u043e\u043a \u0447\u0435\u0440\u0435\u0437 \u043b\u044e\u0434\u0441\u044c\u043a\u0438\u0439 \u0444\u0430\u043a\u0442\u043e\u0440.<\/p>\n\n\n\n<p><a href=\"https:\/\/docs.ansible.com\/projects\/ansible\/latest\/installation_guide\/intro_installation.html\" target=\"_blank\" rel=\"noopener nofollow\" title=\"\" data-wpel-link=\"external\"><strong>Ansible<\/strong><\/a> \u2014 \u0446\u0435 \u0456\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0456\u0457, \u044f\u043a\u0438\u0439 \u0440\u0435\u0430\u043b\u0456\u0437\u0443\u0454 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0456\u044e <strong>Infrastructure as Code (<\/strong><a href=\"https:\/\/itedu.center\/ua\/blog\/articles\/koly-ne-varto-vykorystovuvaty-iac\/\" target=\"_blank\" rel=\"noopener\" title=\"\" data-wpel-link=\"internal\"><strong>IaC<\/strong><\/a><strong>)<\/strong>. \u0412\u0438 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u043e\u043f\u0438\u0441\u0443\u0454\u0442\u0435 \u0431\u0430\u0436\u0430\u043d\u0438\u0439 \u0441\u0442\u0430\u043d \u0441\u0438\u0441\u0442\u0435\u043c\u0438 \u0443 \u0444\u0430\u0439\u043b\u0456 \u043a\u043e\u043d\u0444\u0456\u0433\u0443\u0440\u0430\u0446\u0456\u0457, \u0430 Ansible \u0441\u0430\u043c\u043e\u0441\u0442\u0456\u0439\u043d\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u0438 \u0434\u043e \u0446\u044c\u043e\u0433\u043e \u0441\u0442\u0430\u043d\u0443.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u041e\u0441\u043d\u043e\u0432\u043d\u0456 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0438 Ansible&nbsp;<\/h2>\n\n\n\n<p>\u0429\u043e\u0431 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0431\u0443\u0434\u0443\u0432\u0430\u0442\u0438 \u0441\u0446\u0435\u043d\u0430\u0440\u0456\u0457 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0456\u0457, \u0432\u0430\u0436\u043b\u0438\u0432\u043e \u0440\u043e\u0437\u0443\u043c\u0456\u0442\u0438 4 \u0431\u0430\u0437\u043e\u0432\u0456 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438 Ansible:&nbsp;<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"https:\/\/docs.ansible.com\/projects\/ansible\/latest\/getting_started\/get_started_playbook.html\" target=\"_blank\" rel=\"noopener nofollow\" title=\"\" data-wpel-link=\"external\"><strong>Playbook<\/strong><\/a><strong> (\u041f\u043b\u0435\u0439\u0431\u0443\u043a):<\/strong> \u0437\u0430\u0433\u0430\u043b\u044c\u043d\u0438\u0439 \u0444\u0430\u0439\u043b \u0441\u0446\u0435\u043d\u0430\u0440\u0456\u044e (\u0437 \u0440\u043e\u0437\u0448\u0438\u0440\u0435\u043d\u043d\u044f\u043c <code>.yml<\/code> \u0430\u0431\u043e <code>.yaml<\/code>), \u044f\u043a\u0438\u0439 \u043e\u0431&#8217;\u0454\u0434\u043d\u0443\u0454 \u043e\u0434\u0438\u043d \u0430\u0431\u043e \u043a\u0456\u043b\u044c\u043a\u0430 \u0441\u0446\u0435\u043d\u0430\u0440\u0456\u0457\u0432 \u0432\u0438\u043a\u043e\u043d\u0430\u043d\u043d\u044f.<\/li>\n\n\n\n<li><strong>Play (\u0421\u0446\u0435\u043d\u0430\u0440\u0456\u0439):<\/strong> \u0431\u043b\u043e\u043a \u0443\u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0456 \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u0430, \u044f\u043a\u0438\u0439 \u0437\u0432&#8217;\u044f\u0437\u0443\u0454 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443 \u0433\u0440\u0443\u043f\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0456\u0432 \u0456\u0437 \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0437\u0430\u0432\u0434\u0430\u043d\u044c, \u044f\u043a\u0456 \u043d\u0430 \u043d\u0438\u0445 \u0442\u0440\u0435\u0431\u0430 \u0432\u0438\u043a\u043e\u043d\u0430\u0442\u0438.<\/li>\n\n\n\n<li><strong>Task (\u0417\u0430\u0432\u0434\u0430\u043d\u043d\u044f):<\/strong> \u043e\u043a\u0440\u0435\u043c\u0430 \u0434\u0456\u044f \u0432\u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0456 Play (\u043d\u0430\u043f\u0440\u0438\u043a\u043b\u0430\u0434, \u00ab\u0432\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0438 \u043f\u0430\u043a\u0435\u0442\u00bb \u0430\u0431\u043e \u00ab\u0441\u0442\u0432\u043e\u0440\u0438\u0442\u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u00bb). \u0417\u0430\u0432\u0434\u0430\u043d\u043d\u044f \u0432\u0438\u043a\u043e\u043d\u0443\u044e\u0442\u044c\u0441\u044f \u0441\u0443\u0432\u043e\u0440\u043e \u043f\u043e\u0441\u043b\u0456\u0434\u043e\u0432\u043d\u043e \u2014 \u0437\u0432\u0435\u0440\u0445\u0443 \u0432\u043d\u0438\u0437.<\/li>\n\n\n\n<li><strong>Module (\u041c\u043e\u0434\u0443\u043b\u044c):<\/strong> \u0433\u043e\u0442\u043e\u0432\u0438\u0439 \u0431\u043b\u043e\u043a \u043a\u043e\u0434\u0443 Python, \u044f\u043a\u0438\u0439 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u0430\u0454 \u0437\u0430 \u0431\u0435\u0437\u043f\u043e\u0441\u0435\u0440\u0435\u0434\u043d\u0454 \u0432\u0438\u043a\u043e\u043d\u0430\u043d\u043d\u044f \u0437\u0430\u0432\u0434\u0430\u043d\u043d\u044f \u043d\u0430 \u0432\u0456\u0434\u0434\u0430\u043b\u0435\u043d\u0456\u0439 \u043c\u0430\u0448\u0438\u043d\u0456 (\u043d\u0430\u043f\u0440\u0438\u043a\u043b\u0430\u0434, \u043c\u043e\u0434\u0443\u043b\u044c apt \u0434\u043b\u044f \u0440\u043e\u0431\u043e\u0442\u0438 \u0437 \u043f\u0430\u043a\u0435\u0442\u0430\u043c\u0438 Ubuntu \u0430\u0431\u043e service \u0434\u043b\u044f \u043a\u0435\u0440\u0443\u0432\u0430\u043d\u043d\u044f \u0434\u0435\u043c\u043e\u043d\u0430\u043c\u0438).<\/li>\n<\/ol>\n\n\n\n<p>\u0423 \u0441\u0443\u0447\u0430\u0441\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0456\u044f\u0445 Ansible \u043c\u043e\u0434\u0443\u043b\u0456 \u0437\u0430\u043f\u0438\u0441\u0443\u044e\u0442\u044c \u0437\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e Fully Qualified Collection Name \u2014 \u043f\u043e\u0432\u043d\u043e\u0433\u043e \u0456\u043c\u0435\u043d\u0456 \u043a\u043e\u043b\u0435\u043a\u0446\u0456\u0457. \u041d\u0430\u043f\u0440\u0438\u043a\u043b\u0430\u0434, \u0437\u0430\u043c\u0456\u0441\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f apt \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u044e\u0442\u044c <code>ansible.builtin.apt<\/code>. \u0426\u0435 \u0437\u0430\u043f\u043e\u0431\u0456\u0433\u0430\u0454 \u043a\u043e\u043d\u0444\u043b\u0456\u043a\u0442\u0430\u043c \u0456\u043c\u0435\u043d \u0456 \u0454 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044f \u0447\u0438\u0441\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0443.\u00a0<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u041f\u0456\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0441\u0435\u0440\u0435\u0434\u043e\u0432\u0438\u0449\u0430 \u0434\u043b\u044f \u0440\u043e\u0431\u043e\u0442\u0438 \u0437 Ansible<\/h2>\n\n\n\n<p>\u041f\u0435\u0440\u0435\u0434 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044f\u043c \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u0456\u0432 \u043f\u043e\u0442\u0440\u0456\u0431\u043d\u043e \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u0442\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0447\u0438\u0439 \u0432\u0443\u0437\u043e\u043b \u0442\u0430 \u043f\u0456\u0434\u0433\u043e\u0442\u0443\u0432\u0430\u0442\u0438 \u043a\u043e\u043d\u0444\u0456\u0433\u0443\u0440\u0430\u0446\u0456\u044e \u0434\u043b\u044f \u043f\u0456\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044f \u0434\u043e \u0432\u0456\u0434\u0434\u0430\u043b\u0435\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0456\u0432.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u0410\u0440\u0445\u0456\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043f\u0456\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044f<\/h3>\n\n\n\n<p>Ansible \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0454 \u043c\u043e\u0434\u0435\u043b\u044c <strong>Control Node \u2192 Managed Nodes<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Control Node (\u0423\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0447\u0438\u0439 \u0432\u0443\u0437\u043e\u043b):<\/strong> \u041a\u043e\u043c\u043f&#8217;\u044e\u0442\u0435\u0440 \u0430\u0431\u043e \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u0456\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0456\u043d\u043d\u044f\u043c Linux\/macOS, \u0437 \u044f\u043a\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u044c\u0441\u044f \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u0438.<\/li>\n\n\n\n<li><strong>Managed Nodes (\u041a\u0435\u0440\u043e\u0432\u0430\u043d\u0456 \u0432\u0443\u0437\u043b\u0438):<\/strong> \u0421\u0435\u0440\u0432\u0435\u0440\u0438, \u044f\u043a\u0438\u043c\u0438 \u0432\u0438 \u043a\u0435\u0440\u0443\u0454\u0442\u0435. \u041d\u0430 \u043d\u0438\u0445 \u043f\u043e\u0442\u0440\u0456\u0431\u043d\u0456 \u043b\u0438\u0448\u0435 Python 3 \u0442\u0430 \u0432\u0456\u0434\u043a\u0440\u0438\u0442\u0438\u0439 SSH-\u0434\u043e\u0441\u0442\u0443\u043f.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u0412\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044f Ansible \u0443 Python venv<\/h3>\n\n\n\n<p>\u0429\u043e\u0431 \u0443\u043d\u0438\u043a\u043d\u0443\u0442\u0438 \u043a\u043e\u043d\u0444\u043b\u0456\u043a\u0442\u0456\u0432 \u0456\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u0438\u043c\u0438 \u043f\u0430\u043a\u0435\u0442\u0430\u043c\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0456\u0439\u043d\u043e\u0457 \u0441\u0438\u0441\u0442\u0435\u043c\u0438, Ansible \u0432\u0430\u0440\u0442\u043e \u0432\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u044e\u0432\u0430\u0442\u0438 \u0432 \u0456\u0437\u043e\u043b\u044c\u043e\u0432\u0430\u043d\u0435 \u0432\u0456\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0435 \u0441\u0435\u0440\u0435\u0434\u043e\u0432\u0438\u0449\u0435 Python (venv).<\/p>\n\n\n\n<p>\u0421\u0442\u0432\u043e\u0440\u0456\u0442\u044c \u0440\u043e\u0431\u043e\u0447\u0443 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0456\u044e \u043f\u0440\u043e\u0454\u043a\u0442\u0443 \u0442\u0430 \u0430\u043a\u0442\u0438\u0432\u0443\u0439\u0442\u0435 \u0432\u0456\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0435 \u0441\u0435\u0440\u0435\u0434\u043e\u0432\u0438\u0449\u0435:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; gutter: false; title: ; notranslate\" title=\"\">\nmkdir ansible-first-steps &amp;&amp; cd ansible-first-steps\npython3 -m venv venv\nsource venv\/bin\/activate\n<\/pre><\/div>\n\n\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0456\u0442\u044c \u043f\u0430\u043a\u0435\u0442 <code>ansible-core<\/code> (\u043c\u0456\u0441\u0442\u0438\u0442\u044c \u0440\u0443\u0448\u0456\u0439 Ansible \u0442\u0430 \u0431\u0430\u0437\u043e\u0432\u0456 \u043c\u043e\u0434\u0443\u043b\u0456):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; gutter: false; title: ; notranslate\" title=\"\">\npip install ansible-core\n<\/pre><\/div>\n\n\n<p><strong>\u0410\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0446\u0456\u044f \u0437\u0430 \u043f\u0430\u0440\u043e\u043b\u0435\u043c:<\/strong> \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0443 \u0432\u0430\u0440\u0442\u043e \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438 \u0432\u0438\u043a\u043b\u044e\u0447\u043d\u043e SSH-\u043a\u043b\u044e\u0447\u0456. \u042f\u043a\u0449\u043e \u0432\u0438 \u043f\u0456\u0434\u043a\u043b\u044e\u0447\u0430\u0454\u0442\u0435\u0441\u044f \u0434\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0456\u0432 \u0437\u0430 \u043f\u0430\u0440\u043e\u043b\u0435\u043c, \u0434\u043e\u0434\u0430\u0442\u043a\u043e\u0432\u043e \u0432\u0441\u0442\u0430\u043d\u043e\u0432\u0456\u0442\u044c \u0443\u0442\u0438\u043b\u0456\u0442\u0443 <code>sshpass<\/code> \u0443 \u0441\u0432\u043e\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 (\u043d\u0430\u043f\u0440\u0438\u043a\u043b\u0430\u0434, \u0447\u0435\u0440\u0435\u0437 <code>sudo apt install sshpass<\/code>).\u00a0<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u0421\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0443 \u0456\u043d\u0432\u0435\u043d\u0442\u0430\u0440\u044f<\/strong><\/h3>\n\n\n\n<p>Ansible \u043c\u0430\u0454 \u0437\u043d\u0430\u0442\u0438 IP-\u0430\u0434\u0440\u0435\u0441\u0438 \u0430\u0431\u043e \u0434\u043e\u043c\u0435\u043d\u043d\u0456 \u0456\u043c\u0435\u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0456\u0432, \u044f\u043a\u0438\u043c\u0438 \u0432\u0456\u043d \u043a\u0435\u0440\u0443\u0454. \u0414\u043b\u044f \u0446\u044c\u043e\u0433\u043e \u0441\u0442\u0432\u043e\u0440\u044e\u0454\u0442\u044c\u0441\u044f \u0444\u0430\u0439\u043b \u0456\u043d\u0432\u0435\u043d\u0442\u0430\u0440\u044f.<\/p>\n\n\n\n<p>\u0421\u0442\u0432\u043e\u0440\u0456\u0442\u044c \u0444\u0430\u0439\u043b inventory.ini \u0443 \u043f\u0430\u043f\u0446\u0456 \u043f\u0440\u043e\u0454\u043a\u0442\u0443:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; gutter: false; title: ; notranslate\" title=\"\">\n# inventory.ini\n\n&#x5B;webservers]\n192.168.1.10\n192.168.1.11\n\n&#x5B;dbservers]\n192.168.1.20\n\n&#x5B;all:vars]\nansible_user=ubuntu\n<\/pre><\/div>\n\n\n<p>\u0429\u043e \u0442\u0443\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u043e:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>[webservers]<\/code> \u0442\u0430 <code>[dbservers]<\/code> \u2014 \u0433\u0440\u0443\u043f\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0456\u0432. \u0412\u0438 \u0437\u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0441\u0442\u043e\u0441\u043e\u0432\u0443\u0432\u0430\u0442\u0438 \u0441\u0446\u0435\u043d\u0430\u0440\u0456\u0457 \u044f\u043a \u0434\u043e \u043e\u043a\u0440\u0435\u043c\u0438\u0445 \u0433\u0440\u0443\u043f, \u0442\u0430\u043a \u0456 \u0434\u043e \u0432\u0441\u0456\u0445 \u043c\u0430\u0448\u0438\u043d \u043e\u0434\u0440\u0430\u0437\u0443.<\/li>\n\n\n\n<li><code>[all:vars]<\/code> \u2014 \u0431\u043b\u043e\u043a \u0441\u043f\u0456\u043b\u044c\u043d\u0438\u0445 \u0437\u043c\u0456\u043d\u043d\u0438\u0445 \u0434\u043b\u044f \u0432\u0441\u0456\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0456\u0432 \u0443 \u0446\u044c\u043e\u043c\u0443 \u0456\u043d\u0432\u0435\u043d\u0442\u0430\u0440\u0456. \u0414\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 <code>ansible_user=ubuntu<\/code> \u0432\u043a\u0430\u0437\u0443\u0454, \u043f\u0456\u0434 \u044f\u043a\u0438\u043c SSH-\u043a\u043e\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0447\u0435\u043c Ansible \u043c\u0430\u0454 \u043f\u0456\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u0438\u0441\u044f \u0434\u043e \u043c\u0430\u0448\u0438\u043d.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u0417\u0430\u043f\u0443\u0441\u043a \u043f\u0435\u0440\u0448\u043e\u0433\u043e Ansible-\u043f\u043b\u0435\u0439\u0431\u0443\u043a\u0430<\/h2>\n\n\n\n<p>\u0422\u0435\u043f\u0435\u0440, \u043a\u043e\u043b\u0438 \u0441\u0435\u0440\u0435\u0434\u043e\u0432\u0438\u0449\u0435 \u043f\u0456\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u0435, \u0441\u0442\u0432\u043e\u0440\u0438\u043c\u043e \u0442\u0430 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c\u043e \u043c\u0456\u043d\u0456\u043c\u0430\u043b\u044c\u043d\u0438\u0439 \u043f\u043b\u0435\u0439\u0431\u0443\u043a. \u0426\u0435 \u0434\u043e\u0437\u0432\u043e\u043b\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0432\u0456\u0440\u0438\u0442\u0438 \u0437\u0432&#8217;\u044f\u0437\u043e\u043a \u0456\u0437 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438 \u0442\u0430 \u0437\u0440\u043e\u0437\u0443\u043c\u0456\u0442\u0438 \u0431\u0430\u0437\u043e\u0432\u0443 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043a\u043e\u043d\u0444\u0456\u0433\u0443\u0440\u0430\u0446\u0456\u0439\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0443.<\/p>\n\n\n\n<p><em>Ansible-\u043f\u043b\u0435\u0439\u0431\u0443\u043a\u0438 \u043f\u0438\u0448\u0443\u0442\u044c\u0441\u044f \u043c\u043e\u0432\u043e\u044e YAML. \u042f\u043a\u0449\u043e \u0432\u0438 \u0445\u043e\u0447\u0435\u0442\u0435 \u0434\u043e\u043a\u043b\u0430\u0434\u043d\u0456\u0448\u0435 \u0440\u043e\u0437\u0456\u0431\u0440\u0430\u0442\u0438\u0441\u044f \u0437 \u0431\u0430\u0437\u043e\u0432\u0438\u043c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u043e\u043c, \u043f\u0435\u0440\u0435\u0433\u043b\u044f\u043d\u044c\u0442\u0435 \u043d\u0430\u0448 \u043e\u043a\u0440\u0435\u043c\u0438\u0439 <\/em><a href=\"https:\/\/itedu.center\/ua\/blog\/articles\/znaiomstvo-z-yaml-bazovi-poniattia-ta-syntaksys\/\" target=\"_blank\" rel=\"noopener\" title=\"\" data-wpel-link=\"internal\"><em>\u0433\u0430\u0439\u0434 \u043f\u0440\u043e YAML \u0434\u043b\u044f \u043d\u043e\u0432\u0430\u0447\u043a\u0456\u0432<\/em><\/a><em>.\u00a0<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u0430<\/h3>\n\n\n\n<p>\u0421\u0442\u0432\u043e\u0440\u0456\u0442\u044c \u0444\u0430\u0439\u043b <code>playbook.yml<\/code> \u0443 \u043f\u0430\u043f\u0456 \u043f\u0440\u043e\u0454\u043a\u0442\u0443. \u041d\u0430\u0448 \u043f\u0435\u0440\u0448\u0438\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0456\u0439 \u0432\u0438\u043a\u043e\u043d\u0443\u0432\u0430\u0442\u0438\u043c\u0435 \u0434\u0432\u0456 \u043f\u0440\u043e\u0441\u0442\u0456 \u0434\u0456\u0457: \u043f\u0435\u0440\u0435\u0432\u0456\u0440\u044f\u0442\u0438\u043c\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0456\u0441\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u0456\u0432 \u0437\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e \u043c\u043e\u0434\u0443\u043b\u044f <code>ping<\/code> \u0442\u0430 \u0432\u0438\u0432\u043e\u0434\u0438\u0442\u0438\u043c\u0435 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u0435 \u043f\u043e\u0432\u0456\u0434\u043e\u043c\u043b\u0435\u043d\u043d\u044f \u0447\u0435\u0440\u0435\u0437 \u043c\u043e\u0434\u0443\u043b\u044c <code>debug<\/code>.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: yaml; gutter: false; title: ; notranslate\" title=\"\">\n---\n- name: \u041f\u0435\u0440\u0435\u0432\u0456\u0440\u043a\u0430 \u0437\u0432&#039;\u044f\u0437\u043a\u0443 \u0442\u0430 \u0432\u0438\u0432\u0456\u0434 \u043f\u0440\u0438\u0432\u0456\u0442\u0430\u043d\u043d\u044f\n  hosts: webservers\n  become: yes\n\n  tasks:\n    - name: \u041f\u0435\u0440\u0435\u0432\u0456\u0440\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0456 \u0432\u0443\u0437\u043b\u0430\n      ansible.builtin.ping:\n\n    - name: \u0412\u0438\u0432\u0456\u0434 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u0432\u0456\u0434\u043e\u043c\u043b\u0435\u043d\u043d\u044f\n      ansible.builtin.debug:\n        msg: &quot;\u0421\u0435\u0440\u0432\u0435\u0440 \u0443\u0441\u043f\u0456\u0448\u043d\u043e \u043d\u0430\u043b\u0430\u0448\u0442\u043e\u0432\u0443\u0454\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 Ansible!&quot;\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">\u0417\u0430\u043f\u0443\u0441\u043a \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u0430 \u0442\u0430 \u0430\u043d\u0430\u043b\u0456\u0437 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0456\u0432<\/h3>\n\n\n\n<p>\u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u0441\u0446\u0435\u043d\u0430\u0440\u0456\u044e \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0454\u0442\u044c\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 <code>ansible-playbook<\/code>. \u041f\u0435\u0440\u0435\u0434\u0430\u0439\u0442\u0435 \u0457\u0439 \u0444\u0430\u0439\u043b \u0456\u043d\u0432\u0435\u043d\u0442\u0430\u0440\u044f \u0447\u0435\u0440\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>-i<\/code> \u0442\u0430 \u0448\u043b\u044f\u0445 \u0434\u043e \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u0430:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; gutter: false; title: ; notranslate\" title=\"\">\nansible-playbook -i inventory.ini playbook.yml\n<\/pre><\/div>\n\n\n<p>\u041f\u0456\u0441\u043b\u044f \u0432\u0438\u043a\u043e\u043d\u0430\u043d\u043d\u044f \u0443 \u0442\u0435\u0440\u043c\u0456\u043d\u0430\u043b\u0456 \u0437&#8217;\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u0438\u0439 \u0437\u0432\u0456\u0442:&nbsp;<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; gutter: false; title: ; notranslate\" title=\"\">\nPLAY &#x5B;\u041f\u0435\u0440\u0435\u0432\u0456\u0440\u043a\u0430 \u0437\u0432&#039;\u044f\u0437\u043a\u0443 \u0442\u0430 \u0432\u0438\u0432\u0456\u0434 \u043f\u0440\u0438\u0432\u0456\u0442\u0430\u043d\u043d\u044f] ***********************************\n\nTASK &#x5B;Gathering Facts] *********************************************************\nok: &#x5B;192.168.1.10]\nok: &#x5B;192.168.1.11]\n\nTASK &#x5B;\u041f\u0435\u0440\u0435\u0432\u0456\u0440\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0456 \u0432\u0443\u0437\u043b\u0430] *********************************************\nok: &#x5B;192.168.1.10]\nok: &#x5B;192.168.1.11]\n\nTASK &#x5B;\u0412\u0438\u0432\u0456\u0434 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u0432\u0456\u0434\u043e\u043c\u043b\u0435\u043d\u043d\u044f] *******************************************\nok: &#x5B;192.168.1.10] =&gt; {\n    &quot;msg&quot;: &quot;\u0421\u0435\u0440\u0432\u0435\u0440 \u0443\u0441\u043f\u0456\u0448\u043d\u043e \u043d\u0430\u043b\u0430\u0448\u0442\u043e\u0432\u0443\u0454\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 Ansible!&quot;\n}\nok: &#x5B;192.168.1.11] =&gt; {\n    &quot;msg&quot;: &quot;\u0421\u0435\u0440\u0432\u0435\u0440 \u0443\u0441\u043f\u0456\u0448\u043d\u043e \u043d\u0430\u043b\u0430\u0448\u0442\u043e\u0432\u0443\u0454\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 Ansible!&quot;\n}\n\nPLAY RECAP *********************************************************************\n192.168.1.10               : ok=3    changed=0    unreachable=0    failed=0\n192.168.1.11               : ok=3    changed=0    unreachable=0    failed=0\n<\/pre><\/div>\n\n\n<p><strong>\u0429\u043e \u0432\u0430\u0436\u043b\u0438\u0432\u043e \u0432\u0440\u0430\u0445\u0443\u0432\u0430\u0442\u0438 \u0443 \u0432\u0438\u0432\u043e\u0434\u0456:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Gathering Facts<\/strong><strong><br><\/strong>Ansible \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0454 \u0446\u0435 \u0437\u0430\u0432\u0434\u0430\u043d\u043d\u044f \u043f\u0435\u0440\u0435\u0434 \u0432\u0438\u043a\u043e\u043d\u0430\u043d\u043d\u044f\u043c \u0432\u0430\u0448\u0438\u0445 \u0437\u0430\u0432\u0434\u0430\u043d\u044c. \u0412\u043e\u043d\u043e \u0437\u0431\u0438\u0440\u0430\u0454 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u0443 \u0456\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0456\u044e \u043f\u0440\u043e \u043a\u0435\u0440\u043e\u0432\u0430\u043d\u0438\u0439 \u0432\u0443\u0437\u043e\u043b (\u041e\u0421, IP-\u0430\u0434\u0440\u0435\u0441\u0438, \u0434\u0438\u0441\u043a \u0442\u043e\u0449\u043e).<\/li>\n\n\n\n<li><strong>PLAY RECAP<br><\/strong>\u041f\u0456\u0434\u0441\u0443\u043c\u043a\u043e\u0432\u0438\u0439 \u0431\u043b\u043e\u043a. \u0421\u0442\u0430\u0442\u0443\u0441 <code>ok=3<\/code> \u043e\u0437\u043d\u0430\u0447\u0430\u0454, \u0449\u043e \u0432\u0441\u0456 \u0442\u0440\u0438 \u0437\u0430\u0432\u0434\u0430\u043d\u043d\u044f (\u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0447\u0438 Gathering Facts) \u0432\u0438\u043a\u043e\u043d\u0430\u043d\u043e \u0443\u0441\u043f\u0456\u0448\u043d\u043e, \u0430 <code>changed=0<\/code> \u043f\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0443\u0454, \u0449\u043e \u043a\u043e\u043d\u0444\u0456\u0433\u0443\u0440\u0430\u0446\u0456\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0438 \u043d\u0435 \u0437\u0430\u0437\u043d\u0430\u043b\u0430 \u0437\u043c\u0456\u043d.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0456\u044f \u0440\u043e\u0437\u0433\u043e\u0440\u0442\u0430\u043d\u043d\u044f Nginx<\/h2>\n\n\n\n<p>\u041f\u0456\u0441\u043b\u044f \u0443\u0441\u043f\u0456\u0448\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u0441\u0442\u0432\u043e\u0440\u0438\u043c\u043e \u043f\u043b\u0435\u0439\u0431\u0443\u043a \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u0430\u0432\u0434\u0430\u043d\u043d\u044f \u2014 \u0440\u043e\u0437\u0433\u043e\u0440\u0442\u0430\u043d\u043d\u044f \u0442\u0430 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f \u0432\u0435\u0431\u0441\u0435\u0440\u0432\u0435\u0440\u0430 <a href=\"https:\/\/itedu.center\/ua\/blog\/articles\/shcho-take-nginx\/\" target=\"_blank\" rel=\"noopener\" title=\"\" data-wpel-link=\"internal\">Nginx<\/a> \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445 \u043f\u0456\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0456\u043d\u043d\u044f\u043c Ubuntu\/Debian.<\/p>\n\n\n\n<p>\u0426\u0435\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0456\u0439 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0443\u0454 \u0440\u043e\u0431\u043e\u0442\u0443 \u0437\u0456 \u0437\u043c\u0456\u043d\u043d\u0438\u043c\u0438, \u043e\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044f\u043c \u043f\u0430\u043a\u0435\u0442\u0456\u0432, \u0432\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044f\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c, \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0456\u0454\u044e \u0444\u0430\u0439\u043b\u0456\u0432 \u0442\u0430 \u043a\u0435\u0440\u0443\u0432\u0430\u043d\u043d\u044f\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u0438\u043c\u0438 \u0441\u043b\u0443\u0436\u0431\u0430\u043c\u0438.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u041a\u043e\u0434 \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u0430 <\/strong><strong>setup-webserver.yml<\/strong><\/h3>\n\n\n\n<p>\u0421\u0442\u0432\u043e\u0440\u0456\u0442\u044c \u0444\u0430\u0439\u043b <code>setup-webserver.yml<\/code>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: yaml; gutter: false; title: ; notranslate\" title=\"\">\n---\n- name: \u0420\u043e\u0437\u0433\u043e\u0440\u0442\u0430\u043d\u043d\u044f \u0442\u0430 \u043a\u043e\u043d\u0444\u0456\u0433\u0443\u0440\u0430\u0446\u0456\u044f \u0432\u0435\u0431\u0441\u0435\u0440\u0432\u0435\u0440\u0430 Nginx\n  hosts: webservers\n  become: yes\n\n  vars:\n    http_port: 80\n    server_admin: &quot;admin@example.com&quot;\n\n  tasks:\n    - name: \u041e\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044f \u043a\u0435\u0448\u0443 \u043f\u0430\u043a\u0435\u0442\u0456\u0432 apt\n      ansible.builtin.apt:\n        update_cache: yes\n        cache_valid_time: 3600\n\n    - name: \u0412\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044f \u0432\u0435\u0431\u0441\u0435\u0440\u0432\u0435\u0440\u0430 Nginx\n      ansible.builtin.apt:\n        name: nginx\n        state: present\n\n    - name: \u0421\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0457 \u0441\u0442\u043e\u0440\u0456\u043d\u043a\u0438 index.html\n      ansible.builtin.copy:\n        content: |\n          &lt;html&gt;\n            &lt;head&gt;&lt;title&gt;\u0412\u0456\u0442\u0430\u0454\u043c\u043e \u0443 Ansible!&lt;\/title&gt;&lt;\/head&gt;\n            &lt;body&gt;\n              &lt;h1&gt;\u0421\u0435\u0440\u0432\u0435\u0440 {{ inventory_hostname }} \u0443\u0441\u043f\u0456\u0448\u043d\u043e \u043d\u0430\u043b\u0430\u0448\u0442\u043e\u0432\u0430\u043d\u043e!&lt;\/h1&gt;\n              &lt;p&gt;\u0410\u0434\u043c\u0456\u043d\u0456\u0441\u0442\u0440\u0430\u0442\u043e\u0440: {{ server_admin }}&lt;\/p&gt;\n            &lt;\/body&gt;\n          &lt;\/html&gt;\n        dest: \/var\/www\/html\/index.html\n        owner: www-data\n        group: www-data\n        mode: &#039;0644&#039;\n\n    - name: \u041f\u0435\u0440\u0435\u0432\u0456\u0440\u043a\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u0442\u0430 \u0430\u0432\u0442\u043e\u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f Nginx\n      ansible.builtin.service:\n        name: nginx\n        state: started\n        enabled: yes\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\">\u0420\u043e\u0437\u0431\u0456\u0440 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438 \u0442\u0430 \u043c\u043e\u0434\u0443\u043b\u0456\u0432 \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u0430<\/h4>\n\n\n\n<p><strong>1. \u0411\u043b\u043e\u043a \u0437\u043c\u0456\u043d\u043d\u0438\u0445 (<code>vars<\/code>)<\/strong><\/p>\n\n\n\n<p>\u0412\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0454\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0432\u0438\u043d\u0435\u0441\u0435\u043d\u043d\u044f \u043a\u043e\u043d\u0444\u0456\u0433\u0443\u0440\u0430\u0446\u0456\u0439\u043d\u0438\u0445 \u0434\u0430\u043d\u0438\u0445 \u043d\u0430 \u043f\u043e\u0447\u0430\u0442\u043e\u043a \u0444\u0430\u0439\u043b\u0443. \u0414\u043b\u044f \u043f\u0456\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u044c \u0443 \u043a\u043e\u0434\u0456 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0454\u0442\u044c\u0441\u044f \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 <code>{{ variable_name }<\/code>}.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>http_port<\/code> \u2014 \u043f\u043e\u0440\u0442, \u043d\u0430 \u044f\u043a\u043e\u043c\u0443 \u043f\u0440\u0430\u0446\u044e\u0432\u0430\u0442\u0438\u043c\u0435 \u0432\u0435\u0431\u0441\u0435\u0440\u0432\u0435\u0440.<\/li>\n\n\n\n<li><code>server_admin<\/code> \u2014 email-\u0430\u0434\u0440\u0435\u0441\u0430 \u0430\u0434\u043c\u0456\u043d\u0456\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430, \u044f\u043a\u0430 \u043f\u0456\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0454\u0442\u044c\u0441\u044f \u0432 HTML-\u0441\u0442\u043e\u0440\u0456\u043d\u043a\u0443.<\/li>\n<\/ul>\n\n\n\n<p><strong>2. \u041c\u043e\u0434\u0443\u043b\u044c <code>ansible.builtin.apt<\/code>\u2014 \u043a\u0435\u0440\u0443\u0432\u0430\u043d\u043d\u044f \u043f\u0430\u043a\u0435\u0442\u0430\u043c\u0438 Ubuntu\/Debian<\/strong><\/p>\n\n\n\n<p>\u0412\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u0430\u0454 \u0437\u0430 \u043e\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044f \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0456\u0457\u0432 \u0442\u0430 \u0432\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043d\u043e\u0433\u043e \u0437\u0430\u0431\u0435\u0437\u043f\u0435\u0447\u0435\u043d\u043d\u044f.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>update_cache: yes<\/code> \u2014 \u0430\u043d\u0430\u043b\u043e\u0433 \u043a\u043e\u043c\u0430\u043d\u0434\u0438 <code>apt update<\/code>.<\/li>\n\n\n\n<li><code>cache_valid_time: 3600<\/code> \u2014 \u043e\u043d\u043e\u0432\u043b\u044e\u0454 \u043a\u0435\u0448 \u043f\u0430\u043a\u0435\u0442\u0456\u0432 \u043b\u0438\u0448\u0435 \u0442\u043e\u0434\u0456, \u043a\u043e\u043b\u0438 \u0437 \u043e\u0441\u0442\u0430\u043d\u043d\u044c\u043e\u0457 \u043f\u0435\u0440\u0435\u0432\u0456\u0440\u043a\u0438 \u043c\u0438\u043d\u0443\u043b\u0430 \u0433\u043e\u0434\u0438\u043d\u0430 (3600 \u0441\u0435\u043a\u0443\u043d\u0434). \u0426\u0435 \u043f\u0440\u0438\u0441\u043a\u043e\u0440\u044e\u0454 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u0456 \u0437\u0430\u043f\u0443\u0441\u043a\u0438.<\/li>\n\n\n\n<li><code>name: nginx<\/code> \u2014 \u043d\u0430\u0437\u0432\u0430 \u043f\u0430\u043a\u0435\u0442\u0430 \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044f.<\/li>\n\n\n\n<li><code>state: present<\/code> \u2014 \u043f\u0435\u0440\u0435\u0432\u0456\u0440\u044f\u0454 \u043d\u0430\u044f\u0432\u043d\u0456\u0441\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u0430. \u042f\u043a\u0449\u043e Nginx \u0443\u0436\u0435 \u0432\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e, Ansible \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0446\u0435\u0439 \u043a\u0440\u043e\u043a.<\/li>\n<\/ul>\n\n\n\n<p><strong>3. \u041c\u043e\u0434\u0443\u043b\u044c <\/strong><strong>ansible.builtin.copy<\/strong><strong> \u2014 \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u0442\u0430 \u043a\u043e\u043f\u0456\u044e\u0432\u0430\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0456\u0432<\/strong><\/p>\n\n\n\n<p>\u0412\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u0430\u0454 \u0437\u0430 \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u043a\u043e\u043d\u0444\u0456\u0433\u0443\u0440\u0430\u0446\u0456\u0439\u043d\u0438\u0445 \u0444\u0430\u0439\u043b\u0456\u0432 \u0430\u0431\u043e \u0432\u0435\u0431\u0441\u0442\u043e\u0440\u0456\u043d\u043e\u043a \u043d\u0430 \u0432\u0456\u0434\u0434\u0430\u043b\u0435\u043d\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0456.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>content: |<\/code> \u2014 \u0434\u043e\u0437\u0432\u043e\u043b\u044f\u0454 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u0438 \u0432\u043c\u0456\u0441\u0442 \u0444\u0430\u0439\u043b\u0443 (HTML-\u043a\u043e\u0434) \u0431\u0435\u0437\u043f\u043e\u0441\u0435\u0440\u0435\u0434\u043d\u044c\u043e \u0432\u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0456 \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u0430.<\/li>\n\n\n\n<li><code>dest<\/code> \u2014 \u0448\u043b\u044f\u0445 \u043d\u0430 \u0432\u0456\u0434\u0434\u0430\u043b\u0435\u043d\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0456, \u043a\u0443\u0434\u0438 \u0431\u0443\u0434\u0435 \u0437\u0431\u0435\u0440\u0435\u0436\u0435\u043d\u043e \u0444\u0430\u0439\u043b (<code>\/var\/www\/html\/index.html<\/code>).<\/li>\n\n\n\n<li><code>owner<\/code> \/ <code>group<\/code> \u2014 \u0437\u0430\u0434\u0430\u044e\u0442\u044c \u0432\u043b\u0430\u0441\u043d\u0438\u043a\u0430 \u0442\u0430 \u0433\u0440\u0443\u043f\u0443 \u0444\u0430\u0439\u043b\u0443 (<code>www-data<\/code>).<\/li>\n\n\n\n<li><code>mode: '0644'<\/code> \u2014 \u0432\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u044e\u0454 \u043f\u0440\u0430\u0432\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0443 \u0434\u043e \u0444\u0430\u0439\u043b\u0443 (\u0447\u0438\u0442\u0430\u043d\u043d\u044f \u0434\u043b\u044f \u0432\u0441\u0456\u0445, \u0437\u0430\u043f\u0438\u0441 \u043b\u0438\u0448\u0435 \u0434\u043b\u044f \u0432\u043b\u0430\u0441\u043d\u0438\u043a\u0430).<\/li>\n\n\n\n<li><code>{{ inventory_hostname }}<\/code> \u2014 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u0430 \u0437\u043c\u0456\u043d\u043d\u0430 Ansible, \u044f\u043a\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u043d\u043e \u043f\u0456\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0454 IP-\u0430\u0434\u0440\u0435\u0441\u0443 \u0430\u0431\u043e \u0456\u043c&#8217;\u044f \u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/li>\n<\/ul>\n\n\n\n<p><strong>4. \u041c\u043e\u0434\u0443\u043b\u044c <\/strong><strong>ansible.builtin.service<\/strong><strong> \u2014 \u043a\u0435\u0440\u0443\u0432\u0430\u043d\u043d\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u0438\u043c\u0438 \u0441\u043b\u0443\u0436\u0431\u0430\u043c\u0438<\/strong><\/p>\n\n\n\n<p>\u0412\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u0430\u0454 \u0437\u0430 \u0437\u0430\u043f\u0443\u0441\u043a, \u0437\u0443\u043f\u0438\u043d\u043a\u0443 \u0442\u0430 \u0430\u0432\u0442\u043e\u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u043e\u043d\u043e\u0432\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0456\u0432 (systemd).<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>name: nginx<\/code> \u2014 \u043d\u0430\u0437\u0432\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0457 \u0441\u043b\u0443\u0436\u0431\u0438.<\/li>\n\n\n\n<li><code>state: started<\/code> \u2014 \u043f\u0435\u0440\u0435\u0432\u0456\u0440\u044f\u0454, \u0447\u0438 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043e \u0441\u043b\u0443\u0436\u0431\u0443. \u042f\u043a\u0449\u043e \u0432\u043e\u043d\u0430 \u0437\u0443\u043f\u0438\u043d\u0435\u043d\u0430 \u2014 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0454 \u0457\u0457.<\/li>\n\n\n\n<li><code>enabled: yes<\/code> \u2014 \u0434\u043e\u0434\u0430\u0454 \u0441\u043b\u0443\u0436\u0431\u0443 \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0456 \u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u041e\u043f\u0442\u0438\u043c\u0456\u0437\u0430\u0446\u0456\u044f \u0440\u043e\u0431\u043e\u0442\u0438&nbsp;<\/h2>\n\n\n\n<p>\u0427\u0430\u0441\u0442\u043e \u0432\u0438\u043d\u0438\u043a\u0430\u0454 \u043f\u043e\u0442\u0440\u0435\u0431\u0430 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0438 \u0441\u043b\u0443\u0436\u0431\u0443 \u043b\u0438\u0448\u0435 \u0442\u043e\u0434\u0456, \u043a\u043e\u043b\u0438 \u0437\u043c\u0456\u043d\u0438\u0432\u0441\u044f \u0457\u0457 \u043a\u043e\u043d\u0444\u0456\u0433\u0443\u0440\u0430\u0446\u0456\u0439\u043d\u0438\u0439 \u0444\u0430\u0439\u043b. \u0414\u043b\u044f \u0446\u044c\u043e\u0433\u043e \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u044e\u0442\u044c\u0441\u044f <strong>Handlers<\/strong> (\u0445\u0435\u043d\u0434\u043b\u0435\u0440\u0438).<\/p>\n\n\n\n<p>\u0425\u0435\u043d\u0434\u043b\u0435\u0440 \u2014 \u0446\u0435 \u043e\u043a\u0440\u0435\u043c\u0435 \u0437\u0430\u0432\u0434\u0430\u043d\u043d\u044f, \u044f\u043a\u0435 \u0432\u0438\u043a\u043e\u043d\u0443\u0454\u0442\u044c\u0441\u044f \u0442\u0456\u043b\u044c\u043a\u0438 \u0437\u0430 \u0443\u043c\u043e\u0432\u0438, \u0449\u043e \u0456\u043d\u0448\u0435 \u0437\u0430\u0432\u0434\u0430\u043d\u043d\u044f \u043f\u043e\u0432\u0435\u0440\u043d\u0443\u043b\u043e \u0441\u0442\u0430\u0442\u0443\u0441 <code>changed<\/code> \u0456 \u043d\u0430\u0434\u0456\u0441\u043b\u0430\u043b\u043e \u0441\u043f\u043e\u0432\u0456\u0449\u0435\u043d\u043d\u044f \u0447\u0435\u0440\u0435\u0437 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0443 <code>notify<\/code>.<\/p>\n\n\n\n<p>\u0414\u043e\u0434\u0430\u043c\u043e \u0445\u0435\u043d\u0434\u043b\u0435\u0440 \u0434\u043e \u043d\u0430\u0448\u043e\u0433\u043e \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u0430:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: yaml; gutter: false; title: ; notranslate\" title=\"\">\n---\n- name: \u041e\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044f \u043a\u043e\u043d\u0444\u0456\u0433\u0443\u0440\u0430\u0446\u0456\u0457 Nginx \u0437 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u043d\u043d\u044f\u043c \u0445\u0435\u043d\u0434\u043b\u0435\u0440\u0430\n  hosts: webservers\n  become: yes\n\n  tasks:\n    - name: \u041e\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044f \u0441\u0442\u043e\u0440\u0456\u043d\u043a\u0438 index.html\n      ansible.builtin.copy:\n        src: files\/index.html\n        dest: \/var\/www\/html\/index.html\n        owner: www-data\n        group: www-data\n        mode: &#039;0644&#039;\n      notify: \u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a Nginx\n\n  handlers:\n    - name: \u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a Nginx\n      ansible.builtin.service:\n        name: nginx\n        state: restarted\n<\/pre><\/div>\n\n\n<p>\u042f\u043a\u0449\u043e \u0444\u0430\u0439\u043b <code>index.html<\/code> \u043d\u0435 \u0437\u043c\u0456\u043d\u044e\u0432\u0430\u0432\u0441\u044f, \u043a\u0440\u043e\u043a \u0441\u043f\u043e\u0432\u0456\u0449\u0435\u043d\u043d\u044f \u0431\u0443\u0434\u0435 \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043e, \u0456 Nginx \u043d\u0435 \u0432\u0438\u043a\u043e\u043d\u0443\u0432\u0430\u0442\u0438\u043c\u0435 \u0437\u0430\u0439\u0432\u0438\u0445 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0456\u0432.\u00a0<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u041a\u043e\u0440\u0438\u0441\u043d\u0456 \u0440\u0435\u0436\u0438\u043c\u0438 \u043f\u0435\u0440\u0435\u0432\u0456\u0440\u043a\u0438 \u0442\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0443<\/h2>\n\n\n\n<p>\u0429\u043e\u0431 \u0443\u043d\u0438\u043a\u043d\u0443\u0442\u0438 \u043f\u043e\u043c\u0438\u043b\u043e\u043a \u0443 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0456, \u043f\u0435\u0440\u0435\u0434 \u0440\u0435\u0430\u043b\u044c\u043d\u0438\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0439\u0442\u0435 \u0441\u043f\u0435\u0446\u0456\u0430\u043b\u044c\u043d\u0456 \u043f\u0440\u0430\u043f\u043e\u0440\u0446\u0456 \u043a\u043e\u043c\u0430\u043d\u0434\u0438 <code>ansible-playbook<\/code>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u041f\u0435\u0440\u0435\u0432\u0456\u0440\u043a\u0430 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0443:<\/strong><\/li>\n<\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; gutter: false; title: ; notranslate\" title=\"\">\nansible-playbook -i inventory.ini setup-webserver.yml --syntax-check\n<\/pre><\/div>\n\n\n<p>\u0428\u0432\u0438\u0434\u043a\u043e \u043f\u0435\u0440\u0435\u0432\u0456\u0440\u044f\u0454 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 YAML \u043d\u0430 \u043d\u0430\u044f\u0432\u043d\u0456\u0441\u0442\u044c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u043d\u0438\u0445 \u043f\u043e\u043c\u0438\u043b\u043e\u043a \u0431\u0435\u0437 \u043f\u0456\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044f \u0434\u043e \u0445\u043e\u0441\u0442\u0456\u0432.&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u0420\u0435\u0436\u0438\u043c \u0442\u0435\u0441\u0442\u0443\u0432\u0430\u043d\u043d\u044f (Dry-Run):<\/strong><\/li>\n<\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; gutter: false; title: ; notranslate\" title=\"\">\nansible-playbook -i inventory.ini setup-webserver.yml --check\n<\/pre><\/div>\n\n\n<p>\u041f\u043e\u043a\u0430\u0437\u0443\u0454, \u044f\u043a\u0456 \u0441\u0430\u043c\u0435 \u0437\u043c\u0456\u043d\u0438 \u0432\u0456\u0434\u0431\u0443\u043b\u0438\u0441\u044f \u0431 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445, \u0430\u043b\u0435 \u0444\u0430\u043a\u0442\u0438\u0447\u043d\u043e \u043d\u0456\u0447\u043e\u0433\u043e \u043d\u0435 \u0437\u043c\u0456\u043d\u044e\u0454.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u0414\u0435\u0442\u0430\u043b\u044c\u043d\u0438\u0439 \u0432\u0438\u0432\u0456\u0434 \u0437\u043c\u0456\u043d \u0443 \u0444\u0430\u0439\u043b\u0430\u0445:<\/strong><\/li>\n<\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; gutter: false; title: ; notranslate\" title=\"\">\nansible-playbook -i inventory.ini setup-webserver.yml --check --diff\n<\/pre><\/div>\n\n\n<p>\u0412\u0456\u0434\u043e\u0431\u0440\u0430\u0436\u0430\u0454 \u0442\u043e\u0447\u043d\u0443 \u0440\u0456\u0437\u043d\u0438\u0446\u044e \u043c\u0456\u0436 \u043f\u043e\u0442\u043e\u0447\u043d\u0438\u043c\u0438 \u0442\u0430 \u043d\u043e\u0432\u0438\u043c\u0438 \u043a\u043e\u043d\u0444\u0456\u0433\u0443\u0440\u0430\u0446\u0456\u0439\u043d\u0438\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u0420\u043e\u0437\u0448\u0438\u0440\u0435\u043d\u0456 \u043c\u043e\u0436\u043b\u0438\u0432\u043e\u0441\u0442\u0456: \u0446\u0438\u043a\u043b\u0438 \u0442\u0430 \u0443\u043c\u043e\u0432\u0438<\/h2>\n\n\n\n<p>\u0414\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0456\u0437\u0430\u0446\u0456\u0457 \u043a\u043e\u0434\u0443 \u0442\u0430 \u043f\u0456\u0434\u0442\u0440\u0438\u043c\u043a\u0438 \u0440\u0456\u0437\u043d\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0456\u0439\u043d\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u044e\u0442\u044c \u0446\u0438\u043a\u043b\u0438 (<code>loop<\/code>) \u0442\u0430 \u0443\u043c\u043e\u0432\u043d\u0456 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0438 (<code>when<\/code>).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u0421\u043a\u043e\u0440\u043e\u0447\u0435\u043d\u043d\u044f \u0437\u0430\u0432\u0434\u0430\u043d\u044c \u0437\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e \u0446\u0438\u043a\u043b\u0456\u0432<\/h3>\n\n\n\n<p>\u0417\u0430\u043c\u0456\u0441\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044f \u043e\u043a\u0440\u0435\u043c\u043e\u0433\u043e \u0437\u0430\u0432\u0434\u0430\u043d\u043d\u044f \u043f\u0456\u0434 \u043a\u043e\u0436\u0435\u043d \u043f\u0430\u043a\u0435\u0442, \u043e\u0431&#8217;\u0454\u0434\u043d\u0430\u0439\u0442\u0435 \u0457\u0445 \u0443 \u0441\u043f\u0438\u0441\u043e\u043a:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: yaml; gutter: false; title: ; notranslate\" title=\"\">\n- name: \u0412\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044f \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0443 \u0443\u0442\u0438\u043b\u0456\u0442\n  ansible.builtin.apt:\n    name: &quot;{{ item }}&quot;\n    state: present\n  loop:\n    - git\n    - curl\n    - htop\n    - vim\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">\u0412\u0438\u043a\u043e\u043d\u0430\u043d\u043d\u044f \u0437\u0430 \u0443\u043c\u043e\u0432\u043e\u044e<\/h3>\n\n\n\n<p>\u042f\u043a\u0449\u043e \u0443 \u0432\u0430\u0448\u0456\u0439 \u043c\u0435\u0440\u0435\u0436\u0456 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u044e\u0442\u044c\u0441\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0438 \u0437 \u0440\u0456\u0437\u043d\u0438\u043c\u0438 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0430\u043c\u0438 Linux, \u0432\u043a\u0430\u0436\u0456\u0442\u044c \u0443\u043c\u043e\u0432\u0438 \u0432\u0438\u043a\u043e\u043d\u0430\u043d\u043d\u044f \u0437\u0430\u0432\u0434\u0430\u043d\u044c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0456 \u0444\u0430\u043a\u0442\u0456\u0432 \u043f\u0440\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0443:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: yaml; gutter: false; title: ; notranslate\" title=\"\">\n- name: \u0412\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044f Nginx \u043d\u0430 Debian\/Ubuntu\n  ansible.builtin.apt:\n    name: nginx\n    state: present\n  when: ansible_facts&#x5B;&#039;os_family&#039;] == &quot;Debian&quot;\n\n- name: \u0412\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044f Nginx \u043d\u0430 RHEL\/Rocky Linux\n  ansible.builtin.dnf:\n    name: nginx\n    state: present\n  when: ansible_facts&#x5B;&#039;os_family&#039;] == &quot;RedHat&quot;\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">\u0412\u0438\u0441\u043d\u043e\u0432\u043e\u043a<\/h2>\n\n\n\n<p>\u0412\u0456\u0442\u0430\u0454\u043c\u043e, \u0432\u0438 \u0437\u0440\u043e\u0431\u0438\u043b\u0438 \u0437\u043d\u0430\u0447\u043d\u0438\u0439 \u043a\u0440\u043e\u043a \u0443 \u0441\u0432\u0456\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0456\u0457 \u2014 \u0440\u043e\u0437\u0456\u0431\u0440\u0430\u043b\u0438 \u0431\u0430\u0437\u043e\u0432\u0438\u0439 \u0446\u0438\u043a\u043b \u0440\u043e\u0431\u043e\u0442\u0438 \u0437 Ansible.<\/p>\n\n\n\n<p>\u0422\u0435\u043f\u0435\u0440 \u0432\u0430\u0448\u0430 \u0456\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043c\u043e\u0436\u0435 \u043e\u043f\u0438\u0441\u0443\u0432\u0430\u0442\u0438\u0441\u044f \u043a\u043e\u0434\u043e\u043c, \u044f\u043a\u0438\u0439 \u043b\u0435\u0433\u043a\u043e \u0437\u0431\u0435\u0440\u0456\u0433\u0430\u0442\u0438 \u0443 Git, \u0442\u0435\u0441\u0442\u0443\u0432\u0430\u0442\u0438 \u0442\u0430 \u0440\u043e\u0437\u0433\u043e\u0440\u0442\u0430\u0442\u0438 \u0437\u0430 \u0441\u0435\u043a\u0443\u043d\u0434\u0438.<\/p>\n\n\n\n<p>\u042f\u043a\u0449\u043e \u0432\u0438 \u0437\u0430\u0445\u043e\u0447\u0435\u0442\u0435 \u043f\u0456\u0442\u0438 \u0434\u0430\u043b\u0456 \u0437\u0430 \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u0456\u0432 \u2014 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0454\u043c\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u043d\u0438\u0439 \u043a\u0443\u0440\u0441 \u0432\u0456\u0434 ITEDU <a href=\"https:\/\/itedu.center\/ua\/courses\/administruvannia-ta-avtomatyzaciia-za-dopomogoyu-ansible\/\" target=\"_blank\" rel=\"noopener\" title=\"\" data-wpel-link=\"internal\">\u00abAnsible. \u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0443\u043c \u0437 \u0430\u0434\u043c\u0456\u043d\u0456\u0441\u0442\u0440\u0443\u0432\u0430\u043d\u043d\u044f \u0442\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0456\u0457\u00bb<\/a>. \u041d\u0430\u0432\u0447\u0430\u043d\u043d\u044f \u0442\u0440\u0438\u0432\u0430\u0454 \u0432\u0441\u044c\u043e\u0433\u043e 4 \u0442\u0438\u0436\u043d\u0456 \u0456 \u0432\u043a\u043b\u0430\u0434\u0430\u0454\u0442\u044c\u0441\u044f \u0443 8 \u0437\u0430\u043d\u044f\u0442\u044c. \u0410\u043b\u0435 \u0437\u0430 \u0446\u0435\u0439 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043f\u0435\u0440\u0456\u043e\u0434 \u0432\u0438 \u043e\u0442\u0440\u0438\u043c\u0430\u0454\u0442\u0435 \u0442\u043e\u043f\u043e\u0432\u0438\u0439 \u0431\u0443\u0441\u0442 \u0434\u043b\u044f \u0441\u0432\u043e\u0454\u0457 \u043a\u0430\u0440\u2019\u0454\u0440\u0438.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u042f\u043a\u0449\u043e \u0434\u043b\u044f \u043a\u0435\u0440\u0443\u0432\u0430\u043d\u043d\u044f \u043a\u0456\u043b\u044c\u043a\u043e\u043c\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438 \u0432\u0438 \u0434\u043e\u0441\u0456 \u043f\u0456\u0434\u043a\u043b\u044e\u0447\u0430\u0454\u0442\u0435\u0441\u044f \u0434\u043e \u043a\u043e\u0436\u043d\u043e\u0433\u043e \u0447\u0435\u0440\u0435\u0437 SSH \u0456 \u0432\u0440\u0443\u0447\u043d\u0443 \u0432\u0438\u043a\u043e\u043d\u0443\u0454\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0438 \u0432 \u0442\u0435\u0440\u043c\u0456\u043d\u0430\u043b\u0456, \u043d\u0430\u0441\u0442\u0430\u0432 \u0447\u0430\u0441 \u0437\u043c\u0456\u043d\u0438\u0442\u0438 \u043f\u0456\u0434\u0445\u0456\u0434. \u0420\u0443\u0447\u043d\u0435 \u0430\u0434\u043c\u0456\u043d\u0456\u0441\u0442\u0440\u0443\u0432\u0430\u043d\u043d\u044f \u0441\u043f\u043e\u0432\u0456\u043b\u044c\u043d\u044e\u0454 \u0440\u043e\u0431\u043e\u0442\u0443 \u0442\u0430 \u043d\u0435\u043c\u0438\u043d\u0443\u0447\u0435 \u043f\u0440\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0434\u043e \u043f\u043e\u043c\u0438\u043b\u043e\u043a \u0447\u0435\u0440\u0435\u0437 \u043b\u044e\u0434\u0441\u044c\u043a\u0438\u0439 \u0444\u0430\u043a\u0442\u043e\u0440. Ansible \u2014 \u0446\u0435 \u0456\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0456\u0457, \u044f\u043a\u0438\u0439 \u0440\u0435\u0430\u043b\u0456\u0437\u0443\u0454 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0456\u044e Infrastructure as Code (IaC). \u0412\u0438 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u043e\u043f\u0438\u0441\u0443\u0454\u0442\u0435 \u0431\u0430\u0436\u0430\u043d\u0438\u0439 \u0441\u0442\u0430\u043d \u0441\u0438\u0441\u0442\u0435\u043c\u0438 \u0443 \u0444\u0430\u0439\u043b\u0456 \u043a\u043e\u043d\u0444\u0456\u0433\u0443\u0440\u0430\u0446\u0456\u0457, \u0430 Ansible \u0441\u0430\u043c\u043e\u0441\u0442\u0456\u0439\u043d\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c&hellip;<\/p>\n","protected":false},"author":18,"featured_media":39986,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[351],"tags":[256,532,51,587,673,676],"class_list":["post-39985","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-articles","tag-ansible","tag-automation","tag-devops","tag-iac","tag-gajd","tag-prosunutyj-riven"],"translation":{"provider":"WPGlobus","version":"3.0.2","language":"uk","enabled_languages":["uk"],"languages":{"uk":{"title":true,"content":true,"excerpt":false}}},"acf":[],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/itedu.center\/ua\/blog\/wp-json\/wp\/v2\/posts\/39985","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itedu.center\/ua\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itedu.center\/ua\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itedu.center\/ua\/blog\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/itedu.center\/ua\/blog\/wp-json\/wp\/v2\/comments?post=39985"}],"version-history":[{"count":2,"href":"https:\/\/itedu.center\/ua\/blog\/wp-json\/wp\/v2\/posts\/39985\/revisions"}],"predecessor-version":[{"id":39988,"href":"https:\/\/itedu.center\/ua\/blog\/wp-json\/wp\/v2\/posts\/39985\/revisions\/39988"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/itedu.center\/ua\/blog\/wp-json\/wp\/v2\/media\/39986"}],"wp:attachment":[{"href":"https:\/\/itedu.center\/ua\/blog\/wp-json\/wp\/v2\/media?parent=39985"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itedu.center\/ua\/blog\/wp-json\/wp\/v2\/categories?post=39985"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itedu.center\/ua\/blog\/wp-json\/wp\/v2\/tags?post=39985"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}