{"id":286223,"date":"2017-05-12T12:50:02","date_gmt":"2017-05-12T08:50:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=286223"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=286223","title":{"rendered":"Ansible \u0438 telnet: \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u043b\u044c\u0437\u044f, \u043d\u043e \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0447\u0435\u0442\u0441\u044f"},"content":{"rendered":"<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/web\/5c7\/48c\/b7f\/5c748cb7f46f4efb8962f1bd99cc2c47.png\" \/><\/div>\n<p>  <\/p>\n<blockquote><p>Telnet is a obviously a very insecure protocol, completely insecure in fact, and we strongly want to discourage usage. We would likely refuse the pull request, to be honest \u2014 it is just asking for a world of hurt should MITM possibilities arise.<\/p><\/blockquote>\n<p><i> \u2014 Michael DeHaan, \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u044c Ansible<\/i><\/p>\n<p>  \u0410\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0441\u043e\u0433\u043b\u0430\u0441\u0435\u043d. \u042d\u043c, \u0430 \u043a\u0430\u043a \u043c\u043d\u0435 \u0431\u044b\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u0443 \u043c\u0435\u043d\u044f 20 \u0442\u044b\u0441\u044f\u0447 legacy \u0441\u0432\u0438\u0442\u0447\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044e\u0442\u0441\u044f\/\u0437\u0430\u0432\u0438\u0441\u0430\u044e\u0442 \u0438\u0437-\u0437\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u043e SSH, \u0430 \u0447\u0430\u0441\u0442\u044c \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0435\u0433\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442?<br \/>  \u041f\u0440\u043e\u0448\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442.<br \/>  <a name=\"habracut\"><\/a><cut text=\"\u042d\u0445, \u043e\u043f\u044f\u0442\u044c \u043a\u043e\u0441\u0442\u044b\u043b\u044c!\"\/>  <\/p>\n<h2>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 Ansible<\/h2>\n<p>  <\/p>\n<h3>SSH<\/h3>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 (\u0440\u0435\u043b\u0438\u0437 2.3.0) \u0432 Ansible \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f 3 \u0432\u0438\u0434\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439: <\/p>\n<ul>\n<li>SSH<\/li>\n<li>Local<\/li>\n<li>Docker<\/li>\n<\/ul>\n<p>  \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 SSH \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 2 \u0442\u0438\u043f\u043e\u0432 \u0438 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0430 \u2013 ssh \u0438 paramiko. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043e \u0432\u0435\u0440\u0441\u0438\u0438 Ansible 1.3, \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 smart (\u0442.\u0435. OpenSSH), \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0441\u043a\u043e\u0440\u044f\u044f \u0440\u0430\u0431\u043e\u0442\u0443 SSH \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0443\u043b\u044c\u0442\u0438\u043f\u043b\u0435\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (\u0444\u0443\u043d\u043a\u0446\u0438\u044f Control Master). \u0414\u043b\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 legacy \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c paramiko, \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044f \u043a\u043b\u044e\u0447 <code>\u2013c paramiko<\/code> \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438\/\u043f\u043b\u0435\u0439\u0431\u0443\u043a\u0430\u043c\u0438.<\/p>\n<p>  <b>\u0412\u0430\u0436\u043d\u043e: \u043f\u0440\u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e \u043f\u0430\u0440\u043e\u043b\u044e, \u0430 \u043d\u0435 \u043f\u043e \u043a\u043b\u044e\u0447\u0430\u043c \u0432\u043c\u0435\u0441\u0442\u043e ssh \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f sshpass.<\/b><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u043f\u0430\u043a\u0435\u0442.<\/p>\n<pre><code class=\"bash\">sudo apt-get install sshpass<\/code><\/pre>\n<p>  \u0414\u043b\u044f RHEL-based \u0441\u0438\u0441\u0442\u0435\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c EPEL<\/p>\n<pre><code class=\"bash\">yum --enablerepo=epel install sshpass<\/code><\/pre>\n<p>  \u0414\u043b\u044f SSH \u0435\u0441\u0442\u044c \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c raw, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u043e\u0434\u043d\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u043e\u043c\u0443 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0445\u043e\u0441\u0442\u043e\u0432 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0449\u0438\u0439 \u0432\u044b\u0432\u043e\u0434 \u0441\u043e \u0432\u0441\u0435\u0445 \u0445\u043e\u0441\u0442\u043e\u0432. \u0414\u043b\u044f Telnet \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f playbook, \u0438\u043c\u0435\u044e\u0449\u0438\u043c \u0441\u0445\u043e\u0436\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b.<\/p>\n<h3>Telnet<\/h3>\n<p>  \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Telnet \u043c\u044b \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0438\u043f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f <i>local<\/i>. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u044b playbook \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430 \u0445\u043e\u0441\u0442\u0435 Ansible (\u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u0432\u0438\u0442\u0447\u0430\u0445 \u0432\u0440\u044f\u0434 \u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d Python, \u0445\u0435\u0445).<\/p>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c:<\/p>\n<pre><code class=\"bash\">sudo apt-get install telnet<\/code><\/pre>\n<p>  \u0438\u043b\u0438 <\/p>\n<pre><code class=\"bash\">yum install telnet<\/code><\/pre>\n<p>  \u0415\u0449\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f <i>pexpect<\/i>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0439 <i>pip<\/i>. Pip \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 Ansible, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c:<\/p>\n<pre><code class=\"bash\">pip install pexpect<\/code><\/pre>\n<p>  \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430.<\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 inventory<\/h2>\n<p>  <\/p>\n<h4>\u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u043e\u043c <i>\/etc\/ansible\/hosts<\/i><\/h4>\n<p>  <\/p>\n<pre><code>[test_cluster] 192.168.0.[10:25]<\/code><\/pre>\n<p>  \u0418\u0442\u0430\u043a, \u043d\u0430\u0448\u0438 \u043a\u043e\u043c\u043c\u0443\u0442\u0430\u0442\u043e\u0440\u044b \u0432\u0445\u043e\u0434\u044f\u0442 \u0432 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c test_cluster, \u0438\u043c\u0435\u044e\u0442 IP-\u0430\u0434\u0440\u0435\u0441\u0430 \u0441\u043e 192.168.0.10 \u043f\u043e 192.168.0.25. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043d\u0430 \u043d\u0438\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u0435\u0434\u0438\u043d\u044b\u0439 \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u0441 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430, \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d \u0434\u043e\u0441\u0442\u0443\u043f \u043f\u043e telnet.<\/p>\n<h4>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u0430\u0448 playbook \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 <i>.yml<\/i><\/h4>\n<p>  <\/p>\n<pre><code class=\"python\">---  - hosts: test_cluster   gather_facts: false   connection: local   tasks:   - name: telnet,login and execute command     ignore_errors: true     expect:       command: telnet &quot;{{ inventory_hostname }}&quot;       responses:         (?i)username: &quot;admin&quot;         (?i)password: &quot;12345&quot;         (?i)#: &quot;{{COMMAND}}\\r\\nlogout\\r\\nexit\\r\\nquit&quot;       echo: yes     register: telnet_output     - name: Debug output     debug: var=telnet_output.stdout_lines<\/code><\/pre>\n<p>  <\/p>\n<h4>\u0418\u0434\u0435\u043c \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443:<\/h4>\n<p>  <\/p>\n<pre><code>hosts: test_cluster<\/code><\/pre>\n<p>  \u0425\u043e\u0441\u0442\u044b, \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/p>\n<pre><code>gather_facts: false<\/code><\/pre>\n<p>  \u041d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0441\u0435\u0442\u0435\u0432\u044b\u043c \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c <\/p>\n<pre><code>connection: local<\/code><\/pre>\n<p>  <i>Pexpect<\/i> \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0445\u043e\u0441\u0442\u0435 Ansible.<\/p>\n<pre><code>tasks:<\/code><\/pre>\n<p>  \u041d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438<\/p>\n<pre><code>ignore_errors: true<\/code><\/pre>\n<p>  \u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432 \u0432\u044b\u0432\u043e\u0434\u0435 \u2013 \u0438\u0437-\u0437\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u043c\u043e\u0434\u0443\u043b\u044f expect \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 FAILED. \u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c.<\/p>\n<pre><code>command: telnet &quot;{{ inventory_hostname }}&quot;<\/code><\/pre>\n<p>  \u0418\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0445\u043e\u0441\u0442\u0435 Ansible, \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a\u043e \u0432\u0441\u0435\u043c \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u043c \u0445\u043e\u0441\u0442\u0430\u043c.<\/p>\n<pre><code>responses:<\/code><\/pre>\n<p>  <code>(?i)<\/code> \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440. <br \/>  \u0414\u043e <code>:<\/code> \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u043e\u0436\u0438\u0434\u0430\u0435\u043c, \u043f\u043e\u0441\u043b\u0435 \u2013 \u0447\u0435\u043c \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u043c.<br \/>  <code>#<\/code> \u2014 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0447\u0442\u043e \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u0430, \u043c\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u0432 \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435; \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u043c \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0435\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0441 \u0432\u044b\u0445\u043e\u0434\u043e\u043c \u0438\u0437 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430 (logout\/exit\/quit)<\/p>\n<p>  \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 expect \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u0434\u043e\u0441\u043a\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u043d\u0438\u0435 CLI \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430, \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043d\u0430\u0432\u044b\u043a\u043e\u0432 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0441 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u043c\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438 python. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 <code>#: &quot;save&quot;<\/code> \u0431\u0443\u0434\u0435\u0442 \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u043e, \u0442.\u043a. \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e \u043f\u0435\u0440\u0432\u043e\u043c\u0443 \u0443\u0441\u043b\u043e\u0432\u0438\u044e <code>#: &quot;{{COMMAND}}\\r\\nlogout\\r\\nexit\\r\\nquit&quot;<\/code><\/p>\n<pre><code>register: telnet_output<\/code><\/pre>\n<p>  \u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u044b\u0432\u043e\u0434, \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e telnet_output. <code>Debug<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0430\u043c \u0432\u044b\u0432\u043e\u0434 \u0432 \u0443\u0434\u043e\u0431\u043d\u043e\u043c \u0432\u0438\u0434\u0435.<\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c playbook c \u043d\u0443\u0436\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"bash\">ansible-playbook raw_telnet.yml  -e '{&quot;COMMAND&quot;:&quot;show stp&quot;}'<\/code><\/pre>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f:<\/p>\n<pre><code>        &quot;Command: show stp&quot;,         &quot;&quot;,         &quot;&quot;,         &quot;&quot;,         &quot;STP Bridge Global Settings&quot;,         &quot;&quot;,         &quot;---------------------------&quot;,         &quot;&quot;,         &quot;STP Status        : Enabled&quot;,         &quot;&quot;,         &quot;STP Version       : RSTP&quot;,         &quot;&quot;,         &quot;Max Age           : 20     &quot;,         &quot;&quot;,         &quot;Hello Time        : 2      &quot;,         &quot;&quot;,         &quot;Forward Delay     : 15     &quot;,         &quot;&quot;,         &quot;Max Hops          : 20     &quot;,         &quot;&quot;,         &quot;TX Hold Count     : 3      &quot;,         &quot;&quot;,         &quot;Forwarding BPDU   : Enabled&quot;,<\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u0438 \u043d\u0435 \u043f\u0440\u0430\u0432\u0438\u0442\u044c playbook \u0432\u043e\u043e\u0431\u0449\u0435. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u0438 \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0438\u0434\u0435 \u0442\u043e\u0436\u0435 \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 Ansible \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 Vaults. <\/p>\n<h3>C\u0441\u044b\u043b\u043a\u0438:<\/h3>\n<p>  \u2192 <a href=\"http:\/\/docs.ansible.com\/\">\u041e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f<\/a><br \/>  \u2192 <a href=\"https:\/\/habrahabr.ru\/post\/195048\/\">\u041e\u0441\u043d\u043e\u0432\u044b Ansible<\/a><br \/>  \u2192 <a href=\"https:\/\/habrahabr.ru\/post\/323014\/\">Ansible+\u0441\u0435\u0442\u0438<\/a><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:\/\/habrahabr.ru\/post\/328486\/\"> https:\/\/habrahabr.ru\/post\/328486\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/web\/5c7\/48c\/b7f\/5c748cb7f46f4efb8962f1bd99cc2c47.png\" \/><\/div>\n<p>  <\/p>\n<blockquote><p>Telnet is a obviously a very insecure protocol, completely insecure in fact, and we strongly want to discourage usage. We would likely refuse the pull request, to be honest \u2014 it is just asking for a world of hurt should MITM possibilities arise.<\/p><\/blockquote>\n<p><i> \u2014 Michael DeHaan, \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u044c Ansible<\/i><\/p>\n<p>  \u0410\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0441\u043e\u0433\u043b\u0430\u0441\u0435\u043d. \u042d\u043c, \u0430 \u043a\u0430\u043a \u043c\u043d\u0435 \u0431\u044b\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u0443 \u043c\u0435\u043d\u044f 20 \u0442\u044b\u0441\u044f\u0447 legacy \u0441\u0432\u0438\u0442\u0447\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044e\u0442\u0441\u044f\/\u0437\u0430\u0432\u0438\u0441\u0430\u044e\u0442 \u0438\u0437-\u0437\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u043e SSH, \u0430 \u0447\u0430\u0441\u0442\u044c \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0435\u0433\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442?<br \/>  \u041f\u0440\u043e\u0448\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-286223","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/286223","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=286223"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/286223\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=286223"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=286223"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=286223"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}