{"id":6720,"date":"2022-12-14T06:31:11","date_gmt":"2022-12-13T21:31:11","guid":{"rendered":"https:\/\/lab4ict.com\/system\/?p=6720"},"modified":"2022-12-17T11:37:06","modified_gmt":"2022-12-17T02:37:06","slug":"ansible%e3%81%aeinventory%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%81%a7%e7%ae%a1%e7%90%86%e5%af%be%e8%b1%a1%e3%81%ae%e3%82%b5%e3%83%bc%e3%83%90%e3%82%92%e5%ae%9a%e7%be%a9%e3%81%99%e3%82%8b%ef%bc%81","status":"publish","type":"post","link":"https:\/\/lab4ict.com\/system\/archives\/6720","title":{"rendered":"Ansible\u306eInventory\u30d5\u30a1\u30a4\u30eb\u3067\u7ba1\u7406\u5bfe\u8c61\u306e\u30b5\u30fc\u30d0\u3092\u5b9a\u7fa9\u3059\u308b\uff01"},"content":{"rendered":"<p>Ansible\u3092\u4f7f\u3044\u3053\u306a\u3059\u306b\u3042\u305f\u308a\u3001\u307e\u305a\u6574\u5099\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u306e\u304c\u3001\u7ba1\u7406\u5bfe\u8c61\u3092\u5b9a\u7fa9\u3059\u308bInventory\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002<\/p>\n<h2>Inventory\u30d5\u30a1\u30a4\u30eb\u306e\u57fa\u672c\u7684\u306a\u66f8\u5f0f\u3092\u78ba\u8a8d\u3059\u308b\uff01<\/h2>\n<p>Inventory\u30d5\u30a1\u30a4\u30eb\u306b\u7ba1\u7406\u5bfe\u8c61\u306e\u30b5\u30fc\u30d0\u3092\u4e00\u89a7\u5f62\u5f0f\u3067\u767b\u9332\u3057\u307e\u3059\u3002\u30b5\u30fc\u30d0\u306f\u3001\u30b0\u30eb\u30fc\u30d7\u5316\u304c\u53ef\u80fd\u3067\u3001\u63a5\u7d9a\u306e\u305f\u3081\u306e\u60c5\u5831\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ cat inventory.ini\r\n&#x5B;servers_debian]\r\nserver01  ansible_ssh_user=usradmin\r\nserver02  ansible_ssh_user=usradmin\r\n\r\n&#x5B;servers_rhel]\r\nserver11  ansible_ssh_user=usradmin\r\nserver12  ansible_ssh_user=usradmin\r\n<\/pre>\n<h2>\u30b5\u30fc\u30d0\u306e\u5b9a\u7fa9\u306e\u30b0\u30eb\u30fc\u30d7\u5316\u3092\u884c\u3046\uff01<\/h2>\n<p>\u30b5\u30fc\u30d0\u306e\u5b9a\u7fa9\u306f\u300c:children\u300d\u306e\u5b9a\u7fa9\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u30b0\u30eb\u30fc\u30d7\u306e\u30b0\u30eb\u30fc\u30d7\u5316\u3092\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ cat inventory.ini\r\n&#x5B;servers_debian]\r\nserver01  ansible_ssh_user=usradmin\r\nserver02  ansible_ssh_user=usradmin\r\n\r\n&#x5B;servers_rhel]\r\nserver11  ansible_ssh_user=usradmin\r\nserver12  ansible_ssh_user=usradmin\r\n\r\n&#x5B;servers_linux:children]\r\nservers_debian\r\nservers_rhel\r\n<\/pre>\n<h2>\u30b0\u30eb\u30fc\u30d7\u5316\u3057\u305f\u540d\u524d\u3067ansible\u3092\u5b9f\u884c\u3057\u3066\u307f\u308b\uff01<\/h2>\n<p>\u4ee5\u4e0b\u306ePlaybook\u3092\u4f7f\u7528\u3057\u3066\u3001\u758e\u901a\u78ba\u8a8d\u3092\u884c\u3063\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ cat ping_all.yml\r\n---\r\n- hosts: all\r\n  tasks: \r\n  - name: ping all\r\n    ping:\r\n<\/pre>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u3001Inventory\u30d5\u30a1\u30a4\u30eb\u306b\u5b9a\u7fa9\u3057\u305f\u5168\u30b5\u30fc\u30d0\u306b\u5bfe\u3057\u3066\u3001ansible\u3067\u306e\u758e\u901a\u78ba\u8a8d\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ ansible-playbook -i inventory.ini ping_all.yml\r\n<\/pre>\n<h2>\u304a\u308f\u308a\u306b<\/h2>\n<p>Inventory\u30d5\u30a1\u30a4\u30eb\u306f\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067\u6307\u5b9a\u3067\u304d\u308b\u306e\u3067\u3001\u7528\u9014\u306b\u5fdc\u3058\u3066\u4f7f\u3044\u5206\u3051\u304c\u53ef\u80fd\u3067\u3001Inventory\u30d5\u30a1\u30a4\u30eb\u5185\u3067\u30b0\u30eb\u30fc\u30d7\u5316\u304c\u3067\u304d\u307e\u3059\u3002Inventory\u30d5\u30a1\u30a4\u30eb\u306f\u3001Playbook\u3067\u306e\u4f7f\u7528\u65b9\u6cd5\u3092\u8003\u3048\u306a\u304c\u3089\u3001\u4f53\u7cfb\u7acb\u3066\u3066\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<h2>\u53c2\u8003\u60c5\u5831<\/h2>\n<ul>\n<li><a href=\"https:\/\/docs.ansible.com\/ansible\/latest\/index.html\" target=\"_blank\" rel=\"noopener\">Ansible Documentation<\/a><\/li>\n<\/ul>\n<h2>\u95a2\u9023\u8a18\u4e8b<\/h2>\n<div class=\"sc_getpost\"><a class=\"clearfix\" href=\"https:\/\/lab4ict.com\/system\/archives\/6710\" ><div class=\"sc_getpost_thumb post-box-thumbnail__wrap\"><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODdhAQABAPAAAN3d3QAAACwAAAAAAQABAAACAkQBADs=\" width=\"150\" height=\"150\" alt=\"\u3010\u8a18\u4e8b\u4e00\u89a7\u3011Ansible\u3067\u69cb\u6210\u7ba1\u7406\u3092\u884c\u3046\uff01\" loading=\"lazy\" data-src=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2022\/12\/eyecatch_ansible_01-150x150.png\" class=\"lazyload\"><\/div><div class=\"title\">\u3010\u8a18\u4e8b\u4e00\u89a7\u3011Ansible\u3067\u69cb\u6210\u7ba1\u7406\u3092\u884c\u3046\uff01<\/div><div class=\"substr\">Ansible\u3067\u30b7\u30b9\u30c6\u30e0\u306e\u69cb\u6210\u7ba1\u7406\u3092\u884c\u3046\u305f\u3081\u306e\u8a18\u4e8b\u4e00\u89a7\u3092\u63b2\u8f09\u3057\u307e\u3059\u3002...<\/div><\/a><\/div>\n<h2>Ansible\u66f8\u7c4d\uff08Amazon\uff09<\/h2>\n<h3>Ansible\u5b9f\u8df5\u30ac\u30a4\u30c9 \u7b2c3\u7248 impress top gear\u30b7\u30ea\u30fc\u30ba<\/h3>\n<p><iframe style=\"width: 120px; height: 240px;\" sandbox=\"allow-popups allow-scripts allow-modals allow-forms allow-same-origin\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" frameborder=\"0\" src=\"\/\/rcm-fe.amazon-adsystem.com\/e\/cm?lt1=_blank&amp;bc1=000000&amp;IS2=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=infotecr-22&amp;language=ja_JP&amp;o=9&amp;p=8&amp;l=as4&amp;m=amazon&amp;f=ifr&amp;ref=as_ss_li_til&amp;asins=B07YXYM94G&amp;linkId=c592827d0a9befa45003dc1710db5e20\"><\/iframe><\/p>\n<h3>Ansible\u30af\u30c3\u30af\u30d6\u30c3\u30af impress top gear\u30b7\u30ea\u30fc\u30ba<\/h3>\n<p><iframe style=\"width: 120px; height: 240px;\" sandbox=\"allow-popups allow-scripts allow-modals allow-forms allow-same-origin\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" frameborder=\"0\" src=\"\/\/rcm-fe.amazon-adsystem.com\/e\/cm?lt1=_blank&amp;bc1=000000&amp;IS2=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=infotecr-22&amp;language=ja_JP&amp;o=9&amp;p=8&amp;l=as4&amp;m=amazon&amp;f=ifr&amp;ref=as_ss_li_til&amp;asins=B09V4HW2LW&amp;linkId=57f8d97a138faaedd2db76907303fa17\"><\/iframe><\/p>\n<hr \/>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ansible\u3092\u4f7f\u3044\u3053\u306a\u3059\u306b\u3042\u305f\u308a\u3001\u307e\u305a\u6574\u5099\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u306e\u304c\u3001\u7ba1\u7406\u5bfe\u8c61\u3092\u5b9a\u7fa9\u3059\u308bInventory\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002 Inventory\u30d5\u30a1\u30a4\u30eb\u306e\u57fa\u672c\u7684\u306a\u66f8\u5f0f\u3092\u78ba\u8a8d\u3059\u308b\uff01 Inventory\u30d5\u30a1\u30a4\u30eb\u306b\u7ba1\u7406\u5bfe\u8c61\u306e\u30b5\u30fc\u30d0\u3092\u4e00\u89a7\u5f62\u5f0f\u3067\u767b\u9332\u3057\u307e\u3059\u3002\u30b5\u2026<\/p>\n","protected":false},"author":1,"featured_media":6881,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[157],"tags":[],"class_list":["post-6720","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ansible"],"_links":{"self":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/6720","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/comments?post=6720"}],"version-history":[{"count":0,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/6720\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media\/6881"}],"wp:attachment":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media?parent=6720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/categories?post=6720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/tags?post=6720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}