{"id":343235,"date":"2022-12-27T15:03:10","date_gmt":"2022-12-27T15:03:10","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=343235"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2022-12-27T15:03:10","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=343235","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 2)<\/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\/r\/w780q1\/getpro\/habr\/upload_files\/34e\/963\/4b1\/34e9634b17588e60132f143b76debcb9.jpg\" width=\"1280\" height=\"720\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/34e\/963\/4b1\/34e9634b17588e60132f143b76debcb9.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412 <a href=\"https:\/\/habr.com\/ru\/company\/southbridge\/blog\/707130\/\">\u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/a> \u043c\u044b \u043e\u0431\u0441\u0443\u0434\u0438\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u0438 Ansible \u0438 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b\u0438 \u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u0430\u0436\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u044f\u0445. \u0422\u0430\u043a\u0438\u0445, \u043a\u0430\u043a \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0445\u043e\u0441\u0442\u0430 \u0438 \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, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u0439 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438\u0437 \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u0443\u0437\u043b\u0430 (\u043c\u043e\u0434\u0443\u043b\u044c setup), \u043c\u043e\u0434\u0443\u043b\u044c \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 (\u043c\u043e\u0434\u0443\u043b\u0438 yum, apt, package, pip \u0438 npm), \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\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u043d\u0430 \u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u0443\u0437\u043b\u0430\u0445 (\u043c\u043e\u0434\u0443\u043b\u0438 raw, command, shell \u0438 script).<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0435\u0440\u0438\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<p>\u041f\u043e\u0435\u0445\u0430\u043b\u0438\u2026<\/p>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c copy<\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c copy \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u0441 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e\/\u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e. \u0414\u043b\u044f \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u0441 Windows \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c win_copy.  <\/p>\n<pre><code>--- - name: copy module   hosts: localhost   tasks:   - name: copy a file from local machine to local machine     copy:       src: files\/src.txt       dest: files\/dest.txt --- - name: copy module   hosts: all   tasks:   - name: copy a file from remote machine to remote machine     copy:       src: \/etc\/src.txt       dest: \/etc\/dest.txt    - name: copy a file from local machine to remote machine with owner and permissions     copy:       src: files\/src.txt       dest: \/etc\/dest.txt       owner: foo       group: foo       mode: '0644'<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c fetch<\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c fetch \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0441 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439. \u0424\u0430\u0439\u043b\u044b \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 \u0432 \u043e\u0437\u0430\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c \u0438\u043c\u0435\u043d\u0438 \u0445\u043e\u0441\u0442\u0430.  <\/p>\n<pre><code>--- - name: fetch module   hosts: all   tasks:   - name: copy a file from remote machine to local machine     fetch:       src: \/var\/log\/access.log       dest: \/var\/log\/fetched    - name: copy a file from local machine to remote machine with owner and permissions     copy:       src: files\/src.txt       dest: \/etc\/dest.txt       owner: foo       group: foo       mode: '0644'<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043f\u0430\u043f\u043e\u043a \u0434\u043b\u044f \u0444\u0430\u0439\u043b\u0430, \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0432 \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 flat = true.<\/p>\n<pre><code>--- - name: fetch module   hosts: all   tasks:   - name: copy a file from remote machine to local machine without parent folder structure.     fetch:       src: \/var\/log\/access.log       dest: \/var\/{{ inventory_hostname }}\/       flat: true<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c get_url<\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c get_url \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 HTTPS\/HTTP\/FTP. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u044d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u0440\u043e\u043a\u0441\u0438, \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0434\u043b\u044f \u0443\u0437\u043b\u0430. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043f\u0440\u043e\u043a\u0441\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u044b \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043e\u043f\u0446\u0438\u044e use_proxy.<\/p>\n<pre><code>--- - name: get_url module   hosts: all   tasks:   - name: download tomcat from apache      get_url:       url: https:\/\/downloads.apache.org\/tomcat\/tomcat-8\/v8.5.81\/bin\/apache-tomcat-8.5.81-deployer.tar.gz       dest: \/tmp\/download\/tomcat       mode: 0755       owner: tomcat       group: tomcat<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c archive  <\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c archive \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0436\u0430\u0442\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432 zip, tar, gz, bz2 \u0438 xz. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432\u044b\u0434\u0432\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0430 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u043f\u044b\u0442\u0430\u0435\u0442\u0435\u0441\u044c \u0441\u0436\u0430\u0442\u044c, \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0438 \u043e\u043d \u043d\u0435 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442 \u043f\u0435\u0440\u0435\u0434 \u0441\u0436\u0430\u0442\u0438\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043d\u0430 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0443\u0437\u0435\u043b. \u0412\u0430\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0438\u043c\u0435\u0442\u044c \u0432 \u0432\u0438\u0434\u0443, \u0447\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u043f\u0440\u0435\u0434\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0442\u0438\u043f\u0430 \u043f\u0430\u043a\u0435\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u0441\u0436\u0430\u0442\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u043d\u0430 \u0446\u0435\u043b\u0435\u0432\u043e\u043c \u0443\u0437\u043b\u0435.\u00a0<\/p>\n<pre><code>--- - name: archive module   hosts: all   tasks:   - name: Compress directory \/path\/to\/foo\/ into \/path\/to\/foo.tgz     archive:       path: \/path\/to\/foo       dest: \/path\/to\/foo.tgz   - name: Compress regular file \/path\/to\/foo into \/path\/to\/foo.gz and remove it     archive:       path: \/path\/to\/foo       remove: yes   - name: Create a bz2 archive of multiple files, rooted at \/path     archive:       path:       - \/path\/to\/foo       - \/path\/wong\/foo       dest: \/path\/file.tar.bz2       format: bz2   - name: Create a gz archive of a globbed path, while excluding specific dirnames     archive:       path:       - \/path\/to\/foo\/*       dest: \/path\/file.tar.bz2       exclude_path:       - \/path\/to\/foo\/bar       - \/path\/to\/foo\/baz       format: gz<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c unarchive<\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c unarchive \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u0430\u0440\u0445\u0438\u0432\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a tar, gz, zip. \u041e\u043d \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u0435\u0440\u0435\u0434 \u0435\u0433\u043e \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u043e\u0439. \u041c\u043e\u0434\u0443\u043b\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b unzip \u0438 tar -xzf \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u0441\u0436\u0430\u0442\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044d\u0442\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u043d\u0430 \u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u0443\u0437\u043b\u0430\u0445. \u0414\u043b\u044f Windows \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0437\u0435\u043b win_unzip.<\/p>\n<pre><code>--- - name: unarchive module   hosts: all   tasks:   - name: Extract foo.tgz into \/var\/lib\/foo     unarchive:       src: foo.tgz       dest: \/var\/lib\/foo    - name: Unarchive a file that is already on the remote machine     unarchive:       src: \/tmp\/foo.zip       dest: \/usr\/local\/bin       remote_src: yes    - name: Unarchive a file that needs to be downloaded      unarchive:       src: https:\/\/example.com\/example.zip       dest: \/usr\/local\/bin       remote_src: yes<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c file<\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c file \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u0438\u0445 \u0437\u0430\u0434\u0430\u0447, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432, \u0438\u0445 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u044f\u0433\u043a\u0438\u0445 \u0438 \u0436\u0435\u0441\u0442\u043a\u0438\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0441\u044b\u043b\u043e\u043a, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432 \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435. \u0414\u043b\u044f \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u0441 Windows \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c win_file.<\/p>\n<pre><code>--- - name: file module   hosts: all   tasks:   - name: Create a file     file:       path: \/etc\/foo.conf       state: touch       mode: u=rw,g=r,o=r   - name: Create a directory if it does not exist     file:       path: \/etc\/some_directory       state: directory       mode: '0755'   - name: Remove file (delete file)     file:       path: \/etc\/foo.txt       state: absent   - name: Change file ownership, group and permissions     file:       path: \/etc\/foo.conf       owner: foo       group: foo       mode: '0644'   - name: Create a symbolic link     file:       src: \/file\/to\/link\/to       dest: \/path\/to\/symlink       owner: foo       group: foo       state: link<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c acl<\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c acl \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0441\u043f\u0438\u0441\u043a\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430, \u043a\u0430\u043a \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a\u043e\u043c\u0430\u043d\u0434 getfacl \u0438 setfacl. \u042d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u0442\u0440\u0435\u0431\u0443\u0435\u0442, \u0447\u0442\u043e\u0431\u044b \u0441\u043f\u0438\u0441\u043a\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u0431\u044b\u043b\u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0432 \u0446\u0435\u043b\u0435\u0432\u0443\u044e \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 setfacl \u0438 getfacl. \u0414\u043b\u044f \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u0441 Windows \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c win_acl.<\/p>\n<pre><code>--- - name: acl module   hosts: all   tasks:   - name: Grant user Joe read access to a file     acl:       path: \/etc\/foo.conf       entity: joe       etype: user       permissions: r       state: present    - name: Removes the acl for Joe on a specific file     acl:       path: \/etc\/foo.conf       entity: joe       etype: user       state: absent    - name: Sets default acl for joe on foo.d     acl:       path: \/etc\/foo.d       entity: joe       etype: user       permissions: rw       default: yes       state: present<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c template<\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c template \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0444\u0430\u0439\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0441\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043d\u043e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435. \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u0430, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0443\u0441\u043b\u043e\u0432\u0438\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0442 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a\u043e\u0439 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043c\u0435\u043d\u0435\u043d\u044b \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 Jinj2. \u0424\u0430\u0439\u043b\u044b \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u043e\u0431\u044b\u0447\u043d\u043e \u0438\u043c\u0435\u044e\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 .j2.<\/p>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c template \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0434\u0432\u0435 \u0432\u0435\u0449\u0438: \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 Jinja2, \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0432 \u0444\u0430\u0439\u043b\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0430, \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442 (scp) \u0444\u0430\u0439\u043b \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440.<\/p>\n<pre><code>--- - name: template module   hosts: all   tasks:   - name: Template a file to \/etc\/file.conf     template:       src: \/mytemplates\/foo.j2       dest: \/etc\/file.conf       owner: bin       group: wheel       mode: '0644'<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c find<\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c find \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u0435\u0442 \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043f\u043e\u0438\u0441\u043a\u0430 Linux,\u00a0 \u043f\u043e\u043c\u043e\u0433\u0430\u044f \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0435\u0432 \u043f\u043e\u0438\u0441\u043a\u0430. \u0414\u043b\u044f Windows \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \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_find.<\/p>\n<pre><code>--- - name: find module   hosts: all   tasks:   - name: Recursively find \/tmp files older than 2 days     find:       paths: \/tmp       age: 2d       recurse: yes    - name: Recursively find \/tmp files older than 4 weeks and equal or greater than 1 megabyte     find:       paths: \/tmp       age: 4w       size: 1m       recurse: yes    - name: Recursively find \/var\/tmp files with last access time greater than 3600 seconds     find:       paths: \/var\/tmp       age: 3600       age_stamp: atime       recurse: yes<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c replace<\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c replace \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0437\u0430\u043c\u0435\u043d\u044b \u0432\u0441\u0435\u0445 \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435. \u041e\u043d \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u0443\u044e \u043a\u043e\u043f\u0438\u044e \u0444\u0430\u0439\u043b\u0430 \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043c\u0435\u043d\u043e\u0439.  <\/p>\n<pre><code>--- - name: replace module   hosts: all   tasks:   - name: Ansible replace Unix with Linux     replace:       path: \/etc\/ansible\/sample.txt       regexp: 'Unix'       replace: 'Linux'   - name: Replace before the expression till the begin of the file     replace:       path: \/etc\/apache2\/sites-available\/default.conf       before: '# live site config'       regexp: 'Unix'       replace: 'Linux'   - name: Replace between the expressions and create a backup     replace:       path: \/etc\/hosts       after: '&lt;VirtualHost [*]>'       before: '&lt;\/VirtualHost>'       regexp: 'Unix'       replace: 'Linux'       backup: yes<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c lineinfile<\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c lineinfile \u043d\u0435\u0437\u0430\u043c\u0435\u043d\u0438\u043c \u0432 \u0442\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0438\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u0444\u0430\u0439\u043b\u0435. \u041c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0436\u0438\u043c \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u0435\u0440\u0435\u0434 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0438. \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 insertafter \u0438 insertbefore \u0434\u043b\u044f \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0444\u0430\u0439\u043b\u0430.  <\/p>\n<pre><code>--- - name: lineinfile module   hosts: all   tasks:   - name: adding a line     lineinfile:       path: \/etc\/selinux\/config       regexp: '^SELINUX='       line: SELINUX=enforcing    - name: deleting a line     lineinfile:       path: \/etc\/sudoers       state: absent       regexp: '^%wheel'    - name: Replacing a line     lineinfile:       path: \/etc\/hosts       regexp: '^127\\.0\\.0\\.1'       line: 127.0.0.1 localhost   - name: replace a line only after a specified string      lineinfile:       path: \/etc\/httpd\/conf\/httpd.conf       regexp: '^Listen '       insertafter: '^#Listen '       line: Listen 8080<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c blockinfile<\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c blockinfile \u0432\u0441\u0442\u0430\u0432\u0438\u0442\/\u043e\u0431\u043d\u043e\u0432\u0438\u0442\/\u0443\u0434\u0430\u043b\u0438\u0442 \u0431\u043b\u043e\u043a \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430. \u0411\u043b\u043e\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0434\u0435\u043b\u0435\u043d \u043c\u0435\u0442\u043a\u0430\u043c\u0438, \u0442\u0430\u043a\u0438\u043c\u0438 \u043a\u0430\u043a begin \u0438 end, \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u043e\u0439. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0431\u043b\u043e\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0432 \u043a\u043e\u043d\u0435\u0446 \u0444\u0430\u0439\u043b\u0430.<\/p>\n<pre><code>--- - name: blockinfile module   hosts: all   tasks:   - name: insert a block into a file     blockinfile:       path: \/etc\/ssh\/sshd_config       block: |         Match User ansible-agent         PasswordAuthentication no   - name: Insert\/Update HTML surrounded by custom markers after &lt;body> line     blockinfile:       path: \/var\/www\/html\/index.html       marker: \"&lt;!-- {mark} ANSIBLE MANAGED BLOCK -->\"       insertafter: \"&lt;body>\"       block: |         &lt;h1>Welcome to {{ ansible_hostname }}&lt;\/h1>         &lt;p>Last updated on {{ ansible_date_time.iso8601 }}&lt;\/p><\/code><\/pre>\n<p>\u0412 \u0442\u0440\u0435\u0442\u044c\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0435\u0440\u0438\u0438 \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u043c\u043e\u0434\u0443\u043b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 (\u043c\u043e\u0434\u0443\u043b\u044c service), \u043c\u043e\u0434\u0443\u043b\u044f\u0445 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u0438 \u0433\u0440\u0443\u043f\u043f\u0430\u043c\u0438 (\u043c\u043e\u0434\u0443\u043b\u044c user \u0438 \u043c\u043e\u0434\u0443\u043b\u044c group), \u043c\u043e\u0434\u0443\u043b\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f cron (\u043c\u043e\u0434\u0443\u043b\u044c cron), \u043c\u043e\u0434\u0443\u043b\u0435 \u043f\u0435\u0447\u0430\u0442\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u0430 (\u043c\u043e\u0434\u0443\u043b\u044c debug) \u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u0445, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438 \u0440\u043e\u043b\u0438 (\u043c\u043e\u0434\u0443\u043b\u044c include_vars \u0438 \u043c\u043e\u0434\u0443\u043b\u044c include_role). <\/p>\n<details class=\"spoiler\">\n<summary>\u0415\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 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\/3jvGMEZ\"><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\/3jvGMEZ\">\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\/3jvGMEZ\"><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\/707986\/\"> https:\/\/habr.com\/ru\/company\/southbridge\/blog\/707986\/<\/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>\u0412 <a href=\"https:\/\/habr.com\/ru\/company\/southbridge\/blog\/707130\/\">\u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/a> \u043c\u044b \u043e\u0431\u0441\u0443\u0434\u0438\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u0438 Ansible \u0438 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b\u0438 \u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u0430\u0436\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u044f\u0445. \u0422\u0430\u043a\u0438\u0445, \u043a\u0430\u043a \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0445\u043e\u0441\u0442\u0430 \u0438 \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, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u0439 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438\u0437 \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u0443\u0437\u043b\u0430 (\u043c\u043e\u0434\u0443\u043b\u044c setup), \u043c\u043e\u0434\u0443\u043b\u044c \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 (\u043c\u043e\u0434\u0443\u043b\u0438 yum, apt, package, pip \u0438 npm), \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\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u043d\u0430 \u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u0443\u0437\u043b\u0430\u0445 (\u043c\u043e\u0434\u0443\u043b\u0438 raw, command, shell \u0438 script).<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0435\u0440\u0438\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<p>\u041f\u043e\u0435\u0445\u0430\u043b\u0438\u2026<\/p>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c copy<\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c copy \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u0441 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e\/\u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e. \u0414\u043b\u044f \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u0441 Windows \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c win_copy.  <\/p>\n<pre><code>--- - name: copy module   hosts: localhost   tasks:   - name: copy a file from local machine to local machine     copy:       src: files\/src.txt       dest: files\/dest.txt --- - name: copy module   hosts: all   tasks:   - name: copy a file from remote machine to remote machine     copy:       src: \/etc\/src.txt       dest: \/etc\/dest.txt    - name: copy a file from local machine to remote machine with owner and permissions     copy:       src: files\/src.txt       dest: \/etc\/dest.txt       owner: foo       group: foo       mode: '0644'<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c fetch<\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c fetch \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0441 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439. \u0424\u0430\u0439\u043b\u044b \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 \u0432 \u043e\u0437\u0430\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c \u0438\u043c\u0435\u043d\u0438 \u0445\u043e\u0441\u0442\u0430.  <\/p>\n<pre><code>--- - name: fetch module   hosts: all   tasks:   - name: copy a file from remote machine to local machine     fetch:       src: \/var\/log\/access.log       dest: \/var\/log\/fetched    - name: copy a file from local machine to remote machine with owner and permissions     copy:       src: files\/src.txt       dest: \/etc\/dest.txt       owner: foo       group: foo       mode: '0644'<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043f\u0430\u043f\u043e\u043a \u0434\u043b\u044f \u0444\u0430\u0439\u043b\u0430, \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0432 \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 flat = true.<\/p>\n<pre><code>--- - name: fetch module   hosts: all   tasks:   - name: copy a file from remote machine to local machine without parent folder structure.     fetch:       src: \/var\/log\/access.log       dest: \/var\/{{ inventory_hostname }}\/       flat: true<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c get_url<\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c get_url \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 HTTPS\/HTTP\/FTP. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u044d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u0440\u043e\u043a\u0441\u0438, \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0434\u043b\u044f \u0443\u0437\u043b\u0430. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043f\u0440\u043e\u043a\u0441\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u044b \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043e\u043f\u0446\u0438\u044e use_proxy.<\/p>\n<pre><code>--- - name: get_url module   hosts: all   tasks:   - name: download tomcat from apache      get_url:       url: https:\/\/downloads.apache.org\/tomcat\/tomcat-8\/v8.5.81\/bin\/apache-tomcat-8.5.81-deployer.tar.gz       dest: \/tmp\/download\/tomcat       mode: 0755       owner: tomcat       group: tomcat<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c archive  <\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c archive \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0436\u0430\u0442\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432 zip, tar, gz, bz2 \u0438 xz. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432\u044b\u0434\u0432\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0430 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u043f\u044b\u0442\u0430\u0435\u0442\u0435\u0441\u044c \u0441\u0436\u0430\u0442\u044c, \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0438 \u043e\u043d \u043d\u0435 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442 \u043f\u0435\u0440\u0435\u0434 \u0441\u0436\u0430\u0442\u0438\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043d\u0430 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0443\u0437\u0435\u043b. \u0412\u0430\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0438\u043c\u0435\u0442\u044c \u0432 \u0432\u0438\u0434\u0443, \u0447\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u043f\u0440\u0435\u0434\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0442\u0438\u043f\u0430 \u043f\u0430\u043a\u0435\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u0441\u0436\u0430\u0442\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u043d\u0430 \u0446\u0435\u043b\u0435\u0432\u043e\u043c \u0443\u0437\u043b\u0435.\u00a0<\/p>\n<pre><code>--- - name: archive module   hosts: all   tasks:   - name: Compress directory \/path\/to\/foo\/ into \/path\/to\/foo.tgz     archive:       path: \/path\/to\/foo       dest: \/path\/to\/foo.tgz   - name: Compress regular file \/path\/to\/foo into \/path\/to\/foo.gz and remove it     archive:       path: \/path\/to\/foo       remove: yes   - name: Create a bz2 archive of multiple files, rooted at \/path     archive:       path:       - \/path\/to\/foo       - \/path\/wong\/foo       dest: \/path\/file.tar.bz2       format: bz2   - name: Create a gz archive of a globbed path, while excluding specific dirnames     archive:       path:       - \/path\/to\/foo\/*       dest: \/path\/file.tar.bz2       exclude_path:       - \/path\/to\/foo\/bar       - \/path\/to\/foo\/baz       format: gz<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c unarchive<\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c unarchive \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u0430\u0440\u0445\u0438\u0432\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a tar, gz, zip. \u041e\u043d \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u0435\u0440\u0435\u0434 \u0435\u0433\u043e \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u043e\u0439. \u041c\u043e\u0434\u0443\u043b\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b unzip \u0438 tar -xzf \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u0441\u0436\u0430\u0442\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044d\u0442\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u043d\u0430 \u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u0443\u0437\u043b\u0430\u0445. \u0414\u043b\u044f Windows \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0437\u0435\u043b win_unzip.<\/p>\n<pre><code>--- - name: unarchive module   hosts: all   tasks:   - name: Extract foo.tgz into \/var\/lib\/foo     unarchive:       src: foo.tgz       dest: \/var\/lib\/foo    - name: Unarchive a file that is already on the remote machine     unarchive:       src: \/tmp\/foo.zip       dest: \/usr\/local\/bin       remote_src: yes    - name: Unarchive a file that needs to be downloaded      unarchive:       src: https:\/\/example.com\/example.zip       dest: \/usr\/local\/bin       remote_src: yes<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c file<\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c file \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u0438\u0445 \u0437\u0430\u0434\u0430\u0447, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432, \u0438\u0445 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u044f\u0433\u043a\u0438\u0445 \u0438 \u0436\u0435\u0441\u0442\u043a\u0438\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0441\u044b\u043b\u043e\u043a, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432 \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435. \u0414\u043b\u044f \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u0441 Windows \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c win_file.<\/p>\n<pre><code>--- - name: file module   hosts: all   tasks:   - name: Create a file     file:       path: \/etc\/foo.conf       state: touch       mode: u=rw,g=r,o=r   - name: Create a directory if it does not exist     file:       path: \/etc\/some_directory       state: directory       mode: '0755'   - name: Remove file (delete file)     file:       path: \/etc\/foo.txt       state: absent   - name: Change file ownership, group and permissions     file:       path: \/etc\/foo.conf       owner: foo       group: foo       mode: '0644'   - name: Create a symbolic link     file:       src: \/file\/to\/link\/to       dest: \/path\/to\/symlink       owner: foo       group: foo       state: link<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c acl<\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c acl \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0441\u043f\u0438\u0441\u043a\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430, \u043a\u0430\u043a \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a\u043e\u043c\u0430\u043d\u0434 getfacl \u0438 setfacl. \u042d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u0442\u0440\u0435\u0431\u0443\u0435\u0442, \u0447\u0442\u043e\u0431\u044b \u0441\u043f\u0438\u0441\u043a\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u0431\u044b\u043b\u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0432 \u0446\u0435\u043b\u0435\u0432\u0443\u044e \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 setfacl \u0438 getfacl. \u0414\u043b\u044f \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u0441 Windows \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c win_acl.<\/p>\n<pre><code>--- - name: acl module   hosts: all   tasks:   - name: Grant user Joe read access to a file     acl:       path: \/etc\/foo.conf       entity: joe       etype: user       permissions: r       state: present    - name: Removes the acl for Joe on a specific file     acl:       path: \/etc\/foo.conf       entity: joe       etype: user       state: absent    - name: Sets default acl for joe on foo.d     acl:       path: \/etc\/foo.d       entity: joe       etype: user       permissions: rw       default: yes       state: present<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c template<\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c template \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0444\u0430\u0439\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0441\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043d\u043e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435. \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u0430, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0443\u0441\u043b\u043e\u0432\u0438\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0442 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a\u043e\u0439 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043c\u0435\u043d\u0435\u043d\u044b \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 Jinj2. \u0424\u0430\u0439\u043b\u044b \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u043e\u0431\u044b\u0447\u043d\u043e \u0438\u043c\u0435\u044e\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 .j2.<\/p>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c template \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0434\u0432\u0435 \u0432\u0435\u0449\u0438: \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 Jinja2, \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0432 \u0444\u0430\u0439\u043b\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0430, \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442 (scp) \u0444\u0430\u0439\u043b \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440.<\/p>\n<pre><code>--- - name: template module   hosts: all   tasks:   - name: Template a file to \/etc\/file.conf     template:       src: \/mytemplates\/foo.j2       dest: \/etc\/file.conf       owner: bin       group: wheel       mode: '0644'<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c find<\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c find \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u0435\u0442 \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043f\u043e\u0438\u0441\u043a\u0430 Linux,\u00a0 \u043f\u043e\u043c\u043e\u0433\u0430\u044f \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0435\u0432 \u043f\u043e\u0438\u0441\u043a\u0430. \u0414\u043b\u044f Windows \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \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_find.<\/p>\n<pre><code>--- - name: find module   hosts: all   tasks:   - name: Recursively find \/tmp files older than 2 days     find:       paths: \/tmp       age: 2d       recurse: yes    - name: Recursively find \/tmp files older than 4 weeks and equal or greater than 1 megabyte     find:       paths: \/tmp       age: 4w       size: 1m       recurse: yes    - name: Recursively find \/var\/tmp files with last access time greater than 3600 seconds     find:       paths: \/var\/tmp       age: 3600       age_stamp: atime       recurse: yes<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c replace<\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c replace \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0437\u0430\u043c\u0435\u043d\u044b \u0432\u0441\u0435\u0445 \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435. \u041e\u043d \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u0443\u044e \u043a\u043e\u043f\u0438\u044e \u0444\u0430\u0439\u043b\u0430 \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043c\u0435\u043d\u043e\u0439.  <\/p>\n<pre><code>--- - name: replace module   hosts: all   tasks:   - name: Ansible replace Unix with Linux     replace:       path: \/etc\/ansible\/sample.txt       regexp: 'Unix'       replace: 'Linux'   - name: Replace before the expression till the begin of the file     replace:       path: \/etc\/apache2\/sites-available\/default.conf       before: '# live site config'       regexp: 'Unix'       replace: 'Linux'   - name: Replace between the expressions and create a backup     replace:       path: \/etc\/hosts       after: '&lt;VirtualHost [*]>'       before: '&lt;\/VirtualHost>'       regexp: 'Unix'       replace: 'Linux'       backup: yes<\/code><\/pre>\n<h2>\u041c\u043e\u0434\u0443\u043b\u044c lineinfile<\/h2>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c lineinfile \u043d\u0435\u0437\u0430\u043c\u0435\u043d\u0438\u043c \u0432 \u0442\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0438\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u0444\u0430\u0439\u043b\u0435. \u041c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0436\u0438\u043c \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u0435\u0440\u0435\u0434 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0438. \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 insertafter \u0438 insertbefore \u0434\u043b\u044f \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0444\u0430\u0439\u043b\u0430.  <\/p>\n<pre><code>--- - name: lineinfile module   hosts: all   tasks:   - name: adding a line     lineinfile:       path: \/etc\/selinux\/config       regexp: '^SELINUX='      <\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-343235","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/343235","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=343235"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/343235\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=343235"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=343235"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=343235"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}