{"id":343031,"date":"2022-12-22T21:00:46","date_gmt":"2022-12-22T21:00:46","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=343031"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2022-12-22T21:00:46","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=343031","title":{"rendered":"<span>Ansible: 30 \u0441\u0430\u043c\u044b\u0445 \u0432\u0430\u0436\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0434\u043b\u044f DevOps-\u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u043e\u0432 (\u0447\u0430\u0441\u0442\u044c 1)<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f54\/c1f\/396\/f54c1f396ae96f1d09fbfffb63deab4d.PNG\" width=\"858\" height=\"484\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041c\u043e\u0434\u0443\u043b\u0438 \u2013 \u044d\u0442\u043e \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u043b\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u0430 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0443\u0437\u0435\u043b \u0438\u043b\u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0441 \u043d\u0435\u0433\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e. Ansible \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0430 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e\u043c \u0446\u0435\u043b\u0435\u0432\u043e\u043c \u0443\u0437\u043b\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0442\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u041c\u043e\u0434\u0443\u043b\u0438 Ansible \u0442\u0430\u043a\u0436\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b \u043a\u0430\u043a \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u0437\u0430\u0434\u0430\u0447 \u0438\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u044b\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u044b.\u00a0<\/p>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u0430\u0436\u043d\u044b\u0445 Ansible-\u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u044f\u0434\u0430 \u0437\u0430\u0434\u0430\u0447. \u041d\u043e \u043e\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u0432\u0441\u0435 \u0432\u0430\u0436\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u0441\u0430\u043c\u043e\u0439 \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u0438\u0434\u0435\u0435\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0434\u0435\u043b\u0438\u043c \u0435\u0451 \u043d\u0430 \u0442\u0440\u0438 \u0447\u0430\u0441\u0442\u0438.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043c\u043e\u0434\u0443\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0445\u043e\u0441\u0442\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u0443\u0437\u043b\u0430 (\u043c\u043e\u0434\u0443\u043b\u044c ping), \u043c\u043e\u0434\u0443\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0441 \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u0443\u0437\u043b\u0430 (\u043c\u043e\u0434\u0443\u043b\u044c setup), \u043c\u043e\u0434\u0443\u043b\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043f\u0430\u043a\u0435\u0442\u043e\u043c \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u043e\u0432\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 (yum, apt, package, pip \u0438 npm \u043c\u043e\u0434\u0443\u043b\u0438), \u0430 \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0434\u0443\u043b\u044c \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u043d\u0430 \u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u0443\u0437\u043b\u0430\u0445 (raw, command, shell \u0438 script \u043c\u043e\u0434\u0443\u043b\u0438).<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043d\u0430\u0447\u043d\u0451\u043c..  <\/p>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c Ping<\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c Ping \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u043c \u0445\u043e\u0441\u0442\u0435, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043a \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u0445\u043e\u0441\u0442\u0443, \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 Python \u043d\u0430 \u043d\u0451\u043c. \u041e\u043d \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043b\u043e\u0433\u0438\u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u0432.<\/p>\n<pre><code>--- - name: ping module    hosts: all   become: false   tasks:     - name: test connection       ping:<\/code><\/pre>\n<p>\u00a0\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0431\u0443\u0434\u0435\u0442:<\/p>\n<pre><code>host-1 | SUCCESS => { \u201cansible_facts\u201d: { \u201cdiscovered_interpreter_python\u201d: \u201c\/usr\/bin\/python\u201d }, \u201cchanged\u201d: false, \u201cping\u201d: \u201cpong\u201d }<\/code><\/pre>\n<p>\u0412\u0430\u0436\u043d\u044b\u0435 \u0444\u0430\u043a\u0442\u044b \u043e \u043c\u043e\u0434\u0443\u043b\u0435 Ping:<\/p>\n<p>\u041e\u043d \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 ICMP, \u043d\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 SSH \u0438\u043b\u0438 \u043d\u0430 \u043b\u044e\u0431\u043e\u043c \u0434\u0440\u0443\u0433\u043e\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>\u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u0438\u0434\u0430 pong, crash \u0438\u043b\u0438 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438.<\/p>\n<p>Pong \u2013 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u041e\u043d \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c crash, \u0442\u043e \u044d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u0432\u0435\u0440\u043d\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435.<\/p>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c Setup<\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c Setup \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043d\u0430\u043c \u0432 \u0441\u0431\u043e\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u0443\u0437\u043b\u0430\u0445, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a hostname, ip, os \u0438 \u0434\u0440\u0443\u0433\u0438\u0445. \u042d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u043e\u043c \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e\u0431 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u043c \u0445\u043e\u0441\u0442\u0435. \u0412\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0432 \u0443\u0434\u043e\u0431\u043d\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435 t JSON, \u0430 \u0432\u0441\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c \u043f\u0440\u0435\u0434\u0448\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u201cansible_\u201d.<\/p>\n<pre><code>ansible host-1 -m setup -u ec2-user<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0432 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u0443\u044e \u0432\u044b\u0448\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443, \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/dd7\/a38\/5cd\/dd7a385cdb44dbd42f328ba92914d196.png\" width=\"848\" height=\"403\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dd7\/a38\/5cd\/dd7a385cdb44dbd42f328ba92914d196.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0444\u0438\u043b\u044c\u0442\u0440\u0430:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5ae\/5bc\/6a5\/5ae5bc6a5a8e3a32b3c7c5536e333252.png\" width=\"847\" height=\"144\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5ae\/5bc\/6a5\/5ae5bc6a5a8e3a32b3c7c5536e333252.png\"\/><figcaption><\/figcaption><\/figure>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c yum <\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c yum \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0438\u043b\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u0432 Linux \u043d\u0430 \u0431\u0430\u0437\u0435 Redhat.<\/p>\n<pre><code>--- - name: Update Package on linux system   hosts: all   become: yes   tasks:   - name: Uninstall Apache     yum:       name: nginx       state: absent   - name: Install a list of packages with a list variable     yum:       name: \"{{ packages }}\"     vars:       packages:       - httpd       - httpd-tools<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c apt<\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c apt package \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u041f\u041e \u0432 \u041e\u0421 Linux \u043d\u0430 \u0431\u0430\u0437\u0435 debian.  <\/p>\n<pre><code>--- - name: Update Package on debian system   hosts: all   become: yes   tasks:   - name: Run the equivalent of \"apt-get update\" as a separate step     apt:       update_cache: yes   - name: Install latest version of \"openjdk-6-jdk\"      apt:       name: openjdk-6-jdk       state: latest       install_recommends: no<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c package<\/h2>\n<p>\u042d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0430\u043a\u0435\u0442\u0430\u043c\u0438 \u043d\u0430 \u0446\u0435\u043b\u0435\u0432\u043e\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0435 \u0431\u0435\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 (yum, apt, \u2026). \u0415\u0433\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0433\u0435\u0442\u0435\u0440\u043e\u0433\u0435\u043d\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u0435 \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u043e\u0434 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432. \u042d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u043a\u0441\u0438-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0434\u043b\u044f \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a \u0432\u0441\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u044b \u0431\u0430\u0437\u043e\u0432\u043e\u043c\u0443 \u043c\u043e\u0434\u0443\u043b\u044e: <\/p>\n<pre><code>--- - name: Update Packages on target system   hosts: all   become: yes   tasks:   - name: Install ntpdate     ansible.builtin.package:       name: ntpdate       state: present       - name: Install the latest version of Apache and MariaDB     ansible.builtin.package:       name:         - httpd         - mariadb-server       state: latest<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c pip  <\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c pip \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043f\u0430\u043a\u0435\u0442\u0430\u043c\u0438 Python \u0432 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435.   <\/p>\n<pre><code>--- - name: Update python packages   hosts: all   become: yes   tasks:   - name: Install multi python packages with version specifiers     pip:       name:         - django>1.11.0,&lt;1.12.0         - bottle>0.10,&lt;0.20,!=0.11   - name: Install specified python requirements     pip:       requirements: \/my_app\/requirements.txt<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c npm  <\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c npm \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 node.js \u043f\u0430\u043a\u0435\u0442\u0430\u043c\u0438. \u042d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e ansible-core \u043c\u043e\u0434\u0443\u043b\u0435\u0439. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u0435, \u0443\u043a\u0430\u0436\u0438\u0442\u0435: community.general.npm.<\/p>\n<pre><code>--- - name: npm module   hosts: all   tasks:   - name: Install \"coffee-script\" node.js package.     community.general.npm:       name: coffee-script       path: \/app\/location   - name: Install packages based on package.json.     community.general.npm:       path: \/app\/location<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c raw  <\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c raw \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b SSH, \u043e\u043d\u0430 \u043e\u0447\u0435\u043d\u044c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0430, \u043d\u043e \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043b\u0438\u0448\u044c \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445.\u00a0<\/p>\n<p>\u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u043c \u0441\u043b\u0443\u0447\u0430\u0435\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Python \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 Python \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442. \u0414\u0440\u0443\u0433\u0438\u043c \u0441\u043b\u0443\u0447\u0430\u0435\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u043b\u044e\u0431\u044b\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c, \u0442\u0430\u043a\u0438\u043c \u043a\u0430\u043a \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u044b, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d Python.<\/p>\n<p>\u0412 \u043b\u044e\u0431\u043e\u043c \u0434\u0440\u0443\u0433\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u043c\u0435\u0441\u0442\u043d\u0435\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c shell \u0438\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u044c command. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0435\u043c raw, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0447\u0435\u0440\u0435\u0437 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u044b\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c shell.<\/p>\n<pre><code>--- - name: raw module usage   hosts: all   become: yes   tasks:   - name: Bootstrap a host without python2 installed     raw: dnf install -y python2 python2-dnf libselinux-python      - name: Run a command that uses non-posix shell-isms (in this example \/bin\/sh doesn't handle redirection and wildcards together but bash does)     raw: cat &lt; \/tmp\/*txt     args:       executable: \/bin\/bash<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c Command<\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c Command \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434 \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u043c \u0443\u0437\u043b\u0435. \u0412 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043e\u043d \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 Linux. \u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043c\u0430\u043d\u0434 \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u043c shell, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0430\u043a\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043a\u0430\u043a\u00a0 $HOSTNAME \u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u0438\u043f\u0430 \u201c*\u201d, \u201c&lt;\u201d, \u201c>\u201d, \u201c|\u201d, \u201c;\u201d \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u0414\u043b\u044f \u0446\u0435\u043b\u0435\u0439 Windows \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c win_command. \u0414\u043b\u044f \u0446\u0435\u043b\u0435\u0439 \u043d\u0430 \u0431\u0430\u0437\u0435 Windows win_command \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u043e \u043c\u043e\u0434\u0443\u043b\u044f command.  <\/p>\n<pre><code>--- - name: command module   hosts: all   tasks:   - name: Run command if \/path\/to\/database does not exist (without 'args')     command: \/usr\/bin\/make_database.sh db_user db_name creates=\/path\/to\/database   - name: Run command if \/path\/to\/database does not exist (with 'args' keyword)     ansible.builtin.command: \/usr\/bin\/make_database.sh db_user db_name     args:       creates: \/path\/to\/database<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c shell <\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c shell \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f shell-\u043a\u043e\u043c\u0430\u043d\u0434 \u043d\u0430 \u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u0445\u043e\u0441\u0442\u0430\u0445 \u043d\u0430 \u0431\u0430\u0437\u0435 unix. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044f Ansible command, Ansible Shell \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0441 \u043a\u0430\u043d\u0430\u043b\u0430\u043c\u0438, \u043f\u0435\u0440\u0435\u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u0435\u0439 \u0438 \u0442.\u0434. \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c shell script \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f. \u042d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u041f\u041e \u043d\u0430 \u0431\u0430\u0437\u0435 Linux, \u0430 \u043d\u0435 Windows. \u0414\u043b\u044f Windows \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c win_powershell.<\/p>\n<pre><code>--- - name: shell module   hosts: all   tasks:   - name: This command will change the working directory to somedir\/ and will only run when somedir\/somelog.txt doesn't exist     shell: somescript.sh >> somelog.txt     args:       chdir: somedir\/       creates: somelog.txt      - name: This command will change the working directory to somedir\/     shell:       cmd: ls -l | grep log       chdir: somedir\/      - name: Run a command that uses non-posix shell-isms (in this example \/bin\/sh doesn't handle redirection and wildcards together but bash does)     shell: cat &lt; \/tmp\/*txt     args:       executable: \/bin\/bash<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c script<\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c script \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u043c \u0443\u0437\u043b\u0435. \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c shell \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0435\u043c\u0443 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 shell script, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043d \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 script \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0443\u0437\u0435\u043b \u0431\u044d\u043a\u044d\u043d\u0434\u0430, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0435\u0433\u043e.\u00a0<\/p>\n<p>\u0414\u0432\u0435 \u0432\u0430\u0436\u043d\u044b\u0435 \u0432\u0435\u0449\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u043d\u0430\u0442\u044c \u043e\u0431 \u044d\u0442\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435: \u043f\u0435\u0440\u0432\u0430\u044f \u2013 \u043e\u043d \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 Python \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u043c \u0443\u0437\u043b\u0435, \u0432\u0442\u043e\u0440\u0430\u044f \u2013 script \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 shell. \u041c\u043e\u0434\u0443\u043b\u044c script \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0443\u0437\u043b\u043e\u0432 \u043d\u0430 \u0431\u0430\u0437\u0435 Windows.<\/p>\n<pre><code>--- - name: script module   hosts: all   tasks:   -  name: Run a script with arguments (free form)      ansible.builtin.script: \/some\/local\/script.sh --some-argument 1234       -  name: Run a script with arguments (using 'cmd' parameter)      ansible.builtin.script:        cmd: \/some\/local\/script.sh --some-argument 1234<\/code><\/pre>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u0441\u0435 \u043c\u043e\u0434\u0443\u043b\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0438 \u0438\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438, \u0442\u0430\u043a\u0438\u043c\u0438 \u043a\u0430\u043a \u043c\u043e\u0434\u0443\u043b\u044c \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043b\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 (\u043c\u043e\u0434\u0443\u043b\u0438 copy, fetch \u0438 get_url), \u043c\u043e\u0434\u0443\u043b\u044c \u0441\u0436\u0430\u0442\u0438\u044f \u0438 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 (\u043c\u043e\u0434\u0443\u043b\u0438 archive \u0438 unarchive), \u043c\u043e\u0434\u0443\u043b\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f\/\u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f (\u043c\u043e\u0434\u0443\u043b\u044c file), \u043c\u043e\u0434\u0443\u043b\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u043a \u0444\u0430\u0439\u043b\u0430\u043c (\u043c\u043e\u0434\u0443\u043b\u044c acl), \u043c\u043e\u0434\u0443\u043b\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 (\u043c\u043e\u0434\u0443\u043b\u044c template), \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u043e\u0438\u0441\u043a\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 (\u043c\u043e\u0434\u0443\u043b\u044c find) \u0438 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0437\u0430\u043c\u0435\u043d\u044b \u0442\u0435\u043a\u0441\u0442\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 (\u043c\u043e\u0434\u0443\u043b\u0438 replace, lineinfile \u0438 blockinfile).<\/p>\n<details class=\"spoiler\">\n<summary>\u0415\u0449\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0431 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0438 Ansible<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0422\u0435\u0445, \u043a\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u043d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438 \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Ansible, \u043c\u044b \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u043d\u0430 \u043d\u0430\u0448 \u043a\u0443\u0440\u0441 \u00a0<a href=\"https:\/\/slurm.club\/3v8lfVc\"><u>\u00abAnsible: Infrastructure as Code\u00bb<\/u><\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0439\u0434\u0435\u0442\u00a0<strong>\u0441 23 \u044f\u043d\u0432\u0430\u0440\u044f \u043f\u043e 19 \u0444\u0435\u0432\u0440\u0430\u043b\u044f<\/strong>.<\/p>\n<p>\u0417\u043d\u0430\u043d\u0438\u044f \u0438\u0437 \u043a\u0443\u0440\u0441\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u0440\u0438\u0433\u043e\u0434\u044f\u0442\u0441\u044f \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430\u043c, \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u0430\u043c \u0438 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u043c \u043f\u043e\u0434\u043d\u044f\u0442\u044c\u0441\u044f \u0432\u0432\u0435\u0440\u0445 \u043f\u043e \u043a\u0430\u0440\u044c\u0435\u0440\u043d\u043e\u0439 \u043b\u0435\u0441\u0442\u043d\u0438\u0446\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u0435\u0432\u043e\u043f\u0441\u0430.<\/p>\n<p><strong>\u041d\u0430 \u043a\u0443\u0440\u0441\u0435 \u0432\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p>\u0423\u0437\u043d\u0430\u0435\u0442\u0435 \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438, \u043a\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u0438 \u0438 \u0440\u043e\u043b\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u0432\u0435\u0440\u043d\u0435\u0442\u0435 LEMP \u0441\u0442\u0435\u043a, PostgreSQL \u0438 Mongo \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u044b,<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0434\u0435\u043f\u043b\u043e\u0438\u0442\u0435 Flask \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435;<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0441\u0432\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f Ansible;<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u0435 IaC \u0432 Gitlab;<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0435\u0442\u0435\u0441\u044c \u0441 \u0440\u0430\u0431\u043e\u0442\u043e\u0439 \u0441 \u043e\u0431\u043b\u0430\u043a\u0430\u043c\u0438 \u0438 enterprise \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0441\u043b\u0435\u00a0<a href=\"https:\/\/slurm.club\/3v8lfVc\">\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f<\/a>\u00a0\u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0443\u0442\u0438\u043d\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0431\u0435\u0437 \u0441\u0442\u0440\u0430\u0445\u0430 \u043f\u0440\u0430\u0432\u043e\u043a \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439. \u0412\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u0438 \u043a\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u043c\u043e\u0434\u0443\u043b\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043c\u0435\u043b\u043e \u0437\u0430\u043b\u0430\u0437\u0438\u0442\u044c \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442 Ansible.<\/p>\n<p>\u041a\u0443\u043f\u0438\u0442\u0435 \u043a\u0443\u0440\u0441 \u0434\u043e 28 \u0434\u0435\u043a\u0430\u0431\u0440\u044f \u0438 \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u0439\u0442\u0435 \u0432\u00a0<strong>\u0440\u043e\u0437\u044b\u0433\u0440\u044b\u0448\u0435 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 \u043d\u0430 500 000\u0420<\/strong>\u00a0\u043d\u0430 \u043a\u0443\u0440\u0441\u044b \u0421\u043b\u0451\u0440\u043c\u0430.\u00a0<\/p>\n<p><a href=\"https:\/\/slurm.club\/3v8lfVc\"><strong>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043a\u0443\u0440\u0441\u0430 \u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f.<\/strong><\/a><\/p>\n<\/div>\n<\/details>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/southbridge\/blog\/707130\/\"> https:\/\/habr.com\/ru\/company\/southbridge\/blog\/707130\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041c\u043e\u0434\u0443\u043b\u0438 \u2013 \u044d\u0442\u043e \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u043b\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u0430 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0443\u0437\u0435\u043b \u0438\u043b\u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0441 \u043d\u0435\u0433\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e. Ansible \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0430 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e\u043c \u0446\u0435\u043b\u0435\u0432\u043e\u043c \u0443\u0437\u043b\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0442\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u041c\u043e\u0434\u0443\u043b\u0438 Ansible \u0442\u0430\u043a\u0436\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b \u043a\u0430\u043a \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u0437\u0430\u0434\u0430\u0447 \u0438\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u044b\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u044b.\u00a0<\/p>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u0430\u0436\u043d\u044b\u0445 Ansible-\u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u044f\u0434\u0430 \u0437\u0430\u0434\u0430\u0447. \u041d\u043e \u043e\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u0432\u0441\u0435 \u0432\u0430\u0436\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u0441\u0430\u043c\u043e\u0439 \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u0438\u0434\u0435\u0435\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0434\u0435\u043b\u0438\u043c \u0435\u0451 \u043d\u0430 \u0442\u0440\u0438 \u0447\u0430\u0441\u0442\u0438.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043c\u043e\u0434\u0443\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0445\u043e\u0441\u0442\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u0443\u0437\u043b\u0430 (\u043c\u043e\u0434\u0443\u043b\u044c ping), \u043c\u043e\u0434\u0443\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0441 \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u0443\u0437\u043b\u0430 (\u043c\u043e\u0434\u0443\u043b\u044c setup), \u043c\u043e\u0434\u0443\u043b\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043f\u0430\u043a\u0435\u0442\u043e\u043c \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u043e\u0432\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 (yum, apt, package, pip \u0438 npm \u043c\u043e\u0434\u0443\u043b\u0438), \u0430 \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0434\u0443\u043b\u044c \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u043d\u0430 \u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u0443\u0437\u043b\u0430\u0445 (raw, command, shell \u0438 script \u043c\u043e\u0434\u0443\u043b\u0438).<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043d\u0430\u0447\u043d\u0451\u043c..  <\/p>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c Ping<\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c Ping \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u043c \u0445\u043e\u0441\u0442\u0435, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043a \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u0445\u043e\u0441\u0442\u0443, \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 Python \u043d\u0430 \u043d\u0451\u043c. \u041e\u043d \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043b\u043e\u0433\u0438\u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u0432.<\/p>\n<pre><code>--- - name: ping module    hosts: all   become: false   tasks:     - name: test connection       ping:<\/code><\/pre>\n<p>\u00a0\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0431\u0443\u0434\u0435\u0442:<\/p>\n<pre><code>host-1 | SUCCESS => { \u201cansible_facts\u201d: { \u201cdiscovered_interpreter_python\u201d: \u201c\/usr\/bin\/python\u201d }, \u201cchanged\u201d: false, \u201cping\u201d: \u201cpong\u201d }<\/code><\/pre>\n<p>\u0412\u0430\u0436\u043d\u044b\u0435 \u0444\u0430\u043a\u0442\u044b \u043e \u043c\u043e\u0434\u0443\u043b\u0435 Ping:<\/p>\n<p>\u041e\u043d \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 ICMP, \u043d\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 SSH \u0438\u043b\u0438 \u043d\u0430 \u043b\u044e\u0431\u043e\u043c \u0434\u0440\u0443\u0433\u043e\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>\u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u0438\u0434\u0430 pong, crash \u0438\u043b\u0438 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438.<\/p>\n<p>Pong \u2013 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u041e\u043d \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c crash, \u0442\u043e \u044d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u0432\u0435\u0440\u043d\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435.<\/p>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c Setup<\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c Setup \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043d\u0430\u043c \u0432 \u0441\u0431\u043e\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u0443\u0437\u043b\u0430\u0445, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a hostname, ip, os \u0438 \u0434\u0440\u0443\u0433\u0438\u0445. \u042d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u043e\u043c \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e\u0431 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u043c \u0445\u043e\u0441\u0442\u0435. \u0412\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0432 \u0443\u0434\u043e\u0431\u043d\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435 t JSON, \u0430 \u0432\u0441\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c \u043f\u0440\u0435\u0434\u0448\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u201cansible_\u201d.<\/p>\n<pre><code>ansible host-1 -m setup -u ec2-user<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0432 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u0443\u044e \u0432\u044b\u0448\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443, \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0444\u0438\u043b\u044c\u0442\u0440\u0430:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c yum <\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c yum \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0438\u043b\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u0432 Linux \u043d\u0430 \u0431\u0430\u0437\u0435 Redhat.<\/p>\n<pre><code>--- - name: Update Package on linux system   hosts: all   become: yes   tasks:   - name: Uninstall Apache     yum:       name: nginx       state: absent   - name: Install a list of packages with a list variable     yum:       name: \"{{ packages }}\"     vars:       packages:       - httpd       - httpd-tools<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c apt<\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c apt package \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u041f\u041e \u0432 \u041e\u0421 Linux \u043d\u0430 \u0431\u0430\u0437\u0435 debian.  <\/p>\n<pre><code>--- - name: Update Package on debian system   hosts: all   become: yes   tasks:   - name: Run the equivalent of \"apt-get update\" as a separate step     apt:       update_cache: yes   - name: Install latest version of \"openjdk-6-jdk\"      apt:       name: openjdk-6-jdk       state: latest       install_recommends: no<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c package<\/h2>\n<p>\u042d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0430\u043a\u0435\u0442\u0430\u043c\u0438 \u043d\u0430 \u0446\u0435\u043b\u0435\u0432\u043e\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0435 \u0431\u0435\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 (yum, apt, \u2026). \u0415\u0433\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0433\u0435\u0442\u0435\u0440\u043e\u0433\u0435\u043d\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u0435 \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u043e\u0434 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432. \u042d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u043a\u0441\u0438-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0434\u043b\u044f \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a \u0432\u0441\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u044b \u0431\u0430\u0437\u043e\u0432\u043e\u043c\u0443 \u043c\u043e\u0434\u0443\u043b\u044e: <\/p>\n<pre><code>--- - name: Update Packages on target system   hosts: all   become: yes   tasks:   - name: Install ntpdate     ansible.builtin.package:       name: ntpdate       state: present       - name: Install the latest version of Apache and MariaDB     ansible.builtin.package:       name:         - httpd         - mariadb-server       state: latest<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c pip  <\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c pip \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043f\u0430\u043a\u0435\u0442\u0430\u043c\u0438 Python \u0432 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435.   <\/p>\n<pre><code>--- - name: Update python packages   hosts: all   become: yes   tasks:   - name: Install multi python packages with version specifiers     pip:       name:         - django>1.11.0,&lt;1.12.0         - bottle>0.10,&lt;0.20,!=0.11   - name: Install specified python requirements     pip:       requirements: \/my_app\/requirements.txt<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c npm  <\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c npm \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 node.js \u043f\u0430\u043a\u0435\u0442\u0430\u043c\u0438. \u042d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e ansible-core \u043c\u043e\u0434\u0443\u043b\u0435\u0439. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u0435, \u0443\u043a\u0430\u0436\u0438\u0442\u0435: community.general.npm.<\/p>\n<pre><code>--- - name: npm module   hosts: all   tasks:   - name: Install \"coffee-script\" node.js package.     community.general.npm:       name: coffee-script       path: \/app\/location   - name: Install packages based on package.json.     community.general.npm:       path: \/app\/location<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c raw  <\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c raw \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b SSH, \u043e\u043d\u0430 \u043e\u0447\u0435\u043d\u044c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0430, \u043d\u043e \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043b\u0438\u0448\u044c \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445.\u00a0<\/p>\n<p>\u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u043c \u0441\u043b\u0443\u0447\u0430\u0435\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Python \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 Python \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442. \u0414\u0440\u0443\u0433\u0438\u043c \u0441\u043b\u0443\u0447\u0430\u0435\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u043b\u044e\u0431\u044b\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c, \u0442\u0430\u043a\u0438\u043c \u043a\u0430\u043a \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u044b, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d Python.<\/p>\n<p>\u0412 \u043b\u044e\u0431\u043e\u043c \u0434\u0440\u0443\u0433\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u043c\u0435\u0441\u0442\u043d\u0435\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c shell \u0438\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u044c command. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0435\u043c raw, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0447\u0435\u0440\u0435\u0437 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u044b\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c shell.<\/p>\n<pre><code>--- - name: raw module usage   hosts: all   become: yes   tasks:   - name: Bootstrap a host without python2 installed     raw: dnf install -y python2 python2-dnf libselinux-python      - name: Run a command that uses non-posix shell-isms (in this example \/bin\/sh doesn't handle redirection and wildcards together but bash does)     raw: cat &lt; \/tmp\/*txt     args:       executable: \/bin\/bash<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c Command<\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c Command \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434 \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u043c \u0443\u0437\u043b\u0435. \u0412 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043e\u043d \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 Linux. \u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043c\u0430\u043d\u0434 \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u043c shell, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0430\u043a\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043a\u0430\u043a\u00a0 $HOSTNAME \u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u0438\u043f\u0430 \u201c*\u201d, \u201c&lt;\u201d, \u201c>\u201d, \u201c|\u201d, \u201c;\u201d \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u0414\u043b\u044f \u0446\u0435\u043b\u0435\u0439 Windows \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c win_command. \u0414\u043b\u044f \u0446\u0435\u043b\u0435\u0439 \u043d\u0430 \u0431\u0430\u0437\u0435 Windows win_command \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u043e \u043c\u043e\u0434\u0443\u043b\u044f command.  <\/p>\n<pre><code>--- - name: command module   hosts: all   tasks:   - name: Run command if \/path\/to\/database does not exist (without 'args')     command: \/usr\/bin\/make_database.sh db_user db_name creates=\/path\/to\/database   - name: Run command if \/path\/to\/database does not exist (with 'args' keyword)     ansible.builtin.command: \/usr\/bin\/make_database.sh db_user db_name     args:       creates: \/path\/to\/database<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c shell <\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c shell \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f shell-\u043a\u043e\u043c\u0430\u043d\u0434 \u043d\u0430 \u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u0445\u043e\u0441\u0442\u0430\u0445 \u043d\u0430 \u0431\u0430\u0437\u0435 unix. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044f Ansible command, Ansible Shell \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0441 \u043a\u0430\u043d\u0430\u043b\u0430\u043c\u0438, \u043f\u0435\u0440\u0435\u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u0435\u0439 \u0438 \u0442.\u0434. \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c shell script \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f. \u042d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u041f\u041e \u043d\u0430 \u0431\u0430\u0437\u0435 Linux, \u0430 \u043d\u0435 Windows. \u0414\u043b\u044f Windows \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c win_powershell.<\/p>\n<pre><code>--- - name: shell module   hosts: all   tasks:   - name: This command will change the working directory to somedir\/ and will only run when somedir\/somelog.txt doesn't exist     shell: somescript.sh >> somelog.txt     args:       chdir: somedir\/       creates: somelog.txt      - name: This command will change the working directory to somedir\/     shell:       cmd: ls -l | grep log       chdir: somedir\/      - name: Run a command that uses non-posix shell-isms (in this example \/bin\/sh doesn't handle redirection and wildcards together but bash does)     shell: cat &lt; \/tmp\/*txt     args:       executable: \/bin\/bash<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c script<\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c script \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u043c \u0443\u0437\u043b\u0435. \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c shell \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0435\u043c\u0443 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 shell script, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043d \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 script \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0443\u0437\u0435\u043b \u0431\u044d\u043a\u044d\u043d\u0434\u0430, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0435\u0433\u043e.\u00a0<\/p>\n<p>\u0414\u0432\u0435 \u0432\u0430\u0436\u043d\u044b\u0435 \u0432\u0435\u0449\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u043d\u0430\u0442\u044c \u043e\u0431 \u044d\u0442\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435: \u043f\u0435\u0440\u0432\u0430\u044f \u2013 \u043e\u043d \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 Python \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u043c \u0443\u0437\u043b\u0435, \u0432\u0442\u043e\u0440\u0430\u044f \u2013 script \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 shell. \u041c\u043e\u0434\u0443\u043b\u044c script \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0443\u0437\u043b\u043e\u0432 \u043d\u0430 \u0431\u0430\u0437\u0435 Windows.<\/p>\n<pre><code>--- - name: script module   hosts: all   tasks:   -  name: Run a script with arguments (free form)      ansible.builtin.script: \/some\/local\/script.sh --some-argument 1234       -  name: Run a script with arguments (using 'cmd' parameter)      ansible.builtin.script:        cmd: \/some\/local\/script.sh --some-argument 1234<\/code><\/pre>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u0441\u0435 \u043c\u043e\u0434\u0443\u043b\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0438 \u0438\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438, \u0442\u0430\u043a\u0438\u043c\u0438 \u043a\u0430\u043a \u043c\u043e\u0434\u0443\u043b\u044c \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043b\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 (\u043c\u043e\u0434\u0443\u043b\u0438 copy, fetch \u0438 get_url), \u043c\u043e\u0434\u0443\u043b\u044c \u0441\u0436\u0430\u0442\u0438\u044f \u0438 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 (\u043c\u043e\u0434\u0443\u043b\u0438 archive \u0438 unarchive), \u043c\u043e\u0434\u0443\u043b\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f\/\u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f (\u043c\u043e\u0434\u0443\u043b\u044c file), \u043c\u043e\u0434\u0443\u043b\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u043a \u0444\u0430\u0439\u043b\u0430\u043c (\u043c\u043e\u0434\u0443\u043b\u044c acl), \u043c\u043e\u0434\u0443\u043b\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 (\u043c\u043e\u0434\u0443\u043b\u044c template), \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u043e\u0438\u0441\u043a\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 (\u043c\u043e\u0434\u0443\u043b\u044c find) \u0438 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0437\u0430\u043c\u0435\u043d\u044b \u0442\u0435\u043a\u0441\u0442\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 (\u043c\u043e\u0434\u0443\u043b\u0438 replace, lineinfile \u0438 blockinfile).<\/p>\n<details class=\"spoiler\">\n<summary>\u0415\u0449\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0431 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0438 Ansible<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0422\u0435\u0445, \u043a\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u043d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438 \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Ansible, \u043c\u044b \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u043d\u0430 \u043d\u0430\u0448 \u043a\u0443\u0440\u0441 \u00a0<a href=\"https:\/\/slurm.club\/3v8lfVc\"><u>\u00abAnsible: Infrastructure as Code\u00bb<\/u><\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0439\u0434\u0435\u0442\u00a0<strong>\u0441 23 \u044f\u043d\u0432\u0430\u0440\u044f \u043f\u043e 19 \u0444\u0435\u0432\u0440\u0430\u043b\u044f<\/strong>.<\/p>\n<p>\u0417\u043d\u0430\u043d\u0438\u044f \u0438\u0437 \u043a\u0443\u0440\u0441\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u0440\u0438\u0433\u043e\u0434\u044f\u0442\u0441\u044f \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430\u043c, \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u0430\u043c \u0438 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u043c \u043f\u043e\u0434\u043d\u044f\u0442\u044c\u0441\u044f \u0432\u0432\u0435\u0440\u0445 \u043f\u043e \u043a\u0430\u0440\u044c\u0435\u0440\u043d\u043e\u0439 \u043b\u0435\u0441\u0442\u043d\u0438\u0446\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u0435\u0432\u043e\u043f\u0441\u0430.<\/p>\n<p><strong>\u041d\u0430 \u043a\u0443\u0440\u0441\u0435 \u0432\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p>\u0423\u0437\u043d\u0430\u0435\u0442\u0435 \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438, \u043a\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u0438 \u0438 \u0440\u043e\u043b\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u0432\u0435\u0440\u043d\u0435\u0442\u0435 LEMP \u0441\u0442\u0435\u043a, PostgreSQL \u0438 Mongo \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u044b,<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0434\u0435\u043f\u043b\u043e\u0438\u0442\u0435 Flask \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435;<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0441\u0432\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f Ansible;<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u0435 IaC \u0432 Gitlab;<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0435\u0442\u0435\u0441\u044c \u0441 \u0440\u0430\u0431\u043e\u0442\u043e\u0439 \u0441 \u043e\u0431\u043b\u0430\u043a\u0430\u043c\u0438 \u0438 enterprise \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0441\u043b\u0435\u00a0<a href=\"https:\/\/slurm.club\/3v8lfVc\">\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f<\/a>\u00a0\u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0443\u0442\u0438\u043d\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0431\u0435\u0437 \u0441\u0442\u0440\u0430\u0445\u0430 \u043f\u0440\u0430\u0432\u043e\u043a \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439. \u0412\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u0438 \u043a\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u043c\u043e\u0434\u0443\u043b\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043c\u0435\u043b\u043e \u0437\u0430\u043b\u0430\u0437\u0438\u0442\u044c \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442 Ansible.<\/p>\n<p>\u041a\u0443\u043f\u0438\u0442\u0435 \u043a\u0443\u0440\u0441 \u0434\u043e 28 \u0434\u0435\u043a\u0430\u0431\u0440\u044f \u0438 \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u0439\u0442\u0435 \u0432\u00a0<strong>\u0440\u043e\u0437\u044b\u0433\u0440\u044b\u0448\u0435 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 \u043d\u0430 500 000\u0420<\/strong>\u00a0\u043d\u0430 \u043a\u0443\u0440\u0441\u044b \u0421\u043b\u0451\u0440\u043c\u0430.\u00a0<\/p>\n<p><a href=\"https:\/\/slurm.club\/3v8lfVc\"><strong>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043a\u0443\u0440\u0441\u0430 \u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f.<\/strong><\/a><\/p>\n<\/div>\n<\/details>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/southbridge\/blog\/707130\/\"><\/a><\/br><\/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-343031","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/343031","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=343031"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/343031\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=343031"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=343031"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=343031"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}