{"id":2796,"date":"2015-05-18T10:40:36","date_gmt":"2015-05-18T01:40:36","guid":{"rendered":"http:\/\/www.itbook.info\/web\/?p=2796"},"modified":"2015-05-18T10:42:42","modified_gmt":"2015-05-18T01:42:42","slug":"ansible%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%83%8d%e3%83%83%e3%83%88%e3%83%af%e3%83%bc%e3%82%af%e6%a9%9f%e5%99%a8%e3%82%92%e5%88%b6%e5%be%a1%e3%81%97%e3%81%a6%e3%81%bf%e3%82%8b","status":"publish","type":"post","link":"https:\/\/www.itbook.info\/web\/2015\/05\/ansible%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%83%8d%e3%83%83%e3%83%88%e3%83%af%e3%83%bc%e3%82%af%e6%a9%9f%e5%99%a8%e3%82%92%e5%88%b6%e5%be%a1%e3%81%97%e3%81%a6%e3%81%bf%e3%82%8b.html","title":{"rendered":"Ansible\u3092\u4f7f\u3063\u3066\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u6a5f\u5668\u3092\u5236\u5fa1\u3057\u3066\u307f\u308b"},"content":{"rendered":"<aside class=\"row veu_insertAds before\"><div class=\"col-md-12\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n                        <!-- cat_\u4e0a\u90e8 -->\r\n                        <ins class=\"adsbygoogle\" style=\"display:block\" data-ad-client=\"ca-pub-6102004203189610\" data-ad-slot=\"9628163001\" data-ad-format=\"auto\"><\/ins>\r\n                        <script>\r\n                        (adsbygoogle = window.adsbygoogle || []).push({});\r\n                        <\/script><\/div><\/aside><p>\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u904b\u7528\u7ba1\u7406\u306f\u81ea\u52d5\u5316\u304c\u9032\u307e\u306a\u3044\u3068\u3044\u3046\u8a71\u304c\u8a71\u984c\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u306d\u3002<\/p>\n<p><a href=\"http:\/\/www.slideshare.net\/taijitsuchiya5\/ss-47398248\">\u306a\u305b\u3099\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u904b\u7528\u81ea\u52d5\u5316\u304b\u3099\u9032\u307e\u306a\u3044\u306e\u304b Why is it difficult to automate network opera\u2026<\/a><\/p>\n<p>\u69cb\u6210\u7ba1\u7406\u30c4\u30fc\u30eb\u306f\u304b\u306a\u308a\u6574\u5099\u3055\u308c\u3066\u304d\u3066\u3044\u3066\u3001\u4ee3\u8868\u7684\u306a\u3068\u3053\u308d\u3060\u3068Chef\u3084Puppet\u3001\u305d\u3057\u3066Ansible\u3042\u305f\u308a\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u4eca\u56de\u306fAnsible\u3092\u4f7f\u3063\u3066\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u6a5f\u5668\u306e\u69cb\u6210\u7ba1\u7406\u3092\u8a66\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<h2 id=\"ansible\u3068\u306f\">Ansible\u3068\u306f<\/h2>\n<p>Ansible\u3068\u306f\u3001\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3084\u8a2d\u5b9a\u3001\u30b5\u30fc\u30d3\u30b9\u306e\u8d77\u52d5\/\u505c\u6b62\u3068\u3044\u3063\u305f\u64cd\u4f5c\u3092\u4e8b\u524d\u306b\u30b9\u30af\u30ea\u30d7\u30c8\u5316\u3057\u3066\u3001\u305d\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u8907\u6570\u306e\u30de\u30b7\u30f3\u306b\u4e00\u62ec\u3067\u6295\u5165\u51fa\u6765\u308b\u30c4\u30fc\u30eb\u3067\u3059\u3002<\/p>\n<p>Ansible\u306b\u95a2\u3059\u308b\u89e3\u8aac\u306f\u3053\u3061\u3089\u306e\u30b5\u30a4\u30c8\u304c\u5206\u304b\u308a\u3084\u3059\u3044\u3067\u3059\u3002<\/p>\n<p><a href=\"http:\/\/knowledge.sakura.ad.jp\/tech\/3124\/\">\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u30ec\u30b9\u3067\u30b7\u30f3\u30d7\u30eb\u306a\u69cb\u6210\u7ba1\u7406\u30c4\u30fc\u30eb\u300cAnsible\u300d\u5165\u9580 &#8211; \u3055\u304f\u3089\u306e\u30ca\u30ec\u30c3\u30b8<\/a><\/p>\n<h2 id=\"\u691c\u8a3c\u74b0\u5883\u6e96\u5099\">\u691c\u8a3c\u74b0\u5883\u6e96\u5099<\/h2>\n<p>\u5b9f\u74b0\u5883\u3092\u6e96\u5099\u3059\u308b\u306e\u304c\u9762\u5012\u304f\u3055\u304b\u3063\u305f\u306e\u3067\u3001\u4eca\u56de\u306fCisco onePK\u3092\u8a66\u3057\u305f\u3068\u304d\u306b\u4f7f\u3063\u305fAll-in-one VM\u306e\u74b0\u5883\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>All-in-one VM\u306b\u3064\u3044\u3066\u306f\u3001\u4ee5\u4e0b\u306e\u30ea\u30f3\u30af\u3067\u8aac\u660e\u3057\u3066\u3044\u307e\u3059\u306e\u3067\u4eca\u56de\u306f\u5272\u611b\u3002<\/p>\n<ul>\n<li><a href=\"http:\/\/www.itbook.info\/web\/2014\/04\/cisco-onepk%e3%82%92%e8%a9%a6%e3%81%99%ef%bc%88%e6%ba%96%e5%82%99%ef%bc%89.html\">cisco onePK\u3092\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002 | \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a8\u30f3\u30b8\u30cb\u30a2\u3092\u76ee\u6307\u3057\u3066 &#8211; \u30d6\u30ed\u30b0<\/a><\/li>\n<li><a href=\"http:\/\/www.itbook.info\/web\/2014\/04\/cisco-onepk%e3%81%a7%e9%81%8a%e3%81%b6%ef%bc%88%e5%ae%9f%e8%a1%8c%e7%b7%a8%ef%bc%89.html\">Cisco onePK\u3092\u4f7f\u3063\u3066\u904a\u3093\u3067\u307f\u307e\u3057\u305f\u3002 | \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a8\u30f3\u30b8\u30cb\u30a2\u3092\u76ee\u6307\u3057\u3066 &#8211; \u30d6\u30ed\u30b0<\/a><\/li>\n<li><a href=\"http:\/\/www.itbook.info\/web\/2014\/04\/cisco-onepk%e3%81%a7%e9%81%8a%e3%81%b6%ef%bc%88%e5%ae%9f%e8%a1%8c%e7%b7%a82%ef%bc%89.html\">Cisco onePK\u3067\u904a\u3076\uff08\u5b9f\u884c\u7de82\uff09 | \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a8\u30f3\u30b8\u30cb\u30a2\u3092\u76ee\u6307\u3057\u3066 &#8211; \u30d6\u30ed\u30b0<\/a><\/li>\n<\/ul>\n<p>\u4eca\u56de\u306f\u3001SSH\u63a5\u7d9a\u3092\u4f7f\u3063\u3066Ansible\u3067\u5236\u5fa1\u3059\u308b\u5834\u5408\u3068\u3001SNMP\u3092\u4f7f\u3063\u3066Ansible\u3067\u5236\u5fa1\u3059\u308b\u5834\u5408\u306e2\u30d1\u30bf\u30fc\u30f3\u3092\u8a66\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<h3 id=\"ansible\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\">Ansible\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>\u307e\u305a\u306f\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067Ansible\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre><code>sudo apt-get install python-pip  \nsudo apt-get install sshpass  \nsudo pip install ansible\n<\/code><\/pre>\n<h2 id=\"ssh\u63a5\u7d9a\u3092\u4f7f\u3063\u3066ansible\u3067\u5236\u5fa1\">SSH\u63a5\u7d9a\u3092\u4f7f\u3063\u3066Ansible\u3067\u5236\u5fa1<\/h2>\n<h3 id=\"cisco\u30eb\u30fc\u30bf\u306bssh\u63a5\u7d9a\u7528\u306e\u8a2d\u5b9a\u8ffd\u52a0\">Cisco\u30eb\u30fc\u30bf\u306bSSH\u63a5\u7d9a\u7528\u306e\u8a2d\u5b9a\u8ffd\u52a0<\/h3>\n<p>Ansible\u304b\u3089SSH\u63a5\u7d9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u305f\u3081\u3001Cisco\u30eb\u30fc\u30bf\u306bSSH\u306e\u30ed\u30fc\u30ab\u30eb\u8a8d\u8a3c\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre><code>Router1#conf t  \nRouter1(config)#line vty 0 4  \nRouter1(config-line)#login local  \nRouter1(config-line)#end  \nRouter1#\n<\/code><\/pre>\n<h3 id=\"ansible\u7528\u306ehosts\u30d5\u30a1\u30a4\u30eb\u4f5c\u6210\">Ansible\u7528\u306ehosts\u30d5\u30a1\u30a4\u30eb\u4f5c\u6210<\/h3>\n<p>Ansible\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3059\u308bhosts\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u4eca\u56de\u306f3\u53f0\u306eCisco\u30eb\u30fc\u30bf\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u306e\u3067\u30013\u53f0\u5206\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n<pre><code>cisco@onepk:~\/ansible$ vi hosts  \n[cisco]  \n10.10.10.110  \n10.10.10.120  \n10.10.10.130\n<\/code><\/pre>\n<h3 id=\"ansible\u306eplaybook\u30d5\u30a1\u30a4\u30eb\u306e\u8a2d\u5b9a\">Ansible\u306eplaybook\u30d5\u30a1\u30a4\u30eb\u306e\u8a2d\u5b9a<\/h3>\n<p>\u4eca\u56de\u306f\u5404\u30eb\u30fc\u30bf\u306eshow run\u3092\u53d6\u5f97\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u3044\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre><code>cisco@onepk:~\/ansible$ vi show-run.yml  \n---  \n- hosts: cisco  \n  gather_facts: no  \n  sudo: false\n\n  tasks:  \n  - name: sh run  \n    raw : &quot;show run&quot;  \n    register: show_run  \n  - name: sh run output  \n    local_action: shell \/bin\/echo &quot;{{ show_run.stdout }}&quot; &gt; \/home\/cisco\/ansible\/sh_run_{{ inventory_hostname }}.txt\n<\/code><\/pre>\n<p>\u6ce8\u610f\u70b9\u3068\u3057\u3066\u3001gather_facts \u306f no \u306b\u3059\u308b\u3053\u3068\u3068\u3001\u5b9f\u884c\u3059\u308b\u30b3\u30de\u30f3\u30c9\u306f raw \u3092\u4f7f\u3063\u3066\u8a18\u8ff0\u3057\u307e\u3059\u3002 <\/p>\n<h3 id=\"ansible\u306e\u5b9f\u884c\">Ansible\u306e\u5b9f\u884c<\/h3>\n<pre><code>cisco@onepk:~\/ansible$ ansible-playbook -i hosts show-run.yml -k  \nSSH password: cisco\n\nPLAY [cisco] ****************************************************************** \n\nTASK: [sh run] ****************************************************************  \nok: [10.10.10.110]  \nok: [10.10.10.130]  \nok: [10.10.10.120]\n\nTASK: [sh run output] *********************************************************  \nchanged: [10.10.10.130 -&gt; 127.0.0.1]  \nchanged: [10.10.10.110 -&gt; 127.0.0.1]  \nchanged: [10.10.10.120 -&gt; 127.0.0.1]\n\nPLAY RECAP ********************************************************************  \n10.10.10.110               : ok=2    changed=1    unreachable=0    failed=0  \n10.10.10.120               : ok=2    changed=1    unreachable=0    failed=0  \n10.10.10.130               : ok=2    changed=1    unreachable=0    failed=0   \n<\/code><\/pre>\n<p>\u7121\u4e8b\u306b\u30d5\u30a1\u30a4\u30eb\u306b\u4fdd\u5b58\u3055\u308c\u3066\u3044\u308b\u306e\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre><code>cisco@onepk:~\/ansible$ ll  \ndrwxrwxr-x  6 cisco cisco 4096 May 16 07:35 .\/  \ndrwxr-xr-x 40 cisco cisco 4096 May 16 06:44 ..\/  \n-rw-rw-r--  1 cisco cisco   47 May 16 07:34 hosts  \n-rw-rw-r--  1 cisco cisco  263 May 16 07:33 show-run.yml  \n-rw-rw-r--  1 cisco cisco 9978 May 16 07:34 sh_run_10.10.10.110.txt  \n-rw-rw-r--  1 cisco cisco 9935 May 16 07:34 sh_run_10.10.10.120.txt  \n-rw-rw-r--  1 cisco cisco 9935 May 16 07:34 sh_run_10.10.10.130.txt\n<\/code><\/pre>\n<h2 id=\"snmp\u3092\u4f7f\u3063\u3066ansible\u3067\u5236\u5fa1\">SNMP\u3092\u4f7f\u3063\u3066Ansible\u3067\u5236\u5fa1<\/h2>\n<p>\u7d9a\u3044\u3066\u3001SNMP\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u4f7f\u3063\u3066Cisco\u30eb\u30fc\u30bf\u306e\u8a2d\u5b9a\u3092\u5909\u66f4\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/github.com\/networklore\/ansible-cisco-snmp\">ansible-cisco-snmp<\/a>\u3068\u3044\u3046\u30e2\u30b8\u30e5\u30fc\u30eb\u304cGitHub\u306b\u4e0a\u304c\u3063\u3066\u3044\u307e\u3057\u305f\u306e\u3067\u3001\u305d\u308c\u3092\u4f7f\u3063\u3066\u307f\u307e\u3059\u3002<\/p>\n<h3 id=\"\u5fc5\u8981\u306a\u30e2\u30b8\u30e5\u30fc\u30eb\u985e\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\">\u5fc5\u8981\u306a\u30e2\u30b8\u30e5\u30fc\u30eb\u985e\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<pre><code>sudo pip install nelsnmp  \nsudo apt-get install git  \ngit clone https:\/\/github.com\/networklore\/ansible-cisco-snmp.git  \ncd ansible-cisco-snmp\n<\/code><\/pre>\n<h3 id=\"ansible\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306b\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u8a2d\u5b9a\">Ansible\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306b\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u8a2d\u5b9a<\/h3>\n<pre><code>sudo mkdir -p \/etc\/ansible  \nsudo vi \/etc\/ansible\/ansible.cfg  \n[defaults]\n\nlibrary = \/home\/patrick\/ansible-cisco-snmp\/library\n<\/code><\/pre>\n<h3 id=\"cisco\u30eb\u30fc\u30bf\u306bsnmp\u306e\u8a2d\u5b9a\u3092\u884c\u3046\">Cisco\u30eb\u30fc\u30bf\u306bSNMP\u306e\u8a2d\u5b9a\u3092\u884c\u3046<\/h3>\n<p>GitHub\u306b\u8a18\u8f09\u3055\u308c\u3066\u3044\u308b\u3068\u304a\u308a\u3001SNMP\u3092\u8a2d\u5b9a\u3059\u308b\u3002\u4eca\u56de\u306f\u30ed\u30fc\u30ab\u30eb\u3067\u306e\u691c\u8a3c\u306a\u306e\u3067\u3001ACL\u306f\u7701\u7565\u3002<\/p>\n<pre><code>snmp-server community private rw  \nsnmp-server view V3ISO iso included  \nsnmp-server group ANSIBLEGRP v3 priv write V3ISO  \nsnmp-server user ansible ANSIBLEGRP v3 auth sha AuthPassword123 priv aes 128 PrivPassword123 access\n<\/code><\/pre>\n<p>GitHub\u306b\u306f\u30b5\u30f3\u30d7\u30eb\u306eplaybook\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308b\u306e\u3067\u8a66\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<h3 id=\"\u8a2d\u5b9a\u306e\u4fdd\u5b58\">\u8a2d\u5b9a\u306e\u4fdd\u5b58<\/h3>\n<p>\u300cexamples-save_config.yml\u300d\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u306f\u3001\u5404\u6a5f\u5668\u306e\u8a2d\u5b9a\u3092\u4fdd\u5b58\u3059\u308bplaybook\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u306e\u3067\u5b9f\u884c\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<h4 id=\"\u5b9f\u884c\u7d50\u679c\">\u5b9f\u884c\u7d50\u679c<\/h4>\n<pre><code>cisco@onepk:~\/ansible$ ansible-playbook -i hosts ansible-cisco-snmp\/example-playbooks\/how-to\/examples-save_config.yml -k  \nSSH password: \n\nPLAY [all] ******************************************************************** \n\nTASK: [Save the running configuration to startup] *****************************  \nchanged: [10.10.10.110]  \nchanged: [10.10.10.130]  \nchanged: [10.10.10.120]\n\nPLAY RECAP ********************************************************************  \n10.10.10.110               : ok=1    changed=1    unreachable=0    failed=0  \n10.10.10.120               : ok=1    changed=1    unreachable=0    failed=0  \n10.10.10.130               : ok=1    changed=1    unreachable=0    failed=0   \n<\/code><\/pre>\n<h3 id=\"cdp\u306e\u8a2d\u5b9a\u5909\u66f4\">CDP\u306e\u8a2d\u5b9a\u5909\u66f4<\/h3>\n<p>\u300cexamples-cdp.yml\u300d\u306fCDP\u8a2d\u5b9a\u3092\u30b0\u30ed\u30fc\u30d0\u30eb\u3067\u6709\u52b9\u306b\u3057\u3066\u3001\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u3067\u7121\u52b9\u306b\u3059\u308b\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002<br \/>\n\u307e\u305a\u3001\u30b5\u30f3\u30d7\u30eb\u30d5\u30a1\u30a4\u30eb\u306e\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u304c\u300cFast Ethernet\u300d\u3060\u3063\u305f\u306e\u3067\u300cGigabit Ethernet\u300d\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre><code>cisco@onepk:~\/ansible$ vi ansible-cisco-snmp\/example-playbooks\/how-to\/examples-cdp.yml \n\n---  \n-  hosts: all  \n   connection: local  \n   gather_facts: no\n\n   tasks:  \n     - name: Globally enable CDP  \n       cisco_snmp_cdp:  \n         host={{ inventory_hostname }}  \n         version=2c  \n         community=private  \n         cdp_global=enabled\n\n     - name: Disable CDP on gigabitethernet 0\/0  \n       cisco_snmp_cdp:  \n         host={{ inventory_hostname }}  \n         version=2c  \n         community=private  \n         cdp_interface=disabled  \n         interface_name=&quot;GigabitEthernet0\/0&quot;\n<\/code><\/pre>\n<h4 id=\"\u5b9f\u884c\u7d50\u679c\">\u5b9f\u884c\u7d50\u679c<\/h4>\n<pre><code>cisco@onepk:~\/ansible$ ansible-playbook -i hosts ansible-cisco-snmp\/example-playbooks\/how-to\/examples-cdp.yml -k  \nSSH password: \n\nPLAY [all] ******************************************************************** \n\nTASK: [Globally enable CDP] ***************************************************  \nok: [10.10.10.120]  \nok: [10.10.10.110]  \nok: [10.10.10.130]\n\nTASK: [Disable CDP on gigabitethernet 0\/0] ************************************  \nok: [10.10.10.110]  \nok: [10.10.10.130]  \nok: [10.10.10.120]\n\nPLAY RECAP ********************************************************************  \n10.10.10.110               : ok=2    changed=0    unreachable=0    failed=0  \n10.10.10.120               : ok=2    changed=0    unreachable=0    failed=0  \n10.10.10.130               : ok=2    changed=0    unreachable=0    failed=0 \n<\/code><\/pre>\n<p>\u8a2d\u5b9a\u3092\u78ba\u8a8d\u3057\u3066\u307f\u308b\u3068\u3001interface GigabitEthernet0\/0\u3060\u3051\u3001\u300cno cdp enable\u300d\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre><code>Router1#sh running-config  \n\u301c\u7701\u7565\u301c  \ninterface GigabitEthernet0\/0  \n ip address 10.10.20.110 255.255.255.0  \n duplex auto  \n speed auto  \n media-type rj45  \n no cdp enable  \n!\ninterface GigabitEthernet0\/1  \n ip address 10.10.30.110 255.255.255.0  \n duplex auto  \n speed auto  \n media-type rj45  \n!\n<\/code><\/pre>\n<p>\u3061\u306a\u307f\u306b\u3001Router2\u3068Router3\u306eSNMP\u8a2d\u5b9a\u3092\u5916\u3057\u3066Ansible\u3092\u5b9f\u884c\u3057\u3066\u307f\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre><code>cisco@onepk:~\/ansible$ ansible-playbook -i hosts ansible-cisco-snmp\/example-playbooks\/how-to\/examples-cdp.yml -k  \nSSH password: \n\nPLAY [all] ******************************************************************** \n\nTASK: [Globally enable CDP] ***************************************************  \nok: [10.10.10.110]  \nfailed: [10.10.10.120] =&gt; {&quot;failed&quot;: true}  \nmsg: 'No SNMP response received before timeout'  \nfailed: [10.10.10.130] =&gt; {&quot;failed&quot;: true}  \nmsg: 'No SNMP response received before timeout'\n\nTASK: [Disable CDP on gigabitethernet 0\/0] ************************************  \nok: [10.10.10.110]\n\nPLAY RECAP ********************************************************************  \n           to retry, use: --limit @\/home\/cisco\/examples-cdp.retry\n\n10.10.10.110               : ok=2    changed=0    unreachable=0    failed=0  \n10.10.10.120               : ok=0    changed=0    unreachable=0    failed=1  \n10.10.10.130               : ok=0    changed=0    unreachable=0    failed=1   \n<\/code><\/pre>\n<h2 id=\"\u307e\u3068\u3081\">\u307e\u3068\u3081<\/h2>\n<p>\u4ee5\u4e0a\u3001Ansible\u3092\u4f7f\u3063\u3066Cisco\u30eb\u30fc\u30bf\u306e\u5236\u5fa1\u3092\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n\u8a2d\u5b9a\u5909\u66f4\u3068\u306a\u308b\u3068\u3001\u5c11\u3057\u30ea\u30b9\u30af\u306f\u3042\u308a\u307e\u3059\u304c\u3001\u69cb\u6210\u60c5\u5831\u306e\u53d6\u5f97\u3067\u3042\u308c\u3070\u8907\u6570\u53f0\u306e\u30eb\u30fc\u30bf\u304b\u3089\u4e00\u62ec\u3067\u53d6\u5f97\u3067\u304d\u308b\u306e\u3067\u3001\u304b\u306a\u308a\u4f7f\u3044\u3084\u3059\u3044\u3093\u3058\u3083\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3082\u7c21\u5358\u3067\u3059\u3057\u3001playbook\u306e\u8a18\u8ff0\u3082\u5272\u3068\u5206\u304b\u308a\u3084\u3059\u3044\u3067\u3059\u3002\u8208\u5473\u306e\u3042\u308b\u65b9\u306f\u305c\u3072\u8a66\u3057\u3066\u307f\u3066\u4e0b\u3055\u3044\u3002<\/p>\n<aside class=\"row veu_insertAds after\"><div class=\"col-md-12\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n                        <!-- cat_\u4e0a\u90e8 -->\r\n                        <ins class=\"adsbygoogle\" style=\"display:block\" data-ad-client=\"ca-pub-6102004203189610\" data-ad-slot=\"9628163001\" data-ad-format=\"auto\"><\/ins>\r\n                        <script>\r\n                        (adsbygoogle = window.adsbygoogle || []).push({});\r\n                        <\/script><\/div><\/aside>","protected":false},"excerpt":{"rendered":"<p>\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u904b\u7528\u7ba1\u7406\u306f\u81ea\u52d5\u5316\u304c\u9032\u307e\u306a\u3044\u3068\u3044\u3046\u8a71\u304c\u8a71\u984c\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u306d\u3002 \u306a\u305b\u3099\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u904b\u7528\u81ea\u52d5\u5316\u304b\u3099\u9032\u307e\u306a\u3044\u306e\u304b Why is it difficult to automate network opera\u2026 \u69cb\u6210\u7ba1 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38],"tags":[275],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v15.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Ansible\u3092\u4f7f\u3063\u3066\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u6a5f\u5668\u3092\u5236\u5fa1\u3057\u3066\u307f\u308b - \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a8\u30f3\u30b8\u30cb\u30a2\u304c\u65e5\u3005\u306e\u51fa\u6765\u4e8b\u3092\u8a9e\u308b<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.itbook.info\/web\/2015\/05\/ansible\u3092\u4f7f\u3063\u3066\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u6a5f\u5668\u3092\u5236\u5fa1\u3057\u3066\u307f\u308b.html\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ansible\u3092\u4f7f\u3063\u3066\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u6a5f\u5668\u3092\u5236\u5fa1\u3057\u3066\u307f\u308b - \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a8\u30f3\u30b8\u30cb\u30a2\u304c\u65e5\u3005\u306e\u51fa\u6765\u4e8b\u3092\u8a9e\u308b\" \/>\n<meta property=\"og:description\" content=\"\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u904b\u7528\u7ba1\u7406\u306f\u81ea\u52d5\u5316\u304c\u9032\u307e\u306a\u3044\u3068\u3044\u3046\u8a71\u304c\u8a71\u984c\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u306d\u3002 \u306a\u305b\u3099\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u904b\u7528\u81ea\u52d5\u5316\u304b\u3099\u9032\u307e\u306a\u3044\u306e\u304b Why is it difficult to automate network opera\u2026 \u69cb\u6210\u7ba1 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.itbook.info\/web\/2015\/05\/ansible\u3092\u4f7f\u3063\u3066\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u6a5f\u5668\u3092\u5236\u5fa1\u3057\u3066\u307f\u308b.html\" \/>\n<meta property=\"og:site_name\" content=\"\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a8\u30f3\u30b8\u30cb\u30a2\u304c\u65e5\u3005\u306e\u51fa\u6765\u4e8b\u3092\u8a9e\u308b\" \/>\n<meta property=\"article:published_time\" content=\"2015-05-18T01:40:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2015-05-18T01:42:42+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.itbook.info\/web\/#website\",\"url\":\"https:\/\/www.itbook.info\/web\/\",\"name\":\"\\u30cd\\u30c3\\u30c8\\u30ef\\u30fc\\u30af\\u30a8\\u30f3\\u30b8\\u30cb\\u30a2\\u304c\\u65e5\\u3005\\u306e\\u51fa\\u6765\\u4e8b\\u3092\\u8a9e\\u308b\",\"description\":\"\\u30cd\\u30c3\\u30c8\\u30ef\\u30fc\\u30af\\u30cd\\u30bf\\u3068\\u304b\\u3092\\u9069\\u5f53\\u306b\\u66f8\\u304d\\u6563\\u3089\\u304b\\u3059\\u30d6\\u30ed\\u30b0\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/www.itbook.info\/web\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"ja\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.itbook.info\/web\/2015\/05\/ansible%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%83%8d%e3%83%83%e3%83%88%e3%83%af%e3%83%bc%e3%82%af%e6%a9%9f%e5%99%a8%e3%82%92%e5%88%b6%e5%be%a1%e3%81%97%e3%81%a6%e3%81%bf%e3%82%8b.html#webpage\",\"url\":\"https:\/\/www.itbook.info\/web\/2015\/05\/ansible%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%83%8d%e3%83%83%e3%83%88%e3%83%af%e3%83%bc%e3%82%af%e6%a9%9f%e5%99%a8%e3%82%92%e5%88%b6%e5%be%a1%e3%81%97%e3%81%a6%e3%81%bf%e3%82%8b.html\",\"name\":\"Ansible\\u3092\\u4f7f\\u3063\\u3066\\u30cd\\u30c3\\u30c8\\u30ef\\u30fc\\u30af\\u6a5f\\u5668\\u3092\\u5236\\u5fa1\\u3057\\u3066\\u307f\\u308b - \\u30cd\\u30c3\\u30c8\\u30ef\\u30fc\\u30af\\u30a8\\u30f3\\u30b8\\u30cb\\u30a2\\u304c\\u65e5\\u3005\\u306e\\u51fa\\u6765\\u4e8b\\u3092\\u8a9e\\u308b\",\"isPartOf\":{\"@id\":\"https:\/\/www.itbook.info\/web\/#website\"},\"datePublished\":\"2015-05-18T01:40:36+00:00\",\"dateModified\":\"2015-05-18T01:42:42+00:00\",\"author\":{\"@id\":\"https:\/\/www.itbook.info\/web\/#\/schema\/person\/3707482c5270f902ec5d92dba1db0920\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.itbook.info\/web\/2015\/05\/ansible%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%83%8d%e3%83%83%e3%83%88%e3%83%af%e3%83%bc%e3%82%af%e6%a9%9f%e5%99%a8%e3%82%92%e5%88%b6%e5%be%a1%e3%81%97%e3%81%a6%e3%81%bf%e3%82%8b.html\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.itbook.info\/web\/#\/schema\/person\/3707482c5270f902ec5d92dba1db0920\",\"name\":\"na3620\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.itbook.info\/web\/#personlogo\",\"inLanguage\":\"ja\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1e7e7f8079aa707666c2a1069de805ef?s=96&d=mm&r=g\",\"caption\":\"na3620\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/www.itbook.info\/web\/wp-json\/wp\/v2\/posts\/2796"}],"collection":[{"href":"https:\/\/www.itbook.info\/web\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itbook.info\/web\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itbook.info\/web\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itbook.info\/web\/wp-json\/wp\/v2\/comments?post=2796"}],"version-history":[{"count":2,"href":"https:\/\/www.itbook.info\/web\/wp-json\/wp\/v2\/posts\/2796\/revisions"}],"predecessor-version":[{"id":2798,"href":"https:\/\/www.itbook.info\/web\/wp-json\/wp\/v2\/posts\/2796\/revisions\/2798"}],"wp:attachment":[{"href":"https:\/\/www.itbook.info\/web\/wp-json\/wp\/v2\/media?parent=2796"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itbook.info\/web\/wp-json\/wp\/v2\/categories?post=2796"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itbook.info\/web\/wp-json\/wp\/v2\/tags?post=2796"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}