{"id":42974,"date":"2023-09-04T03:30:05","date_gmt":"2023-01-10T00:23:53","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e8%87%aa%e5%8a%a8%e5%ae%89%e8%a3%85-ansible-%e4%ba%8e-windows%e3%80%82\/"},"modified":"2024-04-30T21:28:33","modified_gmt":"2024-04-30T13:28:33","slug":"%e8%87%aa%e5%8a%a8%e5%ae%89%e8%a3%85-ansible-%e4%ba%8e-windows%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e8%87%aa%e5%8a%a8%e5%ae%89%e8%a3%85-ansible-%e4%ba%8e-windows%e3%80%82\/","title":{"rendered":"\u81ea\u52a8\u5b89\u88c5 Ansible \u4e8e Windows"},"content":{"rendered":"<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d4fe137434c4406cc48bd\/0-0.jpeg\" alt=\"Ansible Log Example\" \/><\/div>\n<h2>\u6982\u8981 &#8211; \u7b80\u8981\u603b\u7ed3<\/h2>\n<p>Ansible \u662f\u4e00\u6b3e\u7528\u4e8e\u81ea\u52a8\u5316\u5728 Linux \u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u5404\u79cd\u8f6f\u4ef6\u548c\u6587\u4ef6\u7684\u8f6f\u4ef6\u3002<\/p>\n<p>\u7136\u800c\uff0c\u6ca1\u6709\u63d0\u4f9b\u9488\u5bf9 Windows \u7cfb\u7edf\u7684 Ansible \u5b89\u88c5\u7a0b\u5e8f\u3002\u6b64\u5916\uff0c\u5728\u7f51\u7edc\u4e0a\u51e0\u4e4e\u627e\u4e0d\u5230 Windows \u7528\u6237\u5c1d\u8bd5\u4f7f\u7528 Ansible \u7684\u65b9\u6cd5\u3002<\/p>\n<p>\u56e0\u6b64\uff0c\u6211\u60f3\u8981\u4eceWindows\u7684\u91cd\u7f6e\u72b6\u6001\u5f00\u59cb\uff0c\u9010\u6b65\u8be6\u7ec6\u4ecb\u7ecd\u5b89\u88c5\u5e26\u6709Ansible\u7684\u865a\u62df\u673a\uff08VM\uff09\u5230Windows\u7684\u6b65\u9aa4\u3002\u8bf7\u6ce8\u610f\uff0c\u5728\u6b64\u8fc7\u7a0b\u4e2d\u6709\u4e00\u4e2a\u4e0b\u8f7dVagrant\u9879\u76ee\u7684\u6b65\u9aa4\uff0c\u4ee5\u4fbf\u5c3d\u53ef\u80fd\u81ea\u52a8\u5316\u5b89\u88c5\u6b65\u9aa4\u3002<\/p>\n<p>\u5f53\u67d0\u4eba\u5b66\u4f1a\u81ea\u52a8\u5316\u4e4b\u540e\uff0c\u5373\u4f7f\u5bf9\u786c\u4ef6\u548c\u7f51\u7edc\u6ca1\u6709\u4e86\u89e3\u7684\u4eba\u4e5f\u80fd\u4f7f\u7528\u865a\u62df\u673a\u670d\u52a1\u6216\u589e\u52a0\u7269\u7406\u670d\u52a1\u5668\uff0c\u5e76\u80fd\u591f\u5b9e\u73b0\u5206\u5de5\u4e92\u52a9\u3002<\/p>\n<h2>\u76ee\u6807\u7cfb\u7edf<\/h2>\n<p>\u63d0\u524d\u51c6\u5907\u7684\u5fc5\u8981\u4e8b\u9879\u5982\u4e0b\uff1a<\/p>\n<ul class=\"post-ul\">Windows 10 21H1 64bit \uff08\u591a\u5c11\u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u3082\u3088\u3044\uff09<\/ul>\n<p>\u4ee5\u4e0b\u662f\u8f6f\u4ef6\u7684\u5b89\u88c5\u6b65\u9aa4\uff1a<br \/>\n\u6240\u6709\u7248\u672c\u90fd\u662f\u6b64\u65f6\u6b64\u523b\u7684\u6700\u65b0\u7248\u3002<br \/>\n\u5982\u679c\u672c\u6587\u8fc7\u65f6\u4e86\uff0c\u4ee5\u4e0b\u4ecb\u7ecd\u7684\u6b65\u9aa4\u53ef\u80fd\u4f1a\u5931\u8d25\uff0c\u8bf7\u8c05\u89e3\u3002<\/p>\n<p>\u30db\u30b9\u30c8OS\uff08Windows\uff09<\/p>\n<p>Visual Studio Code 1.59.1<br \/>\nVirtualBox 6.1.26<br \/>\nVagrant 2.2.18\uff08\u30b3\u30fc\u30c9\u3067 VirtualBox \u306e VM \u3092\u81ea\u52d5\u7684\u306b\u4f5c\u308b\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\uff09<br \/>\nAnsible Local \u30d7\u30ed\u30d3\u30b8\u30e7\u30ca\u30fc\uff08Ansible \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304a\u3088\u3073\u5b9f\u884c\u3092\u3059\u308b Vagrant \u306e\u30d7\u30e9\u30b0\u30a4\u30f3\uff09<br \/>\nVagrant \u3084 Ansible \u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb<br \/>\nGit 2.33.0.2 \uff08bash \u304a\u3088\u3073 SSH \u95a2\u9023\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3046\u305f\u3081\uff09<\/p>\n<p>\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb \u30ce\u30fc\u30c9 (VirtualBox \u306e VM\u3002\u540d\u524d\u306f control)<\/p>\n<p>CentOS7<br \/>\nAnsible<br \/>\nAnsible \u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\uff08\u30db\u30b9\u30c8OS\u3068\u5171\u6709\uff09<\/p>\n<p>\u30de\u30cd\u30fc\u30b8\u30c9 \u30ce\u30fc\u30c9 (VirtualBox \u306e VM\u3002\u540d\u524d\u306f node1)<\/p>\n<p>CentOS7<br \/>\nAnsible \u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3084\u30d5\u30a1\u30a4\u30eb<\/p>\n<p>\u5728\u6253\u5f00Windows\u4e0a\u7684Visual Studio Code\u7684\u540c\u65f6\uff0c\u4e3a\u4e86\u5728Linux\u4e0a\u8fd0\u884cAnsible\uff0c\u6211\u5c06\u4e3b\u673a\u64cd\u4f5c\u7cfb\u7edf\u548c\u63a7\u5236\u8282\u70b9\u5206\u5f00\u3002<br \/>\n\u7136\u800c\uff0c\u5e76\u4e0d\u662f\u8bf4\u53ea\u6709\u8fd9\u79cd\u914d\u7f6e\u624d\u80fd\u4f7f\u7528Ansible\u3002<br \/>\n\u6211\u8ba4\u4e3a\u4e3b\u673a\u64cd\u4f5c\u7cfb\u7edf\u4e5f\u53ef\u4ee5\u662fmac\uff0c\u4f46\u6211\u6ca1\u6709\u5c1d\u8bd5\u8fc7\u3002<\/p>\n<p>\u8bf7\u53c2\u8003\u672c\u6587\u7ae0\u7684\u6700\u540e\u4e00\u4e2a\u53c2\u8003\u7f51\u7ad9\uff0c\u4e86\u89e3\u6709\u5173\u5728\u7269\u7406\u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u7684\u65b9\u6cd5\u3002<\/p>\n<h2>Ansible \u662f\u4e00\u79cd\u81ea\u52a8\u5316\u5de5\u5177\u3002<\/h2>\n<p>\u5982\u679c\u60a8\u4e0d\u592a\u4e86\u89e3Ansible\uff0c\u6211\u5c06\u89e3\u91ca\u4e00\u4e0b\u5b83\u662f\u4ec0\u4e48\u3002<br \/>\n\u5982\u679c\u60a8\u53ea\u662f\u8981\u5b89\u88c5\u5b83\uff0c\u4e5f\u53ef\u4ee5\u8df3\u8fc7\u8fd9\u4e2a\u89e3\u91ca\u3002<\/p>\n<p>Ansible\u662f\u4e00\u6b3e\u65e8\u5728\u81ea\u52a8\u5316\u5728Linux\u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u5404\u79cd\u8f6f\u4ef6\u548c\u6587\u4ef6\u7684\u8f6f\u4ef6\u3002\u5c06\u5b89\u88c5\u8fc7\u7a0b\u5199\u5165Ansible\u7684Playbook\u6587\u4ef6\u4e2d\u7684\u4efb\u52a1\u3002Playbook\u6587\u4ef6\u91c7\u7528YAML\u683c\u5f0f\u7f16\u5199\uff0c\u4f46\u4e0e\u5176\u4ed6\u811a\u672c\u4e00\u6837\uff0c\u6309\u7167\u4ece\u4e0a\u5230\u4e0b\u7684\u987a\u5e8f\u6267\u884c\u4efb\u52a1\u3002<\/p>\n<p>\u4efb\u52a1\u7684\u6267\u884c\u662f\u5728\u901a\u8fc7 SSH \u767b\u5f55\u7684\u6258\u7ba1\u8282\u70b9\u4e2d\u8fdb\u884c\u7684\u3002\u53ea\u8981\u80fd\u591f\u901a\u8fc7 SSH \u767b\u5f55\uff0c\u5c31\u53ef\u4ee5\u4f7f\u7528 Ansible \u6267\u884c\u5404\u79cd\u4efb\u52a1\u3002\u7136\u800c\uff0c\u9700\u8981\u5355\u72ec\u8fdb\u884c\u914d\u7f6e\u4ee5\u786e\u4fdd\u80fd\u591f\u901a\u8fc7 SSH \u767b\u5f55\uff0c\u8fd9\u4e0e Ansible \u4e0d\u540c\u3002<\/p>\n<p>\u5728\u4efb\u52a1\u4e2d\uff0c\u60a8\u53ef\u4ee5\u6307\u5b9a\u5728\u53d7\u7ba1\u7406\u7684\u8282\u70b9\u4e0a\u6267\u884c\u7684\u76f8\u5e94\u547d\u4ee4\u7684\u6a21\u5757\u3002<br \/>\n\u63d0\u4f9b\u4e86\u975e\u5e38\u591a\u7684\u6a21\u5757\uff0c\u5305\u62ec\u5b89\u88c5RPM\u5305\u7684\u6a21\u5757\u548c\u8fdc\u7a0b\u590d\u5236\u6587\u4ef6\u7684\u6a21\u5757\u7b49\u7b49\u3002<br \/>\n\u7531\u4e8e\u8fd8\u6709\u76f4\u63a5\u6267\u884cshell\u547d\u4ee4\u7684\u6a21\u5757\uff0c\u6240\u4ee5\u60a8\u53ef\u4ee5\u5148\u4f7f\u7528shell\u547d\u4ee4\u521b\u5efaPlaybook\uff0c\u7136\u540e\u5728\u4ee5\u540e\u6709\u6548\u7387\u5730\u8fdb\u884c\u5f00\u53d1\u65f6\u5c06\u5176\u66ff\u6362\u4e3a\u9002\u5f53\u7684\u6a21\u5757\u3002<\/p>\n<p>\u8df3\u8fc7\u4e0e\u5df2\u5b89\u88c5\u8f6f\u4ef6\u76f8\u5173\u7684\u4efb\u52a1\u3002<br \/>\n\u56e0\u6b64\uff0c\u5982\u679c\u4ece\u5df2\u5b89\u88c5\u72b6\u6001\u91cd\u65b0\u5b89\u88c5\uff0c\u4f1a\u51fa\u73b0\u9519\u8bef\u3002<br \/>\n\u5373\u4f7f\u4f7f\u7528\u5b89\u88c5\u7a0b\u5e8f\uff0cAnsible\u4e5f\u4e0d\u4f1a\u51fa\u73b0\u9519\u8bef\u3002<br \/>\n\u65e0\u8bba\u662f\u5426\u5df2\u5b89\u88c5\uff0c\u6267\u884cAnsible\u540e\u90fd\u4f1a\u5728\u5df2\u5b89\u88c5\u72b6\u6001\u4e0b\u6b63\u5e38\u5b8c\u6210\u3002<br \/>\n\u5373\u4f7f\u524d\u63d0\u6761\u4ef6\u4e0d\u540c\uff0c\u7ed3\u679c\u4e5f\u76f8\u540c\uff0c\u8fd9\u79cd\u7279\u6027\u79f0\u4e3a\u5e42\u7b49\u6027\uff0c<br \/>\n\u51e0\u4e4e\u6240\u6709\u53ef\u4ee5\u6307\u5b9a\u7ed9Ansible\u4efb\u52a1\u7684\u6a21\u5757\u90fd\u5177\u6709\u5e42\u7b49\u6027\u3002<\/p>\n<p>\u7136\u800c\uff0c\u5982\u679c\u4f7f\u7528\u76f4\u63a5\u6267\u884cshell\u547d\u4ee4\u7684\u6a21\u5757\uff0c\u5219\u8be5\u4efb\u52a1\u53ef\u80fd\u6ca1\u6709\u5e42\u7b49\u6027\u3002<br \/>\n\u5982\u679c\u7a0d\u540e\u5c06\u76f4\u63a5\u6267\u884c\u547d\u4ee4\u7684\u6a21\u5757\u66ff\u6362\u4e3a\u975e\u76f4\u63a5\u6267\u884c\u547d\u4ee4\u7684\u6a21\u5757\u6216\u8005\u8bbe\u7f6e\u9002\u5f53\u7684\u6761\u4ef6\uff0c\u5c31\u53ef\u4ee5\u5c06\u5176\u53d8\u4e3a\u5177\u6709\u5e42\u7b49\u6027\u7684Playbook\u3002<\/p>\n<h2>Vagrant \u662f\u4ec0\u4e48\u610f\u601d?<\/h2>\n<p>\u5982\u679c\u60a8\u4e0d\u592a\u719f\u6089Vagrant\uff0c\u6211\u6765\u89e3\u91ca\u4e00\u4e0b\u5b83\u662f\u4ec0\u4e48\u3002<br \/>\n\u5982\u679c\u60a8\u53ea\u662f\u60f3\u5b89\u88c5\u5b83\uff0c\u53ef\u4ee5\u8df3\u8fc7\u8fd9\u90e8\u5206\u5185\u5bb9\u3002<\/p>\n<p>Vagrant \u662f\u4e00\u79cd\u7528\u4e8e\u64cd\u4f5c\u865a\u62df\u673a\u8f6f\u4ef6\uff08\u5982VirtualBox\u6216VMWare Player\uff09\u7684\u81ea\u52a8\u5316\u8f6f\u4ef6\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee3\u7801\u521b\u5efa\u865a\u62df\u673a\u3002<\/p>\n<p>\u5f53\u6211\u4eec\u80fd\u591f\u901a\u8fc7\u4ee3\u7801\u8fdb\u884c\u64cd\u4f5c\u65f6\uff0c\u865a\u62df\u673a\u7684\u914d\u7f6e\u4fe1\u606f\uff08\u5305\u62ec\u865a\u62df\u673a\u6570\u91cf\u3001\u5185\u5b58\u5927\u5c0f\u3001IP\u5730\u5740\u7b49\uff09\u5c06\u5d4c\u5165\u5230\u4ee3\u7801\u4e2d\u3002<br \/>\n\u901a\u8fc7\u590d\u5236\u4ee3\u7801\uff0c\u53ef\u4ee5\u91cd\u65b0\u5229\u7528\u865a\u62df\u673a\u914d\u7f6e\u7684\u5168\u90e8\u6216\u90e8\u5206\uff0c\u5e76\u4e14\u53ef\u4ee5\u8fdb\u884c\u7248\u672c\u7ba1\u7406\uff0c\u4f8b\u5982\u4f7f\u7528Git\u3002<\/p>\n<p>\u865a\u62df\u673a\u662f\u5728\u7269\u7406\u786c\u4ef6\u5185\u521b\u5efa\u7684\u865a\u62df\u786c\u4ef6\u3002\u5b83\u7528\u4e8e\u5f00\u53d1\u5728\u53e6\u4e00\u4e2a\u7269\u7406\u670d\u52a1\u5668\u4e0a\u8fd0\u884c\u7684\u751f\u4ea7\u7cfb\u7edf\u3002\u5f53\u7cfb\u7edf\u7684\u6784\u6210\u8981\u7d20\u5305\u62ec\u54cd\u5e94\u7f51\u7edc\u8bf7\u6c42\u7684\u670d\u52a1\u5668\u65f6\uff0c\u5b83\u5c31\u662f\u5fc5\u9700\u7684\u3002<\/p>\n<p>\u53ef\u4ee5\u5c06\u865a\u62df\u673a\uff08VM\uff09\u66ff\u6362\u4e3aDocker\u5bb9\u5668\u8fdb\u884c\u5f00\u53d1\u548c\u8fd0\u7ef4\uff0c<br \/>\n\u4f46Vagrant\u4ec5\u5904\u7406\u865a\u62df\u673a\uff08VM\uff09\u3002<br \/>\n\u5982\u679c\u4f7f\u7528Docker\uff0cVagrant\u7684\u4ee3\u7801\u548cAnsible\u7684\u5168\u90e8\u6216\u90e8\u5206\u4ee3\u7801\u5c06\u88ab\u66ff\u6362\u4e3aDockerfile\u548cdocker-compose.yml\u3002<\/p>\n<p>Vagrant \u4e2d\u63d0\u4f9b\u4e86 Ansible Local provisioner \u63d2\u4ef6\u3002<br \/>\n\u5f53\u7f16\u5199 Vagrant \u7684\u4ee3\u7801\u4ee5\u6267\u884c Ansible Playbook \u65f6\uff0c<br \/>\nAnsible Local provisioner \u4f1a\u81ea\u52a8\u5728\u865a\u62df\u673a\u4e2d\u5b89\u88c5 Ansible\uff0c<br \/>\n\u5e76\u6267\u884c Playbook\u3002<br \/>\n\u672c\u4e66\u4f7f\u7528\u7684\u65b9\u6cd5\u662f\u901a\u8fc7\u8fd0\u884c\u865a\u62df\u7684 Playbook \u6765\u81ea\u52a8\u5b89\u88c5 Ansible\u3002<\/p>\n<h2>\u5b89\u88c5\u6b65\u9aa4<\/h2>\n<p>\u624b\u7eed\u867d\u7136\u7e41\u7410\uff0c\u4f46\u5e76\u65e0\u7279\u5b9a\u7684\u524d\u63d0\u77e5\u8bc6\u6216\u9700\u8981\u8003\u8651\u7684\u4e8b\u9879\uff0c\u6240\u4ee5\u53ef\u4ee5\u76f4\u63a5\u6309\u7167\u539f\u6837\u8fdb\u884c\u3002<\/p>\n<p>\u5982\u679c\u6587\u5b57\u89e3\u91ca\u96be\u4ee5\u7406\u89e3\uff0c\u60a8\u4e5f\u53ef\u4ee5\u53c2\u8003\u672c\u4e66\u672b\u5c3e\u7684\u7ed3\u6784\u5316\u6587\u6863\uff0c\u6309\u7167\u6b65\u9aa4\u8fdb\u884c\u64cd\u4f5c\u3002<\/p>\n<h3>\u5b89\u88c5 VirtualBox<\/h3>\n<p>\u8bf7\u5728\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00 https:\/\/www.virtualbox.org\/\uff0c\u70b9\u51fb\u4e0b\u8f7d VirtualBox 6.1 \u6309\u94ae\uff0c\u7136\u540e\u9009\u62e9 Windows hosts \u4e0b\u8f7d\u3002\u4e0b\u8f7d\u5b8c\u6bd5\u540e\uff0c\u6253\u5f00\u4e0b\u8f7d\u7684\u6587\u4ef6\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d4fe137434c4406cc48bd\/32-0.jpeg\" alt=\"VirtualBox \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u30da\u30fc\u30b8\" \/><\/div>\n<p>\u5b89\u88c5\u9009\u9879\u53ef\u4ee5\u4f7f\u7528\u9ed8\u8ba4\u8bbe\u7f6e\u3002<\/p>\n<p>\u5f53\u88ab\u95ee\u53ca\u662f\u5426\u8981\u5b89\u88c5\u9a71\u52a8\u7a0b\u5e8f\u65f6\uff0c\u6211\u4f1a\u9009\u62e9\u5b89\u88c5\u3002<\/p>\n<p>\u82e5\u5728\u540e\u7eed\u7f16\u5199\u7684\u6b65\u9aa4\u4e2d\u51fa\u73b0\u4e86\u865a\u62df\u673a\u65e0\u6cd5\u542f\u52a8\u7684\u95ee\u9898\uff0c\u8bf7\u5728\u7f51\u7edc\u4e0a\u641c\u7d22\u4ee5\u4e0b\u5177\u4f53\u65b9\u6cd5\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u304a\u4f7f\u3044\u306e PC\uff08\u30db\u30b9\u30c8OS\uff09\u306e BIOS \u306b\u4eee\u60f3\u5316\uff08Virtualization\uff09\u306e\u6a5f\u80fd\u3092\u30aa\u30f3\u307e\u305f\u306f\u30aa\u30d5\u3092<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u9078\u3076\u9805\u76ee\u304c\u3042\u308b\u5834\u5408\u3001\u30aa\u30f3\u306b\u8a2d\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">Hyper-V \u306f\u7121\u52b9\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059<\/ul>\n<h3>\u5b89\u88c5Vagrant<\/h3>\n<p>\u8bf7\u5728\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00https:\/\/www.vagrantup.com\/downloads.html\uff0c\u5e76\u70b9\u51fbWindows\u9009\u9879\u5361\u4e0b\u768464\u4f4d\u7248\u672c\u8fdb\u884c\u4e0b\u8f7d\u3002<br \/>\n\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u6253\u5f00\u4e0b\u8f7d\u7684\u6587\u4ef6\u5e76\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d4fe137434c4406cc48bd\/39-0.jpeg\" alt=\"Vagrant \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u30da\u30fc\u30b8\" \/><\/div>\n<p>\u5b89\u88c5\u9009\u9879\u53ef\u4ee5\u4f7f\u7528\u9ed8\u8ba4\u8bbe\u7f6e\u3002<\/p>\n<p>\u5b8c\u6210\u5b89\u88c5\u540e\uff0c\u5c06\u91cd\u65b0\u542f\u52a8\u8ba1\u7b97\u673a\u3002<\/p>\n<h3>\u5b89\u88c5Git for Windows\u3002<\/h3>\n<p>\u6253\u5f00\u6d4f\u89c8\u5668\u5e76\u8bbf\u95eehttps:\/\/git-scm.com\/\uff0c\u70b9\u51fb\u201cDownloads for Windows\u201d\u6309\u94ae\u5373\u53ef\u5f00\u59cb\u4e0b\u8f7d\u3002<br \/>\n\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u6253\u5f00\u6587\u4ef6\u5e76\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d4fe137434c4406cc48bd\/44-0.jpeg\" alt=\"Git \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u30da\u30fc\u30b8\" \/><\/div>\n<p>\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u5efa\u8bae\u60a8\u63099\u6b21\u201cNext\u201d\u6309\u94ae\u8fdb\u884c\u914d\u7f6e\u884c\u7ed3\u5c3e\u8f6c\u6362\u3002\u5c06\u5176\u8bbe\u7f6e\u4e3a\u201c\u6309\u539f\u6837\u63d0\u53d6\u3001\u6309\u539f\u6837\u63d0\u4ea4\u201d\u3002<\/p>\n<p>\u5176\u4ed6\u5b89\u88c5\u9009\u9879\u53ef\u4ee5\u4f7f\u7528\u9ed8\u8ba4\u8bbe\u7f6e\u3002<\/p>\n<h3>\u5b89\u88c5Visual Studio Code<\/h3>\n<p>\u5728\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00 https:\/\/code.visualstudio.com\/\uff0c\u7136\u540e\u4e0b\u8f7d\u5e76\u8fd0\u884c\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d4fe137434c4406cc48bd\/49-0.jpeg\" alt=\"Visual Studio Code \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u30da\u30fc\u30b8\" \/><\/div>\n<p>\u5b89\u88c5\u9009\u9879\u53ef\u4ee5\u5168\u90e8\u4f7f\u7528\u9ed8\u8ba4\u8bbe\u7f6e\u3002<\/p>\n<p>\u5b8c\u6210\u5b89\u88c5\u540e\uff0c\u5efa\u8bae\u60a8\u542f\u52a8 Visual Studio Code \u5e76\u5c06\u5176\u56fa\u5b9a\u5230\u4efb\u52a1\u680f\u3002<\/p>\n<h3>\u5c06 Visual Studio Code \u7684\u7ec8\u7aef\u4f7f\u7528\u7684 Shell \u66f4\u6539\u4e3a bash\u3002<\/h3>\n<p>\u5728Visual Studio Code\u7684\u83dc\u5355\u4e2d\u9009\u62e9Terminal&gt;&gt;New Terminal\uff0c\u6253\u5f00\u7ec8\u7aef\uff0c\u7136\u540e\u5728\u663e\u793a\u7684\u83dc\u5355\u4e2d\u70b9\u51fb\u53f3\u8fb9\u7684&#8221;+&#8221;\u4e0b\u9762\u7684\u2193\uff0c\u9009\u62e9Select Default Profile\uff0c\u7136\u540e\u9009\u62e9Git bash\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d4fe137434c4406cc48bd\/54-0.jpeg\" alt=\"Visual Studio Code \u306e Select Default Profile \u30e1\u30cb\u30e5\u30fc\" \/><\/div>\n<p>\u4f7f\u7528PowerShell\u7684\u73b0\u6709\u7ec8\u7aef\uff0c\u8bf7\u6309\u4e0b\u5783\u573e\u7bb1\u6309\u94ae\u5173\u95ed\u3002<\/p>\n<p>\u4e3a\u4e86\u80fd\u591f\u4f7f\u7528\u540e\u7eed\u4ee3\u7801\u547d\u4ee4\uff0c\u5148\u5173\u95ed Visual Studio Code\uff0c\u7136\u540e\u91cd\u65b0\u542f\u52a8\u3002<\/p>\n<h3>\u5f53\u4e3b\u673a\u64cd\u4f5c\u7cfb\u7edf\u4f4d\u4e8e\u6709\u4ee3\u7406\u670d\u52a1\u5668\u7684\u5c40\u57df\u7f51\u4e2d\u65f6\uff0c\u9700\u8981\u8fdb\u884c\u4ee3\u7406\u8bbe\u7f6e\u3002<\/h3>\n<p>\u5982\u679c\u5728\u516c\u53f8\u5185\u6216\u5176\u4ed6\u6709\u4ee3\u7406\u670d\u52a1\u5668\u7684\u5c40\u57df\u7f51\u4e2d\uff0c\u8bf7\u8fdb\u884c\u4ee3\u7406\u8bbe\u7f6e\u3002<br \/>\n\u8bf7\u5411\u7f51\u7edc\u7ba1\u7406\u5458\u7b49\u54a8\u8be2\u83b7\u53d6\u9700\u8981\u8bbe\u5b9a\u7684\u4ee3\u7406\u670d\u52a1\u5668\u7684URL\u3002<br \/>\n\u5982\u679c\u5728\u5bb6\u5ead\u7b49\u6ca1\u6709\u4ee3\u7406\u7684\u73af\u5883\u4e2d\uff0c\u5219\u4e0d\u9700\u8981\u8fdb\u884c\u6b64\u8bbe\u7f6e\u3002<\/p>\n<p>\u5728Visual Studio Code\u83dc\u5355\u4e2d\uff0c\u9009\u62e9Terminal &gt;&gt; New Terminal\u6253\u5f00\u4e00\u4e2a\u7ec8\u7aef\uff08bash\uff09\uff0c\u7136\u540e\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nb\">echo<\/span>  <span class=\"k\">${<\/span><span class=\"nv\">http_proxy<\/span><span class=\"k\">}<\/span>\r\n<\/code><\/pre>\n<p>\u5982\u679c\u663e\u793a\u4e86\u4ee3\u7406\u670d\u52a1\u5668\u7684URL\uff0c\u5219\u4e0d\u9700\u8981\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\u3002<\/p>\n<p>\u5c06\u4ee5\u4e0b\u547d\u4ee4\u7684\u4e00\u90e8\u5206\u66f4\u6539\u4e3a\u6240\u5c5e\u7684LAN\u7684\u4ee3\u7406\u670d\u52a1\u5668URL\u5e76\u6267\u884c\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nb\">echo<\/span>  <span class=\"s2\">\"export   http_proxy=<\/span><span class=\"se\">\\\"<\/span><span class=\"s2\">http:\/\/__ProxyDomain__:__ProxyPortNum__<\/span><span class=\"se\">\\\"<\/span><span class=\"s2\">\"<\/span> <span class=\"o\">&gt;&gt;<\/span> ~\/.bashrc\r\n<span class=\"nb\">echo<\/span>  <span class=\"s2\">\"export  https_proxy=<\/span><span class=\"se\">\\\"<\/span><span class=\"s2\">http:\/\/__ProxyDomain__:__ProxyPortNum__<\/span><span class=\"se\">\\\"<\/span><span class=\"s2\">\"<\/span> <span class=\"o\">&gt;&gt;<\/span> ~\/.bashrc\r\n<span class=\"nb\">echo<\/span>  <span class=\"s2\">\"export  no_proxy=<\/span><span class=\"se\">\\\"<\/span><span class=\"s2\">localhost,127.0.0.1,control,node1<\/span><span class=\"se\">\\\"<\/span><span class=\"s2\">\"<\/span> <span class=\"o\">&gt;&gt;<\/span> ~\/.bashrc\r\n<\/code><\/pre>\n<p>\u4fee\u6539\u9805\u76ee\uff1a<\/p>\n<pre class=\"post-pre\"><code>`http:\/\/__ProxyDomain__:__ProxyPortNum__`\r\n<\/code><\/pre>\n<p>\u4fee\u6539\u540e\u7684\u4f8b\u5b50\uff1a<\/p>\n<pre class=\"post-pre\"><code>`http:\/\/proxy.example.com:8080`\r\n<\/code><\/pre>\n<p>\u6216\u8005<\/p>\n<pre class=\"post-pre\"><code>`http:\/\/10.100.100.100:8080`\r\n<\/code><\/pre>\n<p>\u6267\u884c\u4e0a\u8ff0\u547d\u4ee4\u540e\uff0c\u91cd\u65b0\u6253\u5f00bash\u7ec8\u7aef\u3002<\/p>\n<p>\u53ef\u4ee5\u5ffd\u7565\u4ee5\u4e0b\u7684\u8b66\u544a\u3002<\/p>\n<pre class=\"post-pre\"><code>WARNING: Found ~\/.bashrc but no ~\/.bash_profile, ~\/.bash_login or ~\/.profile.\r\n<\/code><\/pre>\n<h3>\u5b89\u88c5 vbguest \u63d2\u4ef6<\/h3>\n<p>vbguest\u63d2\u4ef6\u662fVagrant\u7684\u4e00\u4e2a\u63d2\u4ef6\uff0c\u7528\u4e8e\u5b89\u88c5\u548c\u6267\u884cAnsible Local Provisioner\u3002<\/p>\n<p>\u8bf7\u5728\u7ec8\u7aef\uff08bash\uff09\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u3002<br \/>\n\u5982\u679c\u7ec8\u7aef\u672a\u6253\u5f00\uff0c<br \/>\n\u8bf7\u5728Visual Studio Code\u83dc\u5355\u4e0b\u9009\u62e9 Terminal &gt;&gt; New Terminal<br \/>\n\u6765\u6253\u5f00\u5b83\u3002<\/p>\n<pre class=\"post-pre\"><code>vagrant plugin <span class=\"nb\">install <\/span>vagrant-vbguest\r\n<\/code><\/pre>\n<h3>\u4e0b\u8f7d\u5e76\u6253\u5f00\u9879\u76ee\u6587\u4ef6\u5939\u3002<\/h3>\n<p>\u4e0b\u8f7d\u5305\u542bVagrant\u4ee3\u7801\u548c\u7b80\u5355Ansible Playbook\u7684Vagrant\u9879\u76ee\uff0c\u521b\u5efa\u865a\u62df\u673a\u5e76\u5b89\u88c5Ansible\u3002<\/p>\n<p>\u60a8\u53ef\u4ee5\u5728\u7ec8\u7aef\uff08bash\uff09\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nb\">cd<\/span> ~\/Desktop\r\ngit clone https:\/\/github.com\/Takakiriy\/multi_vm_ansible.git\r\n<\/code><\/pre>\n<p>\u5728\u7ec8\u7aef(bash)\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u3002<\/p>\n<pre class=\"post-pre\"><code>code ~\/Desktop\/multi_vm_ansible\r\n<\/code><\/pre>\n<p>\u5982\u679c\u627e\u4e0d\u5230 code \u547d\u4ee4\uff0c\u8bf7\u91cd\u65b0\u542f\u52a8 Visual Studio Code\u3002<\/p>\n<p>\u5728Visual Studio Code\u4e2d\u8f93\u5165\u4e0a\u8ff0\u547d\u4ee4\u540e\uff0c\u5c06\u5173\u95ed\u8f93\u5165\u547d\u4ee4\u7684Visual Studio Code\u3002<\/p>\n<p>\u5728\u65b0\u6253\u5f00\u7684 Visual Studio Code \u4e2d\u9009\u62e9\u7ec8\u7aef\u83dc\u5355 &gt;&gt; \u65b0\u5efa\u7ec8\u7aef\u3002<\/p>\n<h4>\u4e3b\u8981\u6587\u4ef6\u5305\u62ec\u5728\u9879\u76ee\u4e2d\u7684\u6587\u4ef6\u3002<\/h4>\n<div>\n<div class=\"post-table\">\u30d5\u30a1\u30a4\u30eb\u540d\u5185\u5bb9playbook-0.ymlAnsible \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u305f\u3081\u306e\u30c0\u30df\u30fc Playbookplaybook.ymlAnsible \u304c\u5b9f\u884c\u3059\u308b\u5185\u5bb9\u3002\u30b5\u30f3\u30d7\u30eb\u3068\u3057\u3066\u3001\u30de\u30cd\u30fc\u30b8\u30c9 \u30ce\u30fc\u30c9 \u306b\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\u30bf\u30b9\u30af\u304c\u5165\u3063\u3066\u3044\u307e\u3059run_playbook.shAnsible \u306e Playbook \u3092\u5b9f\u884c\u3057\u307e\u3059upload_SSH_keys.sh\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb \u30ce\u30fc\u30c9 \u304b\u3089 \u30de\u30cd\u30fc\u30b8\u30c9 \u30ce\u30fc\u30c9 \u306b SSH \u63a5\u7d9a\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059VagrantfileVagrant \u304c\u4f5c\u6210\u3059\u308b VM \u306e\u5185\u5bb9<\/div>\n<\/div>\n<h3>\u521b\u5efa\u5e76\u542f\u52a8\u865a\u62df\u673a\u3002<\/h3>\n<p>\u5728\u7ec8\u7aef\uff08bash\uff09\u4e2d\u8f93\u5165\u4e0b\u5217\u547d\u4ee4\u3002<br \/>\n\u6b64\u547d\u4ee4\u6839\u636e Vagrantfile \u7684\u5185\u5bb9\u521b\u5efa\u865a\u62df\u673a\u3002<\/p>\n<pre class=\"post-pre\"><code>vagrant up\r\n<\/code><\/pre>\n<p>\u4e3a\u4e86\u5728\u63a7\u5236\u8282\u70b9\u4e0a\u5b89\u88c5Ansible Local Provisioner\uff0c\u6211\u4eec\u8981\u6267\u884c\u4e00\u4e2a\u540d\u4e3aplaybook-0.yml\u7684\u6587\u4ef6\u3002\u8fd9\u4e2a\u8fc7\u7a0b\u5927\u7ea6\u9700\u898110\u5206\u949f\u65f6\u95f4\u3002<\/p>\n<p>Vagrant \u9879\u76ee\u6240\u5728\u7684\u6587\u4ef6\u5939\u4f1a\u4e0e\u865a\u62df\u673a\u7684\/vagrant\/\u6587\u4ef6\u5939\u8fdb\u884c\u5171\u4eab\u3002<\/p>\n<p>\u6267\u884c\u65e5\u5fd7\u7684\u793a\u4f8b\uff1a<\/p>\n<pre class=\"post-pre\"><code>Unmounting Virtualbox Guest Additions ISO from: \/mnt\r\n==&gt; control: Checking for guest additions in VM...\r\n==&gt; control: Configuring and enabling network interfaces...\r\n==&gt; control: Mounting shared folders...\r\n    control: \/vagrant =&gt; C:\/Users\/user1\/Desktop\/multi_vm_ansible\r\n==&gt; control: Running provisioner: ansible_local...\r\n    control: Installing Ansible...\r\n    control: Running ansible-playbook...\r\n\r\nPLAY [control] *****************************************************************\r\n\r\nTASK [Gathering Facts] *********************************************************\r\nok: [control]\r\n\r\nTASK [dummy] *******************************************************************\r\nok: [control] =&gt; {\r\n    \"msg\": \"Ansible ready\"\r\n}\r\n\r\nPLAY RECAP *********************************************************************\r\ncontrol                    : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0\r\n<\/code><\/pre>\n<h3>\u6211\u5011\u5c07\u8a2d\u5b9aVisual Studio Code\uff0c\u4ee5\u4f7f\u5176\u53ef\u4ee5\u901a\u904eSSH\u9023\u63a5\u5230VM\u3002<\/h3>\n<p>\u6309\u4e0bVisual Studio Code\u7684&#8221;\u62e1\u5f35\u6a5f\u80fd&#8221;\u6309\u9215\uff0c\u5b89\u88ddRemote Development\u64f4\u5c55\u529f\u80fd\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d4fe137434c4406cc48bd\/97-0.jpeg\" alt=\"Remote Development \u62e1\u5f35\u6a5f\u80fd\" \/><\/div>\n<p>\u5728Remote Development\u89c6\u56fe\u4e2d\uff0c\u4eceREMOTE EXPLORER\u4e0b\u62c9\u83dc\u5355\u4e2d\u9009\u62e9SSH Targets\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d4fe137434c4406cc48bd\/99-0.jpeg\" alt=\"REMOTE EXPLORER \u306e SSH Targets\" \/><\/div>\n<p>\u5728\u7ec8\u7aef\uff08bash\uff09\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u3002<\/p>\n<pre class=\"post-pre\"><code>vagrant ssh-config\r\n<\/code><\/pre>\n<p>\u5c06\u663e\u793a\u5fc5\u8981\u7684SSH\u8fde\u63a5\u8bbe\u7f6e\u5e76\u8fdb\u884c\u590d\u5236\u3002<br \/>\n\u590d\u5236\u76ee\u6807\u662f\u4e0b\u9762\u547d\u4ee4\u6253\u5f00\u7684\u6587\u4ef6\u3002<br \/>\n\u8bf7\u4e0d\u8981\u5220\u9664\u5df2\u5b58\u5728\u7684\u5176\u4ed6\u670d\u52a1\u5668\u914d\u7f6e\u3002<\/p>\n<pre class=\"post-pre\"><code>code ~\/.ssh\/config\r\n<\/code><\/pre>\n<p>\u5c06\u5149\u6807\u60ac\u505c\u5728\u8fdc\u7a0b\u5f00\u53d1\u89c6\u56fe\u4e0a\uff0c\u5e76\u6309\u4e0b\u53f3\u4e0a\u89d2\u663e\u793a\u7684&#8221;\u91cd\u65b0\u52a0\u8f7d&#8221;\u6309\u94ae\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d4fe137434c4406cc48bd\/105-0.jpeg\" alt=\"REMOTE EXPLORER \u306e Reload\" \/><\/div>\n<p>\u5f53\u9f20\u6807\u60ac\u505c\u5728\u6240\u663e\u793a\u7684\u63a7\u4ef6\u4e0a\u65f6\uff0c\u4f1a\u51fa\u73b0\u6587\u4ef6\u5939\u6309\u94ae\uff0c\u7136\u540e\u70b9\u51fb\u5b83\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d4fe137434c4406cc48bd\/107-0.jpeg\" alt=\"REMOTE EXPLORER \u306e Folder\" \/><\/div>\n<p>\u4f1a\u6253\u5f00\u4e00\u4e2a\u65b0\u7684 Visual Studio Code \u7a97\u53e3\u3002<br \/>\n\u8be5\u7a97\u53e3\u662f\u901a\u8fc7 SSH \u8fdc\u7a0b\u8fde\u63a5\u7684 Visual Studio Code\u3002<br \/>\n\u5f53\u60a8\u9996\u6b21\u8fde\u63a5\u65f6\uff0c\u4f1a\u8be2\u95ee\u60a8\u7684\u5e73\u53f0\uff0c\u8bf7\u9009\u62e9 Linux\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d4fe137434c4406cc48bd\/109-0.jpeg\" alt=\"REMOTE EXPLORER \u306e Linux\" \/><\/div>\n<p>\u7528\u63a7\u5236 Visual Studio Code \u83dc\u5355\u4e2d\u7684 &#8220;File&#8221; &gt;&gt; &#8220;Open Folder &#8230;&#8221;\uff0c\u9009\u62e9\u6253\u5f00 &#8220;\/vagrant\/&#8221; \u6587\u4ef6\u5939\u3002<\/p>\n<p>\u65b0\u7684 Visual Studio Code \u7a97\u53e3\u5c06\u518d\u6b21\u6253\u5f00\u3002<br \/>\n\u4e4b\u524d\u6253\u5f00\u7684\u63a7\u5236\u7684 Visual Studio Code \u5c06\u88ab\u5173\u95ed\u3002<br \/>\n\u65b0\u7684\u7a97\u53e3\u5c06\u6253\u5f00\u63a7\u5236\u8282\u70b9\u7684 \/vagrant\/ \u6587\u4ef6\u5939\u3002<br \/>\n\u5728\u8be5\u7a97\u53e3\u4e2d\u9009\u62e9 Terminal &gt;&gt; New Terminal \u83dc\u5355\uff0c<br \/>\n\u4ee5\u786e\u4fdd\u6253\u5f00\u4e86\u4e00\u4e2a\u7ec8\u7aef\u3002<br \/>\n\u8be5\u7ec8\u7aef\u662f\u901a\u8fc7 SSH \u8fde\u63a5\u7684\u7ec8\u7aef\u3002<\/p>\n<pre class=\"post-pre\"><code>[vagrant@localhost vagrant]$\r\n<\/code><\/pre>\n<p>\u88ab\u6807\u6ce8\u4e3a\u3002<\/p>\n<p>\u5f53\u6253\u5f00\u4e86 Visual Studio Code\uff0c\u6211\u4f1a\u628a\u5b83\u5173\u95ed\u3002<\/p>\n<h3>\u786e\u4fdd\u63a7\u5236\u8282\u70b9\u80fd\u591f\u901a\u8fc7SSH\u8fde\u63a5\u5230\u6258\u7ba1\u8282\u70b9\u3002<\/h3>\n<p>\u4f7f\u7528\u4e3b\u673a\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u7684Visual Studio Code\u7ec8\u7aef\uff08bash\uff09\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u3002<\/p>\n<pre class=\"post-pre\"><code>.\/upload_SSH_keys.sh\r\n<\/code><\/pre>\n<p>\u5f53\u5728\u9014\u4e2d\u88ab\u8be2\u95ee\u662f\u5426\u8fde\u63a5\u5230\u6b64\u670d\u52a1\u5668\u65f6\uff0c\u8bf7\u8f93\u5165\u201c\u662f\u201d\u4f5c\u7b54\u3002<\/p>\n<p>Shell\u811a\u672cupload_SSH_keys.sh\u7528\u4e8e\u8fdb\u884cSSH\u8fde\u63a5\u6240\u9700\u7684\u5404\u79cd\u8bbe\u7f6e\u548c\u8fde\u63a5\u6d4b\u8bd5\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb \u30ce\u30fc\u30c9 \u306b\u79d8\u5bc6\u9375\u3092\u30b3\u30d4\u30fc\u3057\u307e\u3059<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u305d\u306e\u516c\u958b\u9375\u3092 \u30de\u30cd\u30fc\u30b8\u30c9 \u30ce\u30fc\u30c9 \u306b\u30b3\u30d4\u30fc\u3057\u307e\u3059<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30db\u30b9\u30c8\u540d\u3092\u767b\u9332\u3057\u307e\u3059<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb \u30ce\u30fc\u30c9 \u304b\u3089 \u30de\u30cd\u30fc\u30b8\u30c9 \u30ce\u30fc\u30c9\u306b SSH \u63a5\u7d9a\u3067\u304d\u308b\u3053\u3068\u3092\u30c6\u30b9\u30c8\u3057\u307e\u3059<\/ul>\n<p>\u6267\u884c\u8fc7\u7a0b\u4e2d\u7684\u60c5\u51b5:<\/p>\n<pre class=\"post-pre\"><code>$ .\/upload_SSH_keys.sh\r\n\r\n~\/.ssh\/known_hosts\r\ncat: \/c\/Users\/user1\/.ssh\/known_hosts: No such file or directory\r\n\r\n# test connection and set known_host @control\r\nThe authenticity of host '[localhost]:2259 ([127.0.0.1]:2259)' can't be established.\r\nED25519 key fingerprint is SHA256:OyAt+LkHfQOnkxDEJ2JhI+MTWKvOgg9ou\/l2C21ltIs.\r\nThis key is not known by any other names\r\nAre you sure you want to continue connecting (yes\/no\/[fingerprint])? yes\r\nWarning: Permanently added '[localhost]:2259' (ED25519) to the list of known hosts.\r\nconnected to (@control)\r\n\r\n# test connection and set known_host @node1\r\nThe authenticity of host '[localhost]:2251 ([127.0.0.1]:2251)' can't be established.\r\nED25519 key fingerprint is SHA256:Ndr0xuMRTa6a9OKa15VI3HmQtCFwty81RDeadb\/ibhw.\r\nThis key is not known by any other names\r\nAre you sure you want to continue connecting (yes\/no\/[fingerprint])? yes\r\nWarning: Permanently added '[localhost]:2251' (ED25519) to the list of known hosts.\r\nconnected to (@node1)\r\n\r\n# make private key @control\r\nprivate_key                                                           100% 1706   603.4KB\/s   00:00\r\n-rw-r--r--. 1 vagrant vagrant 1706 Aug 29 04:13 \/home\/vagrant\/.ssh\/id_rsa\r\n\r\n# chmod private key @control\r\n-rw-------. 1 vagrant vagrant 1706 Aug 29 04:13 \/home\/vagrant\/.ssh\/id_rsa\r\n\r\n# add host name @control\r\n127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4\r\n::1         localhost localhost.localdomain localhost6 localhost6.localdomain6\r\n192.168.33.51  node1\r\n\r\n# get public key @host\r\nssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCymXRpjm0PZfc2CHSi+Ilelm2BSfwigfXIWRleNPH66y+y46B8tENLDtwlVlMcv\/p55HOelg+VwJ4P3udX80VABGWRKW\/+VvEaZU5rdeCU82q95WyZOfV2WUwtwtEV81lcpKIsigDp1leR1eWmp8xucGbjLiZJ1i3WDCjgb7cYq49CIUpETHRdLqPFnsKOram3wRUOhD93kxVDma6d73E1b9XxoOm72EU2K0lQpejcjZuS\/hZ8PCgca1kzM8wq6L6StOYlOugm\/rorZDOMIXXEQddj2FUl27ORqCZn5b6YQr7ludd72AJE3ARVkRwRQGlm0Yasc8zqK99tph+jErF9 vagrant\r\n\r\n# set authorized_keys @node1\r\nssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDsdsticBkUTm3ndmUuu1bdxuyw5guXo7FmpjwWoa1lGIX4pIBtSh+2VfcpEnShT4rl1mxRjHDXJT6lNqIW7BYMHeC61GLafKVkrQeXkwEpiQBvx2gYd6gO\/zkrNAd6JwI13D\/iNqxHKohylDI1A64DsBSHgZS8QV1BYWJSAl5iUxct2aA04jq0+LKU4WteQcZjCU03TTIYKYzXfQ8OhvUd7JNJvI3IUgpkolJz8keidKZdmfNmNzrjGhu51KdDZnn0iMfOe8rAgwzdKcRnYIbP4m9oBifZeFecWeuHFLOUP6hbNn+MRao8h\/s07drlQNXkhUnZqwV8PgnT35gz6eOB vagrant\r\nssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCymXRpjm0PZfc2CHSi+Ilelm2BSfwigfXIWRleNPH66y+y46B8tENLDtwlVlMcv\/p55HOelg+VwJ4P3udX80VABGWRKW\/+VvEaZU5rdeCU82q95WyZOfV2WUwtwtEV81lcpKIsigDp1leR1eWmp8xucGbjLiZJ1i3WDCjgb7cYq49CIUpETHRdLqPFnsKOram3wRUOhD93kxVDma6d73E1b9XxoOm72EU2K0lQpejcjZuS\/hZ8PCgca1kzM8wq6L6StOYlOugm\/rorZDOMIXXEQddj2FUl27ORqCZn5b6YQr7ludd72AJE3ARVkRwRQGlm0Yasc8zqK99tph+jErF9 vagrant\r\n\r\n# test connection and set known_host @control\r\nWarning: Permanently added 'node1,192.168.33.51' (ECDSA) to the list of known hosts.\r\ncontrol connected to node1\r\n\r\n$\r\n<\/code><\/pre>\n<h3>\u901a\u8fc7SSH\u8fdb\u884c\u4e3b\u673a\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u7684\u63a7\u5236\u8282\u70b9\u8fd0\u884cAnsible\u3002<\/h3>\n<p>\u5728\u4e3b\u673a\u64cd\u4f5c\u7cfb\u7edf\u7684 Visual Studio Code \u7ec8\u7aef (bash) \u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u3002<\/p>\n<pre class=\"post-pre\"><code>.\/run_playbook.sh\r\n<\/code><\/pre>\n<p>\u6267\u884c playbook.yml \u4e2d\u7684\u6240\u6709\u4efb\u52a1\u3002<br \/>\n\u9644\u968f\u7684 playbook.yml \u4ec5\u5728\u6258\u7ba1\u8282\u70b9 node1 \u4e0a\u521b\u5efa ~\/tmp_visiting_card \u6587\u4ef6\uff0c<br \/>\n\u800c\u901a\u5e38\u7684 playbook.yml \u5219\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<p>\u6267\u884c\u7684\u60c5\u51b5: de : )<br \/>\n\u884c\u52a8\u7684\u60c5\u51b5\uff1a de : )<\/p>\n<pre class=\"post-pre\"><code>$ .\/run_playbook.sh\r\nUsing \/etc\/ansible\/ansible.cfg as config file\r\n\r\nPLAY [node1] *******************************************************************\r\n\r\nTASK [Gathering Facts] *********************************************************\r\nok: [node1]\r\n\r\nTASK [make visiting card] ******************************************************\r\n--- before\r\n+++ after\r\n@@ -1,6 +1,6 @@\r\n {\r\n-    \"atime\": 1630211877.1403475,\r\n-    \"mtime\": 1630211877.1403475,\r\n+    \"atime\": 1630211959.23235,\r\n+    \"mtime\": 1630211959.23235,\r\n     \"path\": \"tmp_visiting_card\",\r\n-    \"state\": \"file\"\r\n+    \"state\": \"touch\"\r\n }\r\n\r\nchanged: [node1] =&gt; {\"changed\": true, \"dest\": \"tmp_visiting_card\", \"gid\": 1000, \"group\": \"vagrant\", \"mode\": \"0664\", \"owner\": \"vagrant\", \"secontext\": \"unconfined_u:object_r:user_home_t:s0\", \"size\": 0, \"state\": \"file\", \"uid\": 1000}\r\n\r\nPLAY RECAP *********************************************************************\r\nnode1                      : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0\r\n<\/code><\/pre>\n<h2>\u5907\u4efd\u548c\u6062\u590d\u64cd\u4f5c\u6b65\u9aa4\u3002<\/h2>\n<p>\u4e00\u65e6\u5b89\u88c5\u4e86Ansible\uff0c\u53ef\u4ee5\u8003\u8651\u5907\u4efd\u8be5\u72b6\u6001\u7684\u865a\u62df\u673a\u3002<br \/>\n\u6709\u4e86\u5907\u4efd\uff0c\u53ef\u4ee5\u5728\u6211\u4eec\u5f00\u53d1\u7684Playbook\u6b63\u5e38\u8fd0\u884c\u4e4b\u524d\uff0c\u8fd8\u539f\u865a\u62df\u673a\u5e76\u91cd\u65b0\u6267\u884c\u64cd\u4f5c\u3002<br \/>\n\u6b64\u5916\uff0c\u5728\u4efb\u52a1\u6210\u529f\u8fd0\u884c\u7684\u6570\u91cf\u8fbe\u5230\u4e00\u5b9a\u7a0b\u5ea6\u65f6\uff0c\u5907\u4efd\u865a\u62df\u673a\u4e5f\u662f\u4e2a\u4e0d\u9519\u7684\u9009\u62e9\u3002<\/p>\n<h3>\u5907\u4efd\u865a\u62df\u673a\u3002<\/h3>\n<p>\u5173\u95ed\u6b63\u5728\u8fdb\u884c SSH \u8fde\u63a5\u7684 Visual Studio Code\u3002<\/p>\n<p>\u6253\u5f00VirtualBox\u7ba1\u7406\u5668\uff0c\u6309\u4f4fCtrl\u952e\u9009\u62e9\u591a\u4e2a\u865a\u62df\u673a\uff0c\u53f3\u952e\u5355\u51fb\uff0c\u9009\u62e9\u5173\u95ed&gt;&gt;\u7535\u6e90\u5173\u673a\u3002<\/p>\n<p>\u5c06\u4e0b\u9762\u7684\u6587\u4ef6\u5939\u590d\u5236\u5230\u5907\u4efd\u6587\u4ef6\u5939\u4e2d\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u5404 VM \u306e\u30d5\u30a9\u30eb\u30c0\u30fc (~\/VirtualBox VMs\/____)<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">Vagrant \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e .vagrant \u30d5\u30a9\u30eb\u30c0\u30fc<\/ul>\n<h3>\u5220\u9664VM<\/h3>\n<p>\u6253\u5f00VirtualBox\u7ba1\u7406\u5668\uff0c\u5728\u6309\u4f4fCtrl\u952e\u7684\u540c\u65f6\u9009\u62e9\u591a\u4e2a\u865a\u62df\u673a\uff0c\u53f3\u952e\u70b9\u51fb\uff0c\u9009\u62e9\u5220\u9664&gt;&gt;\u5220\u9664\u6240\u6709\u6587\u4ef6\u3002<\/p>\n<h3>\u4ece\u5907\u4efd\u4e2d\u6062\u590d VM\u3002<\/h3>\n<p>\u5220\u9664\u4e0b\u5217\u6587\u4ef6\u5939\uff0c\u7136\u540e\u4ece\u5907\u4efd\u4e2d\u590d\u5236\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u5404 VM \u306e\u30d5\u30a9\u30eb\u30c0\u30fc (~\/VirtualBox VMs\/____)<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">Vagrant \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e .vagrant \u30d5\u30a9\u30eb\u30c0\u30fc<\/ul>\n<p>\u5982\u679c VirtualBox \u7ba1\u7406\u5668\u4e2d\u6ca1\u6709\u663e\u793a\u865a\u62df\u673a\uff0c\u5e94\u8be5\u5728 VirtualBox \u7ba1\u7406\u5668 &gt;&gt; \u865a\u62df\u673a &gt;&gt; \u6dfb\u52a0 \u4e2d\u8fdb\u884c\u6062\u590d\u3002<\/p>\n<h2>\u542f\u52a8\u6b65\u9aa4<\/h2>\n<h3>\u6253\u5f00\u63a7\u5236\u8282\u70b9\u7684\u7535\u6e90<\/h3>\n<p>\u7528 Visual Studio Code \u6253\u5f00\u4e3b\u673a\u64cd\u4f5c\u7cfb\u7edf\u4e2d Vagrant \u9879\u76ee\u7684\u6587\u4ef6\u5939\uff0c\u7136\u540e\u5728\u7ec8\u7aef (bash) \u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">control_only<\/span><span class=\"o\">=<\/span>1  vagrant up\r\n<\/code><\/pre>\n<p>\u53ea\u901a\u8fc7\u8bbe\u5b9a control_only=1 \u7684\u73af\u5883\u53d8\u91cf\uff0c\u53ef\u4ee5\u4ece Vagrant \u542f\u52a8\u63a7\u5236\u8282\u70b9 (@control)\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">control_only=1 \u306f\u3001\u3053\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e Vagrantfile \u304c\u5b9a\u7fa9\u3057\u305f\u56fa\u6709\u306e\u8a2d\u5b9a\u3067\u3059<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb \u30ce\u30fc\u30c9 \u3060\u3051\u3092\u5bfe\u8c61\u306b\u3059\u308b\u3053\u3068\u3067\u3001<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb \u30ce\u30fc\u30c9 \u306e\u8d77\u52d5\u306e\u5b8c\u4e86\u3092\u5f85\u305f\u305a\u306b\u3001\u30de\u30cd\u30fc\u30b8\u30c9 \u30ce\u30fc\u30c9\u306e\u8d77\u52d5\u3092\u59cb\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\u5148\u306b VirtualBox \u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u304b\u3089\u8d77\u52d5\u3057\u305f VM \u306f\u5171\u6709\u30d5\u30a9\u30eb\u30c0\u30fc\u304c\u4f7f\u3048\u306a\u304f\u306a\u308a\u307e\u3059<\/ul>\n<h3>\u6253\u5f00\u6258\u7ba1\u8282\u70b9\u7684\u7535\u6e90<\/h3>\n<p>\u6253\u5f00VirtualBox\u7ba1\u7406\u5668\uff0c\u53f3\u952e\u5355\u51fbVM (@node1)\uff0c\u7136\u540e\u9009\u62e9\u542f\u52a8 &gt;&gt; \u65e0\u754c\u9762\u542f\u52a8\u3002<\/p>\n<p>\u5982\u679c\u5b58\u5728\u591a\u4e2a\u53d7\u7ba1\u8282\u70b9\uff0c\u53ef\u4ee5\u540c\u65f6\u6309\u4f4f Ctrl \u952e\u9009\u62e9\u591a\u4e2a\u865a\u62df\u673a\u8fdb\u884c\u542f\u52a8\u3002<\/p>\n<h2>\u8c03\u8bd5\u6b65\u9aa4<\/h2>\n<p>\u901a\u8fc7\u4ec5\u8fd0\u884c\u51fa\u73b0\u95ee\u9898\u7684\u4e00\u4e2a\u4efb\u52a1\uff0c\u53ef\u4ee5\u9ad8\u6548\u5730\u8fdb\u884c Ansible \u6267\u884c\u7684 Playbook \u7684\u8c03\u8bd5\u3002<\/p>\n<p>\u53ea\u9700\u8981\u6267\u884c\u4e00\u4e2a\u4efb\u52a1\u65f6\uff0c\u9700\u8981\u901a\u8fc7SSH\u767b\u5f55\u5230\u63a7\u5236\u8282\u70b9\u3002<\/p>\n<h3>\u6211\u4f1a\u6253\u5f00 Visual Studio Code \u4e2d\u7684\u63a7\u5236\u8282\u70b9\u3002<\/h3>\n<p>\u5f53\u4f7f\u7528Visual Studio Code\u6253\u5f00\uff08\u767b\u5f55\uff09\u8fdc\u7a0b\u6587\u4ef6\u5939\u65f6\uff0c\u53ef\u4ee5\u50cf\u4e0e\u975e\u8fdc\u7a0b\u6587\u4ef6\u5939\u4e00\u6837\uff0c\u4ece\u6700\u8fd1\u6253\u5f00\u7684\u6587\u4ef6\u5939\u4e2d\u9009\u62e9\u6765\u6253\u5f00\u3002<br \/>\n\u4ee5\u4e0b\u662f\u51e0\u79cd\u53ef\u9009\u7684\u65b9\u6cd5\uff1a<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">Windows \u306e\u30bf\u30b9\u30af\u30d0\u30fc\u306e VSCode \u3092\u53f3\u30af\u30ea\u30c3\u30af &gt;&gt; Folder [SSH:Server]<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\u4efb\u610f\u306e Visual Studio Code &gt;&gt; File &gt;&gt; Open Recent &gt;&gt; Folder [SSH:Server]<\/ul>\n<p>\u5c31\u50cf\u7b2c\u4e00\u6b21\u6253\u5f00\u8fdc\u7a0b\u6587\u4ef6\u5939\u90a3\u6837\uff0c\u4f60\u4e5f\u53ef\u4ee5\u4ece\u201cRemote Development\u201d\u89c6\u56fe\u4e2d\u6253\u5f00\u3002<\/p>\n<p>\u4f7f\u7528 Visual Studio Code \u767b\u5f55\u540e\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7 Visual Studio Code \u7684\u6587\u672c\u7f16\u8f91\u5668\u7f16\u8f91\u8fdc\u7a0b\u6587\u4ef6\u3002<\/p>\n<h3>\u53ea\u6267\u884c\u4e00\u4e2aAnsible\u4efb\u52a1\u3002<\/h3>\n<p>\u767b\u5f55\u63a7\u5236\u8282\u70b9\u540e\uff0c\u5c06\u7528\u4e8eAnsible\u7684\u6e05\u5355\u6587\u4ef6\u8def\u5f84\u8bbe\u7f6e\u4e3aANSIBLE_INVENTORY\u73af\u5883\u53d8\u91cf\u3002<\/p>\n<pre class=\"post-pre\"><code>export ANSIBLE_INVENTORY=\"\/tmp\/vagrant-ansible\/inventory\/vagrant_ansible_local_inventory\"\r\n<\/code><\/pre>\n<p>\u7531\u4e8e\u4f7f\u7528Vagrant\u7684Ansible Local\u914d\u7f6e\u7ba1\u7406\u5668\uff0c<br \/>\nAnsible\u7684\u6e05\u5355\u6587\u4ef6\u5c06\u81ea\u52a8\u5728\u865a\u62df\u673a\u5185\u90e8\u521b\u5efa\u3002<br \/>\n\u5f53\u4f7f\u7528Ansible\u5bf9\u7528\u4e8e\u751f\u4ea7\u7684\u7269\u7406\u670d\u52a1\u5668\u8fdb\u884c\u914d\u7f6e\u65f6\uff0c<br \/>\n\u9700\u8981\u5355\u72ec\u51c6\u5907\u6e05\u5355\u6587\u4ef6\u3002<\/p>\n<p>\u8981\u5355\u72ec\u8fd0\u884cAnsible\u7684\u4e00\u4e2a\u4efb\u52a1\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u3002\u4f46\u8bf7\u7f16\u8f91\u8981\u6267\u884c\u7684\u4efb\u52a1\u540d\u79f0\u3002 &#8220;\u5236\u4f5c\u540d\u7247&#8221;\u662f\u5728playbook.yml\u4e2d\u6307\u5b9a\u7684\u4efb\u52a1\u540d\u79f0\u3002<\/p>\n<pre class=\"post-pre\"><code>ansible-playbook  playbook.yml  --diff  -v  --step  --start-at-task \"make visiting card\"\r\n<\/code><\/pre>\n<p>\u4ee5\u4e0b\u7684\u5e38\u7528\u9009\u9879\u672a\u5728\u4e0a\u6587\u63d0\u53ca\uff1a<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">&#8211;check: \u30c1\u30a7\u30c3\u30af\u3060\u3051\u884c\u3044\u3001\u30bf\u30b9\u30af\u306e\u5b9f\u884c\u306f\u884c\u307e\u305b\u3093 (dry run)\u3002\u672c\u756a\u3067\u306f\u5fc5\u305a\u884c\u3063\u3066\u304f\u3060\u3055\u3044<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">&#8211;limit &#8220;HostName&#8221;: \u5bfe\u8c61\u306e\u30b5\u30fc\u30d0\u30fc\u3092\u6307\u5b9a\u307e\u305f\u306f\u5236\u9650\u3057\u307e\u3059<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">-vvv: \u6700\u3082\u8a73\u7d30\u306b\u72b6\u6cc1\u3092\u8868\u793a\u3057\u307e\u3059\u3002-v \u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u4ee3\u308f\u308a\u306b\u6307\u5b9a\u3057\u307e\u3059<\/ul>\n<p>\u56e0\u4e3a\u6307\u5b9a\u4e86&#8211;step\u9009\u9879\uff0c\u6240\u4ee5\u5728\u6536\u96c6\u670d\u52a1\u5668\u4fe1\u606f\u4e4b\u524d\u548c\u6267\u884c\u4efb\u52a1\u4e4b\u524d\u4f1a\u88ab\u8be2\u95ee\u662f\u5426\u8981\u6267\u884c\u5b83\u3002<br \/>\n\u7531\u4e8e\u6bcf\u6b21\u90fd\u8981\u8fdb\u884c\u670d\u52a1\u5668\u4fe1\u606f\u6536\u96c6\uff0c\u6240\u4ee5\u5f53\u53ea\u6267\u884c\u4e00\u4e2a\u4efb\u52a1\u65f6\uff0c\u9700\u8981\u8f93\u5165y\u4e24\u6b21\u3002<br \/>\n\u7136\u540e\u4f1a\u88ab\u8be2\u95ee\u662f\u5426\u8981\u7ee7\u7eed\u6267\u884c\u4e0b\u4e00\u4e2a\u4efb\u52a1\uff0c\u8fd9\u65f6\u6309\u4e0bCtrl + C\u952e\u6765\u7ed3\u675f\u3002<br \/>\n\u5f53\u6267\u884c\u5b8c\u6700\u540e\u4e00\u4e2a\u4efb\u52a1\u65f6\uff0c\u4e0d\u9700\u8981\u6309\u4e0bCtrl + C\u952e\u3002<\/p>\n<p>\u6267\u884c\u60c5\u51b5<\/p>\n<pre class=\"post-pre\"><code>$ ansible-playbook  playbook.yml  --diff  -v  --step  --start-at-task \"make visiting card\"\r\nUsing \/etc\/ansible\/ansible.cfg as config file\r\n\r\nPLAY [node1] ****************************************************************************\r\nPerform task: TASK: Gathering Facts (N)o\/(y)es\/(c)ontinue: y\r\n\r\nPerform task: TASK: Gathering Facts (N)o\/(y)es\/(c)ontinue: ******************************\r\n\r\nTASK [Gathering Facts] ******************************************************************\r\nok: [node1]\r\nPerform task: TASK: make visiting card (N)o\/(y)es\/(c)ontinue: y\r\n\r\nPerform task: TASK: make visiting card (N)o\/(y)es\/(c)ontinue: ***************************\r\n\r\nTASK [make visiting card] ***************************************************************\r\n--- before\r\n+++ after\r\n@@ -1,6 +1,6 @@\r\n {\r\n-    \"atime\": 1630211959.231837,\r\n-    \"mtime\": 1630211959.231837,\r\n+    \"atime\": 1630214387.011351,\r\n+    \"mtime\": 1630214387.011351,\r\n     \"path\": \"tmp_visiting_card\",\r\n-    \"state\": \"file\"\r\n+    \"state\": \"touch\"\r\n }\r\n\r\nchanged: [node1] =&gt; {\"changed\": true, \"dest\": \"tmp_visiting_card\", \"gid\": 1000, \"group\": \"vagrant\", \"mode\": \"0664\", \"owner\": \"vagrant\", \"secontext\": \"unconfined_u:object_r:user_home_t:s0\", \"size\": 0, \"state\": \"file\", \"uid\": 1000}\r\n\r\nPLAY RECAP ******************************************************************************\r\nnode1                      : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   \r\n<\/code><\/pre>\n<h2>\u589e\u52a0\u6258\u7ba1\u8282\u70b9\u7684\u65f6\u5019<\/h2>\n<p>\u53ea\u9700\u8fdb\u884c\u4e00\u6b21\u6027\u64cd\u4f5c\uff0c\u5c06 Vagrantfile \u4e2d\u7684 Managed node \u90e8\u5206\u590d\u5236\u7c98\u8d34\u5e76\u8c03\u6574 IP \u5730\u5740\u548c\u7aef\u53e3\u53f7\uff0c\u7136\u540e\u6267\u884c vagrant up\uff0c\u5c31\u53ef\u4ee5\u589e\u52a0\u670d\u52a1\u5668\uff08\u5373\u8282\u70b9\uff09\u3002\u7531\u4e8e Vagrant \u5177\u6709\u5e42\u7b49\u6027\uff0c\u4ec5\u4f1a\u521b\u5efa\u65b0\u589e\u7684\u8282\u70b9\u3002<\/p>\n<p>\u540c\u6837\u8fdb\u884c\u4ece\u4e3b\u673a\u64cd\u4f5c\u7cfb\u7edf\u5230\u6258\u7ba1\u8282\u70b9\u7684SSH\u8fde\u63a5\u4ee5\u53ca\u4ece\u63a7\u5236\u8282\u70b9\u5230\u6258\u7ba1\u8282\u70b9\u7684SSH\u8fde\u63a5\u7684\u914d\u7f6e\u3002<\/p>\n<h2>\u5f15\u5165\u6548\u679c<\/h2>\n<p>\u5f53\u4f60\u5f00\u59cb\u4f7f\u7528Ansible\u540e\uff0c\u4f60\u5c06\u53ea\u5728\u7b2c\u4e00\u6b21\u5b89\u88c5\u8f6f\u4ef6\u65f6\u9047\u5230\u56f0\u96be\uff0c\u800c\u4e14\u4e0d\u4f1a\u5bf9\u5c06Linux\u6062\u590d\u5230\u521d\u59cb\u72b6\u6001\u8868\u793a\u62b5\u6297\u3002<br \/>\n\u5f53\u591a\u4e2a\u8f6f\u4ef6\u88ab\u5b89\u88c5\u65f6\uff0c\u6211\u4eec\u4f1a\u5bf9\u8bb8\u591a\u8f6f\u4ef6\u7684\u8fd0\u884c\u4ea7\u751f\u7591\u95ee\uff0c\u4f46\u4f60\u5c06\u4ece\u8fd9\u6837\u7684\u4e0d\u5b89\u8981\u7d20\u4e2d\u5f97\u5230\u89e3\u653e\u3002<br \/>\n\u6b64\u5916\uff0c\u4e0d\u9700\u8981\u4e3a\u65b0\u6765\u7684\u4eba\u5b89\u88c5\u5f00\u53d1\u73af\u5883\u63d0\u4f9b\u6587\u6863\uff0c\u642d\u5efa\u73af\u5883\u6240\u9700\u7684\u65f6\u95f4\u4e5f\u5c06\u5927\u5927\u7f29\u77ed\u3002<\/p>\n<h2>\uff08\u9644\u5f55\uff09\u901a\u8fc7\u7ed3\u6784\u5316\u6587\u6863\u7684\u64cd\u4f5c\u624b\u518c.<\/h2>\n<p>\u4ee5\u4e0b\u662f\u5728 Windows \u4e0a\u5b89\u88c5\u5177\u6709 Ansible \u7684 VM \u7684\u6b65\u9aa4\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"na\">VirtualBox \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n    <span class=\"pi\">-<\/span> <span class=\"s\">https:\/\/www.virtualbox.org\/ &gt;&gt; Download VirtualBox X.X &gt;&gt; Windows hosts<\/span>\r\n    <span class=\"pi\">-<\/span> <span class=\"s\">\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u30d5\u30a1\u30a4\u30eb\uff08\u4f8b\uff1aVirtualBox-6.1.22-144080-Win.exe\uff09\u3092\u958b\u304d\u307e\u3059<\/span>\r\n    <span class=\"pi\">-<\/span> <span class=\"s\">\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3092\u4f7f\u7528<\/span>\r\n    <span class=\"pi\">-<\/span> <span class=\"s\">\u30c9\u30e9\u30a4\u30d0\u30fc\u306f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059<\/span>\r\n<span class=\"na\">Vagrant \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n    <span class=\"pi\">-<\/span> <span class=\"s\">https:\/\/www.vagrantup.com\/downloads.html &gt;&gt; Windows\uff08\u30bf\u30d6\uff09&gt;&gt; 64-bit<\/span>\r\n    <span class=\"pi\">-<\/span> <span class=\"s\">\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u30d5\u30a1\u30a4\u30eb\uff08\u4f8b\uff1avagrant_2.2.16_x86_64.msi\uff09\u3092\u958b\u304d\u307e\u3059<\/span>\r\n    <span class=\"pi\">-<\/span> <span class=\"s\">\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3092\u4f7f\u7528<\/span>\r\n    <span class=\"pi\">-<\/span> <span class=\"s\">PC \u3092\u518d\u8d77\u52d5\u3057\u307e\u3059<\/span>\r\n<span class=\"na\">Git for Windows \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n    <span class=\"pi\">-<\/span> <span class=\"s\">https:\/\/git-scm.com\/ &gt;&gt; Download for Windows\uff08\u53f3\u4e0b\uff09<\/span>\r\n    <span class=\"pi\">-<\/span> <span class=\"s\">\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u30d5\u30a1\u30a4\u30eb\uff08\u4f8b\uff1aGit-2.33.0.2-64-bit.exe\uff09\u3092\u958b\u304f<\/span>\r\n    <span class=\"pi\">-<\/span> <span class=\"s\">Next \u30929\u56de\u62bc\u3059<\/span>\r\n    <span class=\"pi\">-<\/span> <span class=\"na\">Configuring the line ending conversions<\/span><span class=\"pi\">:<\/span> <span class=\"s\">Checkout as-is, commit as-is<\/span>\r\n    <span class=\"pi\">-<\/span> <span class=\"s\">\u4ed6\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3092\u4f7f\u7528<\/span>\r\n<span class=\"na\">Visual Studio Code \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n    <span class=\"pi\">-<\/span> <span class=\"s\">https:\/\/code.visualstudio.com\/<\/span>\r\n    <span class=\"pi\">-<\/span> <span class=\"s\">\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u30d5\u30a1\u30a4\u30eb\uff08\u4f8b\uff1aVSCodeUserSetup-x64-1.50.1.exe\uff09\u3092\u958b\u304d\u307e\u3059<\/span>\r\n    <span class=\"pi\">-<\/span> <span class=\"s\">\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3092\u4f7f\u7528<\/span>\r\n    <span class=\"pi\">-<\/span> <span class=\"na\">Git bash \u30b7\u30a7\u30eb\u3092\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u958b\u304f\u3088\u3046\u306b\u3057\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n        <span class=\"s\">VSCode &gt;&gt; Terminal &gt;&gt; New Terminal &gt;&gt; \uff0b\u306e\u53f3\u306e\u2193\uff08\u30b7\u30a7\u30eb\u306e\u53f3\u4e0a\uff09&gt;&gt;<\/span>\r\n        <span class=\"s\">Select Default Profile &gt;&gt; Git bash &gt;&gt; \u30b4\u30df\u7bb1 \u30dc\u30bf\u30f3\uff08\u30b7\u30a7\u30eb\u306e\u53f3\u4e0a\uff09<\/span>\r\n    <span class=\"pi\">-<\/span> <span class=\"s\">\uff08\u63a8\u5968\uff09VSCode (Visual Studio Code \u3092\u30bf\u30b9\u30af\u30d0\u30fc\u306b\u30d4\u30f3\u6b62\u3081\u3057\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n    <span class=\"pi\">-<\/span> <span class=\"s\">\uff08\u63a8\u5968\uff09Ctrl + S \u30ad\u30fc\u3092\u62bc\u3057\u305f\u3068\u304d\u306b\u5168\u3066\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u307e\u3059<\/span><span class=\"pi\">:<\/span> <span class=\"pi\">|<\/span>\r\n        <span class=\"s\">VSCode &gt;&gt; File &gt;&gt; Preferences &gt;&gt; Keyboard Shortcuts &gt;&gt; save all \uff08\u3068\u5165\u529b\uff09 &gt;&gt;<\/span>\r\n            <span class=\"s\">File: Save All \uff08\u3092\u30c0\u30d6\u30eb\u30af\u30ea\u30c3\u30af\uff09 &gt;&gt; Ctrl + S \u30ad\u30fc &gt;&gt; Enter \u30ad\u30fc<\/span>\r\n<span class=\"na\">\u30db\u30b9\u30c8OS\u304c\u30d7\u30ed\u30ad\u30b7\u304c\u3042\u308bLAN\u306b\u3044\u308b\u3068\u304d<\/span><span class=\"pi\">:<\/span>\r\n    <span class=\"na\">Git bash \u306e\u74b0\u5883\u5909\u6570 http_proxy \u306a\u3069\u306b\u30d7\u30ed\u30ad\u30b7\u306e\u30a2\u30c9\u30ec\u30b9\u3092\u8a2d\u5b9a\u3057\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n        <span class=\"c1\">#\/\/ \u4e0b\u8a18\u3067\u5b9a\u7fa9\u3059\u308b\u74b0\u5883\u5909\u6570\u540d\u306f Linux \u3067\u3088\u304f\u4f7f\u308f\u308c\u307e\u3059<\/span>\r\n        <span class=\"c1\">#\/\/ http:\/\/__ProxyDomain__:__ProxyPortNum__ \u306e\u4f8b\uff1a http:\/\/10.100.100.100:8080<\/span>\r\n        <span class=\"s\">(@host) bash<\/span><span class=\"pi\">:<\/span>\r\n            <span class=\"pi\">-<\/span> <span class=\"s\">echo  ${http_proxy}<\/span>  <span class=\"c1\">#\/\/ \u8868\u793a\u3055\u308c\u305f\u3089\u4ee5\u964d\u306e\u624b\u9806\u306f\u4e0d\u8981\u3067\u3059<\/span>\r\n            <span class=\"pi\">-<\/span> <span class=\"s\">echo  \"export   http_proxy=\\\"http:\/\/__ProxyDomain__:__ProxyPortNum__\\\"\" &gt;&gt; ~\/.bashrc<\/span>\r\n            <span class=\"pi\">-<\/span> <span class=\"s\">echo  \"export  https_proxy=\\\"http:\/\/__ProxyDomain__:__ProxyPortNum__\\\"\" &gt;&gt; ~\/.bashrc<\/span>\r\n            <span class=\"pi\">-<\/span> <span class=\"s\">echo  \"export  no_proxy=\\\"localhost,127.0.0.1,control,node1\\\"\" &gt;&gt; ~\/.bashrc<\/span>\r\n        <span class=\"na\">bash \u3092\u958b\u304d\u306a\u304a\u3057\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n            <span class=\"na\">\u4e0b\u8a18\u306e\u8b66\u544a\u306f\u7121\u8996\u3067\u304d\u307e\u3059<\/span><span class=\"pi\">:<\/span> <span class=\"pi\">|<\/span>\r\n                <span class=\"s\">WARNING: Found ~\/.bashrc but no ~\/.bash_profile, ~\/.bash_login or ~\/.profile.<\/span>\r\n<span class=\"na\">vbguest \u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059<\/span><span class=\"pi\">:<\/span>  <span class=\"c1\">#\/\/ Ansible Local \u3068 Vagrant \u3092\u63a5\u7d9a\u3059\u308b\u30d7\u30e9\u30b0\u30a4\u30f3\u3067\u3059<\/span>\r\n    <span class=\"s\">(@host) Git bash<\/span><span class=\"pi\">:<\/span>  <span class=\"c1\">#\/\/ VSCode &gt;&gt; Terminal &gt;&gt; New Terminal<\/span>\r\n        <span class=\"pi\">-<\/span> <span class=\"s\">vagrant plugin install vagrant-vbguest<\/span>\r\n<span class=\"na\">\u30d7\u30ed\u30b8\u30a7\u30af\u30c8 \u30d5\u30a9\u30eb\u30c0\u30fc\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n    <span class=\"s\">(@host) Git bash<\/span><span class=\"pi\">:<\/span>\r\n        <span class=\"pi\">-<\/span> <span class=\"s\">cd ~\/Desktop<\/span>\r\n        <span class=\"pi\">-<\/span> <span class=\"s\">git clone https:\/\/github.com\/Takakiriy\/multi_vm_ansible.git<\/span>\r\n<span class=\"na\">Visual Studio Code \u3067 \u30d7\u30ed\u30b8\u30a7\u30af\u30c8 \u30d5\u30a9\u30eb\u30c0\u30fc\u3092\u958b\u304d\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n    <span class=\"s\">(@host) Git bash<\/span><span class=\"pi\">:<\/span>\r\n        <span class=\"pi\">-<\/span> <span class=\"s\">code ~\/Desktop\/multi_vm_ansible<\/span>\r\n    <span class=\"c1\">#\/\/ VSCode \u5185\u3067\u4e0a\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3057\u305f\u3089\u3001\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3057\u305f VSCode \u3092\u9589\u3058\u307e\u3059<\/span>\r\n<span class=\"na\">Git bash \u30b7\u30a7\u30eb\u3092\u958b\u304d\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n    <span class=\"s\">(@host) VSCode &gt;&gt; Terminal &gt;&gt; New Terminal<\/span>\r\n<span class=\"na\">\u4eee\u60f3\u30de\u30b7\u30f3\u3092\u4f5c\u3063\u3066\u8d77\u52d5\u3057\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n    <span class=\"s\">(@host) Git bash<\/span><span class=\"pi\">:<\/span>\r\n        <span class=\"pi\">-<\/span> <span class=\"s\">cd  __Project__<\/span>  <span class=\"c1\">#\/\/ \u4e0d\u8981\u306e\u5834\u5408\u3042\u308a\u3002\u4ee5\u5f8c\u3082\u540c\u69d8<\/span>\r\n        <span class=\"pi\">-<\/span> <span class=\"s\">vagrant up<\/span>  <span class=\"c1\">#\/\/ \u521d\u56de\u306f\u7d04 10\u5206\u3002\u5185\u90e8\u3067 Ansible Local \u306b\u3088\u308b Playbook \u3082\u52d5\u304d\u307e\u3059<\/span>\r\n            <span class=\"c1\">#\/\/ Vagrant \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u304c\u3042\u308b\u30d5\u30a9\u30eb\u30c0\u30fc\u306f\u3001VM \u306e \/vagrant\/ \u30d5\u30a9\u30eb\u30c0\u30fc\u3068\u5171\u6709\u3057\u307e\u3059\u3002<\/span>\r\n<span class=\"s\">SSH \u3067\u4eee\u60f3\u30de\u30b7\u30f3\u306b\u30ed\u30b0\u30a4\u30f3\u3067\u304d\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u307e\u3059\uff08VSCode\u7528\uff09<\/span><span class=\"pi\">:<\/span>\r\n    <span class=\"na\">VSCode \u306e Remote Development \u62e1\u5f35\u6a5f\u80fd\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n        <span class=\"na\">\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n            <span class=\"s\">(@host) VSCode &gt;&gt; \u62e1\u5f35\u6a5f\u80fd \u30dc\u30bf\u30f3\uff08\u5de6\uff09 &gt;&gt; Remote Development<\/span>\r\n        <span class=\"na\">SSH Targets \u3092\u8868\u793a\u3057\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n            <span class=\"na\">\u30e1\u30cb\u30e5\u30fc<\/span><span class=\"pi\">:<\/span> <span class=\"s\">(@host) VSCode &gt;&gt; Remote Explorer\uff08\u30a2\u30a4\u30b3\u30f3\uff1a\u5de6\uff09<\/span>\r\n            <span class=\"s\">REMOTE EXPLORER\uff08\u4e0a\uff09<\/span><span class=\"pi\">:<\/span> <span class=\"s\">SSH Targets<\/span>\r\n    <span class=\"na\">SSH \u306e\u8a2d\u5b9a\u3092 VSCode \u306b\u8ffd\u52a0\u3057\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n        <span class=\"s\">(@host) VSCode Git bash<\/span><span class=\"pi\">:<\/span>\r\n            <span class=\"pi\">-<\/span> <span class=\"s\">vagrant ssh-config<\/span>  <span class=\"c1\">#\/\/ SSH \u306e\u63a5\u7d9a\u306b\u5fc5\u8981\u306a\u8a2d\u5b9a\u304c\u8868\u793a\u3055\u308c\u307e\u3059<\/span>\r\n            <span class=\"pi\">-<\/span> <span class=\"s\">code ~\/.ssh\/config<\/span>  <span class=\"c1\">#\/\/ vagrant ssh-config \u306e\u51fa\u529b\u3092\u6700\u5f8c\u306b\u8cbc\u308a\u4ed8\u3051\u307e\u3059<\/span>\r\n    <span class=\"na\">Visual Studio Code \u3067 SSH \u63a5\u7d9a\u3057\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n        <span class=\"s\">vagrant \/ \u30d5\u30a9\u30eb\u30c0\u30fc\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3057\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n            <span class=\"s\">(@host) VSCode &gt;&gt; Remote Explorer\uff08\u5de6\u306e\u30a2\u30a4\u30b3\u30f3\uff09&gt;&gt; control &gt;&gt; vagrant \/<\/span>\r\n        <span class=\"s\">vagrant \/ \u30d5\u30a9\u30eb\u30c0\u30fc\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408<\/span><span class=\"pi\">:<\/span>\r\n            <span class=\"na\">SSH \u63a5\u7d9a\u3057\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n                <span class=\"s\">control\uff08\u306e\u53f3\u306e\u30d5\u30a9\u30eb\u30c0\u30fc\uff09\u30dc\u30bf\u30f3<\/span>\r\n            <span class=\"s\">(@control) platform<\/span><span class=\"pi\">:<\/span> <span class=\"s\">Linux<\/span>\r\n                <span class=\"s\">#\/\/ \u63a5\u7d9a\u3067\u304d\u306a\u3044\u6642\u306f\u3001vagrant ssh-config \u3092\u518d\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044<\/span>\r\n            <span class=\"na\">SSH \u63a5\u7d9a\u3057\u305f Visual Studio Code \u3067\u30d5\u30a9\u30eb\u30c0\u30fc\u3092\u958b\u304d\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n                <span class=\"s\">(@control) VSCode &gt;&gt; File &gt;&gt; Open Folder ... &gt;&gt; \/vagrant\/<\/span>\r\n        <span class=\"s\">vagrant \/ \u30d5\u30a9\u30eb\u30c0\u30fc\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u5834\u5408<\/span><span class=\"pi\">:<\/span>\r\n            <span class=\"s\">(@host) vagrant \/ \u30d5\u30a9\u30eb\u30c0\u30fc\uff08\u306e\u53f3\u306e\u30d5\u30a9\u30eb\u30c0\u30fc\uff09\u30dc\u30bf\u30f3<\/span>\r\n        <span class=\"na\">\u30b7\u30a7\u30eb\u3092\u958b\u3051\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n            <span class=\"s\">(@control) VSCode &gt;&gt; Terminal &gt;&gt; New Terminal<\/span>\r\n                <span class=\"s\">#\/\/ [vagrant@localhost vagrant]$ \u3068\u8868\u793a\u3055\u308c\u307e\u3059<\/span>\r\n                <span class=\"s\">#\/\/ \u6b21\u56de\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u958b\u3044\u305f\u3068\u304d\u306b\u30b7\u30a7\u30eb\u304c\u958b\u3044\u305f\u72b6\u614b\u306b\u306a\u308a\u307e\u3059<\/span>\r\n        <span class=\"na\">\u958b\u3051\u305f\u3089 Visual Studio Code \u3092\u9589\u3058\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n        <span class=\"na\">Remote Explorer \u3067\u958b\u3044\u305f\u30d5\u30a9\u30eb\u30c0\u30fc\u3092\u8868\u793a\u3055\u305b\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n            <span class=\"s\">(@host) VSCode &gt;&gt; Remote Explorer\uff08\u5de6\u306e\u30a2\u30a4\u30b3\u30f3\uff09&gt;&gt; Reflesh \u30dc\u30bf\u30f3\uff08\u53f3\u4e0a\uff09<\/span>\r\n        <span class=\"na\">\u6b21\u56de\u304b\u3089\u30ed\u30b0\u30a4\u30f3\u3059\u308b\u3068\u304d\u306e\u64cd\u4f5c<\/span><span class=\"pi\">:<\/span>\r\n            <span class=\"pi\">-<\/span> <span class=\"s\">(@host) \u30bf\u30b9\u30af\u30d0\u30fc\u306e VSCode \u3092\u53f3\u30af\u30ea\u30c3\u30af &gt;&gt; __Folder__ [SSH:__Server__]<\/span>  <span class=\"c1\">#\/\/ \u307e\u305f\u306f<\/span>\r\n            <span class=\"pi\">-<\/span> <span class=\"s\">(@host) VSCode &gt;&gt; File &gt;&gt; Open Recent &gt;&gt; __Folder__ [SSH:__Server__]<\/span>  <span class=\"c1\">#\/\/ \u307e\u305f\u306f<\/span>\r\n            <span class=\"pi\">-<\/span> <span class=\"s\">(@host) VSCode &gt;&gt; Remote Explorer \u30dc\u30bf\u30f3\uff08\u5de6\uff09&gt;&gt; REMOTE EXPLORER= SSH Targets &gt;&gt; __Server__ &gt;&gt; __Folder__<\/span>\r\n        <span class=\"s\">\u4ee5\u4e0a\u3092 @node1 \u306b\u3064\u3044\u3066\u3082\u884c\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n<span class=\"na\">ansible_local \u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305f VM \u304b\u3089\u4ed6\u306e VM \u306b SSH \u63a5\u7d9a\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n    <span class=\"s\">(@host) Git bash<\/span><span class=\"pi\">:<\/span>\r\n        <span class=\"s\">.\/upload_SSH_keys.sh<\/span>\r\n<span class=\"na\">SSH \u7d4c\u7531\u3067 Ansible playbook \u3092\u5b9f\u884c\u3057\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n    <span class=\"s\">(@host) Git bash<\/span><span class=\"pi\">:<\/span>\r\n        <span class=\"s\">.\/run_playbook.sh<\/span>\r\n<span class=\"na\">\u4f5c\u6210\u3057\u305f\u3059\u3079\u3066\u306e VM \u306e\u96fb\u6e90\u3092\u5207\u308a\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n    <span class=\"s\">VirtualBox \u30de\u30cd\u30fc\u30b8\u30e3\u30fc &gt;&gt; __ProjectFolderName___control____ \u306a\u3069\u3092\u9078\u629e\u3057\u3066\u53f3\u30af\u30ea\u30c3\u30af &gt;&gt;<\/span>\r\n        <span class=\"s\">\u9589\u3058\u308b &gt;&gt; \u96fb\u6e90\u30aa\u30d5<\/span>\r\n<span class=\"s\">\uff08\u5fc5\u8981\u306a\u3089\uff09.vagrant \u30d5\u30a9\u30eb\u30c0\u30fc\u3068 VM \u306e\u30d5\u30a9\u30eb\u30c0\u30fc\u3092\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3057\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n    <span class=\"na\">VM \u306e\u30d5\u30a9\u30eb\u30c0\u30fc<\/span><span class=\"pi\">:<\/span>\r\n    <span class=\"s\">.vagrant \u30d5\u30a9\u30eb\u30c0\u30fc<\/span><span class=\"pi\">:<\/span>  <span class=\"c1\">#\/\/ VM \u306e\u60c5\u5831\u3092\u6301\u3063\u3066\u3044\u307e\u3059<\/span>\r\n<span class=\"na\">VM \u306e\u96fb\u6e90\u3092\u5165\u308c\u307e\u3059<\/span><span class=\"pi\">:<\/span>  <span class=\"c1\">#\/\/ VM \u306e\u96fb\u6e90\u3092\u5165\u308c\u3066\u30db\u30b9\u30c8OS \u3068 SSH \u63a5\u7d9a\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059<\/span>\r\n    <span class=\"c1\">#\/\/ \u73fe\u5728\u306e VM \u304c\u96fb\u6e90\u30aa\u30d5\u306e\u72b6\u614b\u3067\u3082\u4e2d\u65ad\u306e\u72b6\u614b\uff08\u30db\u30b9\u30c8OS\u3092\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u3057\u305f\u5f8c\u306e\u72b6\u614b\uff09\u3067\u3082\u540c\u3058\u624b\u9806\u3067\u3059<\/span>\r\n    <span class=\"na\">VSCode \u3067\u30db\u30b9\u30c8OS \u306e Vagrant \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u958b\u304d\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n        <span class=\"s\">\u30bf\u30b9\u30af\u30d0\u30fc\u306e VSCode \u3092\u53f3\u30af\u30ea\u30c3\u30af &gt;&gt; __Project__<\/span>\r\n    <span class=\"na\">VirtualBox \u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u306b VM \u304c\u8868\u793a\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408<\/span><span class=\"pi\">:<\/span>\r\n        <span class=\"s\">VirtualBox \u30de\u30cd\u30fc\u30b8\u30e3\u30fc &gt;&gt; \u4eee\u60f3\u30de\u30b7\u30f3 &gt;&gt; \u8ffd\u52a0<\/span>\r\n    <span class=\"na\">vagrant \u3092\u8d77\u52d5\u3057\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n        <span class=\"s\">(@host) Git bash<\/span><span class=\"pi\">:<\/span>\r\n            <span class=\"s\">control_only=1  vagrant up<\/span>\r\n        <span class=\"c1\">#\/\/ \u4e0b\u8a18\u306e\u30b5\u30fc\u30d0\u30fc\u3082\u540c\u6642\u306b\u8d77\u52d5\u3067\u304d\u307e\u3059:<\/span>\r\n        <span class=\"c1\">#\/\/ control_only=1 \u306f\u3001\u3053\u306e Vagrantfile \u56fa\u6709\u306e\u8a2d\u5b9a\u3067\u3059<\/span>\r\n        <span class=\"c1\">#\/\/ \u5148\u306b VirtualBox \u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u3067\u8d77\u52d5\u3057\u305f VM \u306f\u5171\u6709\u30d5\u30a9\u30eb\u30c0\u30fc\u304c\u4f7f\u3048\u307e\u305b\u3093<\/span>\r\n        <span class=\"c1\">#\/\/ control \u30b5\u30fc\u30d0\u30fc\u4ee5\u5916\u306f vagrant up \u3067\u306f\u8d77\u52d5\u3057\u307e\u305b\u3093\u3002\u5f8c\u3067\u4e26\u5217\u8d77\u52d5\u3057\u3066\u65e9\u304f\u3059\u308b\u305f\u3081\u3067\u3059<\/span>\r\n    <span class=\"na\">control \u30b5\u30fc\u30d0\u30fc\u4ee5\u5916\u3092 VirtualBox \u304b\u3089\u8d77\u52d5\u3057\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n        <span class=\"s\">VirtualBox \u30de\u30cd\u30fc\u30b8\u30e3\u30fc &gt;&gt; __ProjectFolderName___node1____ \u306a\u3069\u3092\u307e\u3068\u3081\u3066\u9078\u629e\u3057\u3066\u53f3\u30af\u30ea\u30c3\u30af &gt;&gt;<\/span>\r\n            <span class=\"s\">\u8d77\u52d5 &gt;&gt; \u30d8\u30c3\u30c9\u30ec\u30b9\u8d77\u52d5<\/span>\r\n<span class=\"na\">\uff11\u3064\u306e\u30bf\u30b9\u30af\u3060\u3051\u5b9f\u884c\u3057\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n    <span class=\"s\">--step \u30aa\u30d7\u30b7\u30e7\u30f3\u3068 --start-at-task \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u3044\u307e\u3059<\/span><span class=\"pi\">:<\/span>\r\n        <span class=\"s\">(@control) bash<\/span><span class=\"pi\">:<\/span>\r\n            <span class=\"pi\">-<\/span> <span class=\"s\">export ANSIBLE_INVENTORY=\"\/tmp\/vagrant-ansible\/inventory\/vagrant_ansible_local_inventory\"<\/span>\r\n            <span class=\"pi\">-<\/span> <span class=\"s\">ansible-playbook  playbook.yml  --diff  -v  --step  --start-at-task \"__TaskName__\"<\/span>\r\n    <span class=\"na\">\u3088\u304f\u4f7f\u3046\u30aa\u30d7\u30b7\u30e7\u30f3<\/span><span class=\"pi\">:<\/span>\r\n        <span class=\"s\">--limit \"__HostName__\"<\/span><span class=\"pi\">:<\/span> <span class=\"s\">\u5bfe\u8c61\u306e\u30b5\u30fc\u30d0\u30fc\u3092\u6307\u5b9a\u307e\u305f\u306f\u5236\u9650\u3057\u307e\u3059<\/span>\r\n        <span class=\"s\">-vvv<\/span><span class=\"pi\">:<\/span> <span class=\"s\">\u6700\u3082\u8a73\u7d30\u306b\u72b6\u6cc1\u3092\u8868\u793a\u3057\u307e\u3059<\/span>\r\n        <span class=\"s\">--check<\/span><span class=\"pi\">:<\/span> <span class=\"s\">\u30c1\u30a7\u30c3\u30af\u3060\u3051\u884c\u3044\u3001\u30bf\u30b9\u30af\u306e\u5b9f\u884c\u306f\u884c\u307e\u305b\u3093 (dry run)<\/span>\r\n<\/code><\/pre>\n<h2>\u8bf7\u53c2\u8003\u4ee5\u4e0b\u7f51\u7ad9\u3002<\/h2>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">Ansible \u306e Vagrant \u30ac\u30a4\u30c9 https:\/\/docs.ansible.com\/ansible\/2.9_ja\/scenario_guides\/guide_vagrant.html<\/ul>\n<\/li>\n<\/ul>\n<p>Vagrant \u306e Amsible Local \u30d7\u30ed\u30d3\u30b8\u30e7\u30ca\u30fc https:\/\/www.vagrantup.com\/docs\/provisioning\/ansible_local<\/p>\n<p>Ansible Playbook \u306e\u4f5c\u308a\u65b9\uff08\u30b5\u30f3\u30d7\u30eb\u306e\u8868\u793a\u304c\u5d29\u308c\u3066\u3044\u307e\u3059\uff09 https:\/\/docs.ansible.com\/ansible\/2.9_ja\/user_guide\/playbooks.html<\/p>\n<p>Ansible Playbook \u306e\u4f5c\u308a\u65b9\uff08\u82f1\u8a9e\u7248\uff09 https:\/\/docs.ansible.com\/ansible\/2.9\/user_guide\/playbooks.html<\/p>\n<p>ansible-playbook \u30b3\u30de\u30f3\u30c9\u306e\u30aa\u30d7\u30b7\u30e7\u30f3 https:\/\/docs.ansible.com\/ansible\/2.9_ja\/cli\/ansible-playbook.html<\/p>\n<p>Ansible \u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30ab\u30bf\u30ed\u30b0 https:\/\/docs.ansible.com\/ansible\/2.9_ja\/modules\/modules_by_category.html<\/p>\n<p>\uff08\u7269\u7406\u30b5\u30fc\u30d0\u30fc\u306a\u3069\u3001Vagrant \u3092\u4f7f\u308f\u306a\u3044\uff09Ansible \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb https:\/\/docs.ansible.com\/ansible\/2.9_ja\/installation_guide\/intro_installation.html<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981 &#8211; \u7b80\u8981\u603b\u7ed3 Ansible \u662f\u4e00\u6b3e\u7528\u4e8e\u81ea\u52a8\u5316\u5728 Linux \u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u5404\u79cd\u8f6f\u4ef6\u548c\u6587\u4ef6\u7684\u8f6f [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-42974","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u81ea\u52a8\u5b89\u88c5 Ansible \u4e8e Windows - Blog - Silicon Cloud<\/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.silicloud.com\/zh\/blog\/\u81ea\u52a8\u5b89\u88c5-ansible-\u4e8e-windows\u3002\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u81ea\u52a8\u5b89\u88c5 Ansible \u4e8e Windows\" \/>\n<meta property=\"og:description\" content=\"\u6982\u8981 &#8211; \u7b80\u8981\u603b\u7ed3 Ansible \u662f\u4e00\u6b3e\u7528\u4e8e\u81ea\u52a8\u5316\u5728 Linux \u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u5404\u79cd\u8f6f\u4ef6\u548c\u6587\u4ef6\u7684\u8f6f [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u81ea\u52a8\u5b89\u88c5-ansible-\u4e8e-windows\u3002\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-10T00:23:53+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-30T13:28:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d4fe137434c4406cc48bd\/0-0.jpeg\" \/>\n<meta name=\"author\" content=\"\u9038, \u79d1\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u9038, \u79d1\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e8%87%aa%e5%8a%a8%e5%ae%89%e8%a3%85-ansible-%e4%ba%8e-windows%e3%80%82\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e8%87%aa%e5%8a%a8%e5%ae%89%e8%a3%85-ansible-%e4%ba%8e-windows%e3%80%82\/\",\"name\":\"\u81ea\u52a8\u5b89\u88c5 Ansible \u4e8e Windows - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-01-10T00:23:53+00:00\",\"dateModified\":\"2024-04-30T13:28:33+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/85c1dae56e6ea1e695c73d33c684d487\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e8%87%aa%e5%8a%a8%e5%ae%89%e8%a3%85-ansible-%e4%ba%8e-windows%e3%80%82\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e8%87%aa%e5%8a%a8%e5%ae%89%e8%a3%85-ansible-%e4%ba%8e-windows%e3%80%82\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e8%87%aa%e5%8a%a8%e5%ae%89%e8%a3%85-ansible-%e4%ba%8e-windows%e3%80%82\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u81ea\u52a8\u5b89\u88c5 Ansible \u4e8e Windows\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/85c1dae56e6ea1e695c73d33c684d487\",\"name\":\"\u9038, \u79d1\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c94f6d9cbbfbca863fab309840bd690c153c95f8490c290ad2ed54dd693dad16?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c94f6d9cbbfbca863fab309840bd690c153c95f8490c290ad2ed54dd693dad16?s=96&d=mm&r=g\",\"caption\":\"\u9038, \u79d1\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/keyi\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e8%87%aa%e5%8a%a8%e5%ae%89%e8%a3%85-ansible-%e4%ba%8e-windows%e3%80%82\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u81ea\u52a8\u5b89\u88c5 Ansible \u4e8e Windows - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u81ea\u52a8\u5b89\u88c5-ansible-\u4e8e-windows\u3002\/","og_locale":"zh_CN","og_type":"article","og_title":"\u81ea\u52a8\u5b89\u88c5 Ansible \u4e8e Windows","og_description":"\u6982\u8981 &#8211; \u7b80\u8981\u603b\u7ed3 Ansible \u662f\u4e00\u6b3e\u7528\u4e8e\u81ea\u52a8\u5316\u5728 Linux \u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u5404\u79cd\u8f6f\u4ef6\u548c\u6587\u4ef6\u7684\u8f6f [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u81ea\u52a8\u5b89\u88c5-ansible-\u4e8e-windows\u3002\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-01-10T00:23:53+00:00","article_modified_time":"2024-04-30T13:28:33+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d4fe137434c4406cc48bd\/0-0.jpeg"}],"author":"\u9038, \u79d1","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u9038, \u79d1","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"10 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e8%87%aa%e5%8a%a8%e5%ae%89%e8%a3%85-ansible-%e4%ba%8e-windows%e3%80%82\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e8%87%aa%e5%8a%a8%e5%ae%89%e8%a3%85-ansible-%e4%ba%8e-windows%e3%80%82\/","name":"\u81ea\u52a8\u5b89\u88c5 Ansible \u4e8e Windows - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-01-10T00:23:53+00:00","dateModified":"2024-04-30T13:28:33+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/85c1dae56e6ea1e695c73d33c684d487"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e8%87%aa%e5%8a%a8%e5%ae%89%e8%a3%85-ansible-%e4%ba%8e-windows%e3%80%82\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e8%87%aa%e5%8a%a8%e5%ae%89%e8%a3%85-ansible-%e4%ba%8e-windows%e3%80%82\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e8%87%aa%e5%8a%a8%e5%ae%89%e8%a3%85-ansible-%e4%ba%8e-windows%e3%80%82\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u81ea\u52a8\u5b89\u88c5 Ansible \u4e8e Windows"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/85c1dae56e6ea1e695c73d33c684d487","name":"\u9038, \u79d1","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c94f6d9cbbfbca863fab309840bd690c153c95f8490c290ad2ed54dd693dad16?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c94f6d9cbbfbca863fab309840bd690c153c95f8490c290ad2ed54dd693dad16?s=96&d=mm&r=g","caption":"\u9038, \u79d1"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/keyi\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e8%87%aa%e5%8a%a8%e5%ae%89%e8%a3%85-ansible-%e4%ba%8e-windows%e3%80%82\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/42974","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=42974"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/42974\/revisions"}],"predecessor-version":[{"id":94401,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/42974\/revisions\/94401"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=42974"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=42974"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=42974"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}