{"id":597,"date":"2019-02-08T13:49:06","date_gmt":"2019-02-08T10:49:06","guid":{"rendered":"https:\/\/artem.services\/?p=597"},"modified":"2019-02-14T14:45:06","modified_gmt":"2019-02-14T11:45:06","slug":"saltstack-%d1%83%d1%81%d1%82%d0%b0%d0%bd%d0%be%d0%b2%d0%ba%d0%b0","status":"publish","type":"post","link":"https:\/\/artem.services\/?p=597","title":{"rendered":"SaltStack &#8212; \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430"},"content":{"rendered":"<h4>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 <strong>Master<\/strong>&#39;\u0430<\/h4>\n<p><strong>CentOS 7<\/strong><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nyum install https:\/\/repo.saltstack.com\/yum\/redhat\/salt-repo-latest.el7.noarch.rpm\r\n\r\nyum install salt-master salt-minion salt-ssh salt-syndic salt-cloud salt-api\r\n<\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsystemctl enable salt-master\r\nsystemctl start salt-master\r\n<\/pre>\n<blockquote><p>\u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0435\u0441\u0442\u044c \u0432 <strong>EPEL<\/strong> \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/p><\/blockquote>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nyum install epel-release\r\n<\/pre>\n<p><!--more--><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Ubuntu &#8212; 18.04<\/strong><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nwget -O - https:\/\/repo.saltstack.com\/apt\/ubuntu\/18.04\/amd64\/latest\/SALTSTACK-GPG-KEY.pub | sudo apt-key add -\r\n\r\necho -e &quot;deb http:\/\/repo.saltstack.com\/apt\/ubuntu\/18.04\/amd64\/latest bionic main&quot; &gt; \/etc\/apt\/sources.list.d\/saltstack.list\r\n\r\napt update\r\n\r\napt install salt-master salt-minion salt-ssh salt-syndic salt-cloud salt-api\r\n<\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsystemctl enable salt-master\r\nsystemctl start salt-master\r\n<\/pre>\n<p>\u0412 <strong>Salt<\/strong>&#39;\u0435 \u043c\u0438\u043d\u044c\u043e\u043d\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u043a \u043c\u0430\u0441\u0442\u0435\u0440\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u043f\u043e\u0440\u0442\u044b <strong>TCP 4505<\/strong>,<strong>4506<\/strong> \u043d\u0430 \u043c\u0430\u0441\u0442\u0435\u0440\u0435, \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b <strong>Saltstack<\/strong>&#39;\u0430.<\/p>\n<p>&nbsp;<\/p>\n<h4>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Minion&#8217;\u0430<\/h4>\n<p><strong>CentOS<\/strong>:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nyum install salt-minion salt-ssh\r\n<\/pre>\n<p><strong>Ubuntu<\/strong>:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\napt install salt-minion salt-ssh\r\n<\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsystemctl enable salt-minion\r\nsystemctl start salt-minion\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h4>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435:<\/h4>\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043c\u0438\u043d\u044c\u043e\u043d\u044b \u0438\u0449\u0443\u0442 \u043c\u0430\u0441\u0442\u0435\u0440\u0430 \u0432 \u0441\u0435\u0442\u0438 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c &quot;<strong>salt<\/strong>&quot;.<\/p>\n<p>\u0414\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043d\u0443\u0436\u043d\u043e \u043b\u0438\u0431\u043e \u0432 \u0444\u0430\u0439\u043b\u0435 &quot;<strong>\/etc\/salt\/minion<\/strong>&quot; \u043d\u0430\u0439\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u0443:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n#master: salt\r\n<\/pre>\n<p>\u0420\u0430\u0441\u043a\u043e\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u043c\u044f, \u0438\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c IP \u0430\u0434\u0440\u0435\u0441, \u0437\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043c\u0438\u043d\u044c\u043e\u043d\u0430, \u0438\u043b\u0438 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0432 &quot;<strong>\/etc\/hosts<\/strong>&quot; \u0437\u0430\u043f\u0438\u0441\u044c &quot;<strong>salt<\/strong>&quot; \u0441 IP \u0430\u0434\u0440\u0435\u0441\u043e\u043c \u043c\u0430\u0441\u0442\u0435\u0440\u0430.<\/p>\n<p>\u041d\u0430 \u043c\u0430\u0441\u0442\u0435\u0440\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsalt-key -L\r\nAccepted Keys:\r\nDenied Keys:\r\nUnaccepted Keys:\r\nip-172-31-22-119.ec2.internal\r\nRejected Keys:\r\n<\/pre>\n<p>\u0418 \u0432\u0438\u0434\u0438\u043c:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nUnaccepted Keys:\r\nip-172-31-22-119.ec2.internal\r\n<\/pre>\n<p>\u0427\u0442\u043e \u043e\u0434\u0438\u043d \u043a\u043b\u044e\u0447 \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u043e\u0434\u043e\u0431\u0440\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f \u0441\u0440\u0430\u0437\u0443 \u0432\u0441\u0435\u0445 \u043a\u043b\u044e\u0447\u0435\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsalt-key -A\r\n<\/pre>\n<blockquote><p>\u042d\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u044d\u0442\u043e \u0442\u043e\u0447\u043d\u043e \u0432\u0430\u0448\u0438 \u043c\u0438\u043d\u044c\u043e\u043d\u044b. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u0441\u0432\u0435\u0440\u044c\u0442\u0435 \u043e\u0442\u043f\u0435\u0447\u0430\u0442\u043a\u0438 \u043a\u043b\u044e\u0447\u0435\u0439.<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434.<\/h4>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsalt '*' test.ping\r\n<\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c &quot;\u0436\u0438\u0432\u0443\u0447\u0435\u0441\u0442\u044c&quot; \u0432\u0441\u0435\u0445 \u043c\u0438\u043d\u044c\u043e\u043d\u043e\u0432, \u043e\u043d\u0438 \u0432 \u043e\u0442\u0432\u0435\u0442 \u043e\u043d\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0438\u0441\u043b\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442 &quot;<strong>True<\/strong>&quot;<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nip-172-31-22-119.ec2.internal:\r\n    True\r\n<\/pre>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043d\u0430 \u0432\u0441\u0435\u0445 \u043c\u0438\u043d\u044c\u043e\u043d\u0430\u0445, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u044d\u0442\u043e \u043b\u0438\u0441\u0442\u0438\u043d\u0433 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 &quot;<strong>\/home<\/strong>&quot;<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsalt '*' cmd.run 'ls -l \/home\/'\r\n<\/pre>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043d\u0430 \u0432\u0441\u0435\u0445 \u043c\u0438\u043d\u044c\u043e\u043d\u0430\u0445 \u043f\u0430\u043a\u0435\u0442 &quot;<strong>vim<\/strong>&quot;<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsalt '*' pkg.install vim\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Master&#39;\u0430 CentOS 7 \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c: \u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0435\u0441\u0442\u044c \u0432 EPEL \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[162,161],"_links":{"self":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/597"}],"collection":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=597"}],"version-history":[{"count":5,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/597\/revisions"}],"predecessor-version":[{"id":602,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/597\/revisions\/602"}],"wp:attachment":[{"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=597"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=597"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=597"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}