{"id":42714,"date":"2022-11-16T08:52:31","date_gmt":"2023-04-04T02:44:10","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8%e6%88%91%e8%87%aa%e5%b7%b1%e5%9c%a8-git-%e4%bb%93%e5%ba%93%e4%b8%ad%e6%89%98%e7%ae%a1%e7%9a%84-ansible-collection\/"},"modified":"2024-04-29T00:54:59","modified_gmt":"2024-04-28T16:54:59","slug":"%e4%bd%bf%e7%94%a8%e6%88%91%e8%87%aa%e5%b7%b1%e5%9c%a8-git-%e4%bb%93%e5%ba%93%e4%b8%ad%e6%89%98%e7%ae%a1%e7%9a%84-ansible-collection","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8%e6%88%91%e8%87%aa%e5%b7%b1%e5%9c%a8-git-%e4%bb%93%e5%ba%93%e4%b8%ad%e6%89%98%e7%ae%a1%e7%9a%84-ansible-collection\/","title":{"rendered":"\u4f7f\u7528\u6211\u81ea\u5df1\u5728 git \u4ed3\u5e93\u4e2d\u6258\u7ba1\u7684 Ansible Collection"},"content":{"rendered":"<p>\u5728\u642d\u5efa\u670d\u52a1\u5668\u65f6\uff0c\u5c06\u5e38\u89c1\u7684\u8bbe\u7f6e\u4efb\u52a1\u7b49\u901a\u8fc7 Ansible Collection \u8fdb\u884c\u590d\u7528\u662f\u5f88\u65b9\u4fbf\u7684\u3002\u56e0\u6b64\uff0c\u6211\u4f1a\u8bb0\u5f55\u4e0b\u53c2\u8003\u5b98\u65b9\u6587\u6863\u8fdb\u884c\u5b9e\u9645\u5c1d\u8bd5\uff08\u4ee5\u53ca\u9047\u5230\u7684\u56f0\u96be\uff09\u7684\u6b65\u9aa4\u3002<\/p>\n<h2>\u5efa\u7acb\u6536\u85cf\u54c1<\/h2>\n<p>\u5728\u4e2d\u6587\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528 ansible-galaxy collection init \u547d\u4ee4\u521b\u5efa\u4e00\u4e2a\u7a7a\u7684\u96c6\u5408\uff08\u9aa8\u67b6\uff09\u3002\u8fd9\u91cc\u6211\u4eec\u5c06\u5c1d\u8bd5\u5728\u547d\u540d\u7a7a\u95f4 thisis \u4e0b\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a example \u7684\u89d2\u8272\u3002<\/p>\n<pre class=\"post-pre\"><code>% ansible-galaxy collection init thisis.example\r\n- Collection thisis.example was created successfully\r\n% find <span class=\"nb\">.<\/span>\r\n<span class=\"nb\">.<\/span>\r\n.\/thisis\r\n.\/thisis\/example\r\n.\/thisis\/example\/plugins\r\n.\/thisis\/example\/plugins\/README.md\r\n.\/thisis\/example\/roles\r\n.\/thisis\/example\/docs\r\n.\/thisis\/example\/README.md\r\n.\/thisis\/example\/galaxy.yml\r\n<\/code><\/pre>\n<p>\u53ea\u9700\u6b63\u786e\u7684\u76ee\u5f55\u7ed3\u6784\u548cgalaxy.yml\u6587\u4ef6\uff0c\u5c31\u53ef\u4ee5\u521b\u5efa\u96c6\u5408\u3002<\/p>\n<p>galaxy.yml\u6587\u4ef6\u4e2d\u5305\u542b\u96c6\u5408\u7684\u5143\u6570\u636e\u4fe1\u606f\u3002<\/p>\n<p>\u5728\u6267\u884cansible-galaxy init collection\u540e\uff0c\u4f1a\u8bbe\u7f6e\u9ed8\u8ba4\u503c\u5982\u4e0b\u3002<\/p>\n<pre class=\"post-pre\"><code>% <span class=\"nb\">grep<\/span> <span class=\"s1\">'^[^#]'<\/span> thisis\/example\/galaxy.yml\r\nnamespace: thisis\r\nname: example\r\nversion: 1.0.0\r\nreadme: README.md\r\nauthors:\r\n- your name &lt;example@domain.com&gt;\r\ndescription: your collection description\r\nlicense:\r\n- GPL-2.0-or-later\r\nlicense_file: <span class=\"s1\">''<\/span>\r\ntags: <span class=\"o\">[]<\/span>\r\ndependencies: <span class=\"o\">{}<\/span>\r\nrepository: http:\/\/example.com\/repository\r\ndocumentation: http:\/\/docs.example.com\r\nhomepage: http:\/\/example.com\r\nissues: http:\/\/example.com\/issue\/tracker\r\nbuild_ignore: <span class=\"o\">[]<\/span>\r\n<\/code><\/pre>\n<p>\u53ea\u9700\u8981\u4e00\u4e2a\u9009\u9879\uff0c\u539f\u6587\u5982\u4e0b\uff1a<\/p>\n<p>\u7531\u4e8e\u4e0a\u8ff0\u5fc5\u8981\u914d\u7f6e\u9009\u9879\u4ec5\u5728 &#8220;authors&#8221; \u4e4b\u4e0a\uff0c\u56e0\u6b64\u5c06\u6536\u96c6\u6240\u9700\u4fe1\u606f\u5e76\u8fdb\u884c\u76f8\u5e94\u7684\u7f16\u8f91\u3002<br \/>\n\u4e00\u65e6 &#8220;galaxy.yml&#8221; \u51c6\u5907\u597d\u4e86\uff0c\u5c31\u53ef\u4ee5\u5728 &#8220;roles\/&#8221; \u76ee\u5f55\u4e0b\u51c6\u5907\u5171\u4eab\u7684\u4efb\u52a1\u7b49\u3002<\/p>\n<pre class=\"post-pre\"><code>% <span class=\"nb\">mkdir<\/span> <span class=\"nt\">-p<\/span> thisis\/example\/roles\/aaa\/tasks\/\r\n% <span class=\"nb\">echo<\/span> <span class=\"o\">&lt;&lt;<\/span><span class=\"no\">EOL<\/span><span class=\"sh\"> &gt; thisis\/example\/roles\/aaa\/tasks\/main.yml\r\nheredoc&gt; ---\r\nheredoc&gt; - name: aaa\r\nheredoc&gt;   debug:\r\nheredoc&gt;     msg: \u554f\u984c\u306a\u3057\uff01OK\uff01\r\nheredoc&gt;\r\nheredoc&gt; EOL\r\n<\/span><\/code><\/pre>\n<p>\u5982\u679c\u80fd\u505a\u5230\u8fd9\u4e00\u70b9\uff0c\u4e4b\u540e\u5c06 example \u6587\u4ef6\u5939\u4f5c\u4e3a\u4e00\u4e2a\u5408\u9002\u7684 git \u4ed3\u5e93\u8fdb\u884c\u63a8\u9001\uff0c\u5c31\u5b8c\u6210\u4e86\u521b\u5efa\u3002<\/p>\n<h2>\u5c1d\u8bd5\u4f7f\u7528\u6536\u85cf\u529f\u80fd<\/h2>\n<p>\u5728\u8981\u4f7f\u7528 collection \u7684 playbook \u7684 requirements.yml \u4e2d\uff0c\u6307\u5b9a\u8981\u4f7f\u7528\u7684 collection\uff08\u5373\u4e4b\u524d\u521b\u5efa\u7684\u90a3\u4e2a\uff09\u3002<br \/>\n\u5982\u679c\u9700\u8981\u5bf9 Git \u4ed3\u5e93\u8fdb\u884c SSH \u8ba4\u8bc1\uff0c\u8bf7\u4ee5 git+ssh:\/\/git@~ \u7684\u5f62\u5f0f\u6307\u5b9a\u540d\u79f0\u3002<\/p>\n<pre class=\"post-pre\"><code>% <span class=\"nb\">cat <\/span>requirements.yml\r\ncollections:\r\n  - name: git+ssh:\/\/git@your-git-host.com\/your-org\/ansible-collection-example.git\r\n    <span class=\"nb\">type<\/span>: git\r\n    version: main\r\n<\/code><\/pre>\n<p>\u5f53\u4f60\u51c6\u5907\u597d\u4e0a\u8ff0\u5185\u5bb9\u540e\uff0c\u5728\u4e3b\u673a\u4e0a\u8fd0\u884c ansible-galaxy install -r requirements.yml\uff0c\u89d2\u8272\u5c06\u88ab\u5b89\u88c5\u5728\u4e3b\u673a\u7684 ANSIBLE_COLLECTIONS_PATHS \uff08\u9ed8\u8ba4\u4e3a ~\/.ansible\/collections\/ \u76ee\u5f55\uff09\u4e2d\u3002<\/p>\n<pre class=\"post-pre\"><code>% ansible-galaxy <span class=\"nb\">install<\/span> <span class=\"nt\">-r<\/span> requirements.yml\r\nStarting galaxy collection <span class=\"nb\">install <\/span>process\r\nProcess <span class=\"nb\">install <\/span>dependency map\r\nCloning into <span class=\"s1\">'\/Users\/whoami\/.ansible\/tmp\/(\u7565)\/ansible-collection-examplexxxxxx'<\/span>...\r\nremote: Enumerating objects: 24, <span class=\"k\">done<\/span><span class=\"nb\">.<\/span>\r\nremote: Counting objects: 100% <span class=\"o\">(<\/span>11\/11<span class=\"o\">)<\/span>, <span class=\"k\">done<\/span><span class=\"nb\">.<\/span>\r\nremote: Compressing objects: 100% <span class=\"o\">(<\/span>9\/9<span class=\"o\">)<\/span>, <span class=\"k\">done<\/span><span class=\"nb\">.<\/span>\r\nremote: Total 24 <span class=\"o\">(<\/span>delta 1<span class=\"o\">)<\/span>, reused 0 <span class=\"o\">(<\/span>delta 0<span class=\"o\">)<\/span>, pack-reused 13\r\nReceiving objects: 100% <span class=\"o\">(<\/span>24\/24<span class=\"o\">)<\/span>, <span class=\"k\">done<\/span><span class=\"nb\">.<\/span>\r\nResolving deltas: 100% <span class=\"o\">(<\/span>1\/1<span class=\"o\">)<\/span>, <span class=\"k\">done<\/span><span class=\"nb\">.<\/span>\r\nAlready on <span class=\"s1\">'main'<\/span>\r\nYour branch is up to <span class=\"nb\">date <\/span>with <span class=\"s1\">'origin\/main'<\/span><span class=\"nb\">.<\/span>\r\nStarting collection <span class=\"nb\">install <\/span>process\r\nInstalling <span class=\"s1\">'thisis.example:1.0.0'<\/span> to <span class=\"s1\">'\/Users\/whoami\/.ansible\/collections\/ansible_collections\/thisis\/example'<\/span>\r\nCreated collection <span class=\"k\">for <\/span>thisis.example:1.0.0 at \/Users\/whoami\/.ansible\/collections\/ansible_collections\/thisis\/example\r\nthisis.example:1.0.0 was installed successfully\r\n<\/code><\/pre>\n<p>\u5982\u679c\u5230\u8fd9\u4e00\u6b65\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528playbook\u6765\u6307\u5b9a\u89d2\u8272\u5e76\u6267\u884c\u3002<\/p>\n<pre class=\"post-pre\"><code>% find <span class=\"nb\">.<\/span>\r\n<span class=\"nb\">.<\/span>\r\n.\/inventory\r\n.\/playbook.yml\r\n.\/requirements.yml\r\n% <span class=\"nb\">cat <\/span>playbook.yml\r\n- hosts: all\r\n\r\n  roles:\r\n    - thisis.example.aaa\r\n\r\n% ansible-playbook <span class=\"nt\">-i<\/span> inventory playbook.yml\r\n\r\nPLAY <span class=\"o\">[<\/span>all] <span class=\"k\">**********************************************************************************************************<\/span>\r\n\r\nTASK <span class=\"o\">[<\/span>Gathering Facts] <span class=\"k\">**********************************************************************************************<\/span>\r\nok: <span class=\"o\">[<\/span>targethost]\r\n\r\nTASK <span class=\"o\">[<\/span>thisis.example.aaa : aaa] <span class=\"k\">*************************************************************************************<\/span>\r\nok: <span class=\"o\">[<\/span>targethost] <span class=\"o\">=&gt;<\/span> <span class=\"o\">{<\/span>\r\n    <span class=\"s2\">\"msg\"<\/span>: <span class=\"s2\">\"\u554f\u984c\u306a\u3057\uff01OK\uff01\"<\/span>\r\n<span class=\"o\">}<\/span>\r\n\r\nPLAY RECAP <span class=\"k\">**********************************************************************************************************<\/span>\r\ntargethost               : <span class=\"nv\">ok<\/span><span class=\"o\">=<\/span>2    <span class=\"nv\">changed<\/span><span class=\"o\">=<\/span>0    <span class=\"nv\">unreachable<\/span><span class=\"o\">=<\/span>0    <span class=\"nv\">failed<\/span><span class=\"o\">=<\/span>0    <span class=\"nv\">skipped<\/span><span class=\"o\">=<\/span>0    <span class=\"nv\">rescued<\/span><span class=\"o\">=<\/span>0    <span class=\"nv\">ignored<\/span><span class=\"o\">=<\/span>0\r\n<\/code><\/pre>\n<h2>\u4f59\u8ac7\uff1a\u66fe\u7ecf\u9047\u5230\u8fc7\u56f0\u96be<\/h2>\n<p>\u6839\u636e\u4e4b\u524d\u5199\u7684\u5185\u5bb9\uff0c\u8981\u521b\u5efa\u4e00\u4e2acollection\uff0c\u9700\u8981\u6709\u4e00\u4e2a\u5305\u542bgalaxy.yml\u548c\u5171\u4eab\u7684\u89d2\u8272\u5b9e\u4f53\u7684\u76ee\u5f55\u7ed3\u6784\u3002\u5982\u679c\u4f60\u613f\u610f\uff0c\u4f60\u53ef\u4ee5\u81ea\u5df1\u51c6\u5907\u76ee\u5f55\uff0c\u5e76\u53ea\u5728galaxy.yml\u4e2d\u5199\u5165\u5fc5\u9700\u7684\u53c2\u6570namespace\u3001name\u3001version\u3001readme\u548cauthors\uff0c\u5c31\u53ef\u4ee5\u521b\u5efacollection\u3002\uff08\u5b9e\u9645\u4e0a\uff0c\u6211\u6700\u521d\u4e5f\u662f\u8fd9\u6837\u8bd5\u7684\u3002\uff09<\/p>\n<p>\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5728\u8fd9\u91cc\uff0cnamespace\u548cname\u4f7f\u7528\u7684\u5b57\u7b26\u662f\u6709\u9650\u5236\u7684\u3002<br \/>\n\u53ef\u4ee5\u4f7f\u7528\u7684\u5b57\u7b26\u662f[a-zA-Z0-9_]\uff0c\u4e0d\u80fd\u4f7f\u7528&#8221;-&#8220;\u7b49\u5b57\u7b26\u3002\uff08\u8fd9\u4e00\u70b9\u5728\u81ea\u52a8\u751f\u6210\u7684galaxy.yml\u6ce8\u91ca\u4e2d\u4e5f\u6709\u8bf4\u660e\uff09<\/p>\n<p>\u5982\u679c\u547d\u540d\u7a7a\u95f4\u6216\u540d\u79f0\u4e2d\u5305\u542b\u6a2a\u6746 &#8211; \uff0c\u90a3\u4e48\u5728\u8fd0\u884c &#8220;ansible-galaxy install -r requirements.yml&#8221; \u5b89\u88c5\u6210\u529f\u540e\uff0c\u64ad\u653e\u4e66\u6267\u884c\u65f6\u5c06\u51fa\u73b0\u9519\u8bef\u3002<\/p>\n<p>(\u5b89\u88c5\u6210\u529f\uff0c\u4f46\u662f)<\/p>\n<pre class=\"post-pre\"><code>% ansible-galaxy <span class=\"nb\">install<\/span> <span class=\"nt\">-r<\/span> requirements.yml\r\nStarting galaxy collection <span class=\"nb\">install <\/span>process\r\nProcess <span class=\"nb\">install <\/span>dependency map\r\nCloning into <span class=\"s1\">'\/Users\/whoami\/.ansible\/tmp\/(\u7565)\/ansible-collection-examplexxxxxx'<\/span>...\r\nremote: Enumerating objects: 31, <span class=\"k\">done<\/span><span class=\"nb\">.<\/span>\r\nremote: Counting objects: 100% <span class=\"o\">(<\/span>18\/18<span class=\"o\">)<\/span>, <span class=\"k\">done<\/span><span class=\"nb\">.<\/span>\r\nremote: Compressing objects: 100% <span class=\"o\">(<\/span>13\/13<span class=\"o\">)<\/span>, <span class=\"k\">done<\/span><span class=\"nb\">.<\/span>\r\nremote: Total 31 <span class=\"o\">(<\/span>delta 2<span class=\"o\">)<\/span>, reused 0 <span class=\"o\">(<\/span>delta 0<span class=\"o\">)<\/span>, pack-reused 13\r\nReceiving objects: 100% <span class=\"o\">(<\/span>31\/31<span class=\"o\">)<\/span>, 4.40 KiB | 1.46 MiB\/s, <span class=\"k\">done<\/span><span class=\"nb\">.<\/span>\r\nResolving deltas: 100% <span class=\"o\">(<\/span>2\/2<span class=\"o\">)<\/span>, <span class=\"k\">done<\/span><span class=\"nb\">.<\/span>\r\nAlready on <span class=\"s1\">'main'<\/span>\r\nYour branch is up to <span class=\"nb\">date <\/span>with <span class=\"s1\">'origin\/main'<\/span><span class=\"nb\">.<\/span>\r\nStarting collection <span class=\"nb\">install <\/span>process\r\nInstalling <span class=\"s1\">'thisis.ex-am-ple:1.0.0'<\/span> to <span class=\"s1\">'\/Users\/whoami\/.ansible\/collections\/ansible_collections\/thisis\/ex-am-ple'<\/span>\r\nCreated collection <span class=\"k\">for <\/span>thisis.ex-am-ple:1.0.0 at \/Users\/whoami\/.ansible\/collections\/ansible_collections\/thisis\/ex-am-ple\r\nthisis.ex-am-ple:1.0.0 was installed successfully\r\n<\/code><\/pre>\n<p>\uff08\u51fa\u73b0\u9519\u8bef\uff08\u63d0\u793a\u627e\u4e0d\u5230\u89d2\u8272\uff09\u7684\u8fd0\u884c\u65f6\u60c5\u51b5\uff09<\/p>\n<pre class=\"post-pre\"><code>% <span class=\"nb\">cat <\/span>playbook.yml\r\n- hosts: all\r\n\r\n  roles:\r\n    - thisis.ex-am-ple.aaa\r\n\r\n% ansible-playbook <span class=\"nt\">-i<\/span> inventory playbook.yml\r\nERROR! the role <span class=\"s1\">'thisis.ex-am-ple.aaa'<\/span> was not found <span class=\"k\">in<\/span> \/Users\/whoami\/tmp\/roles:\/Users\/whoami\/.ansible\/roles:\/Users\/whoami\/tmp\r\n\r\nThe error appears to be <span class=\"k\">in<\/span> <span class=\"s1\">'\/Users\/whoami\/tmp\/playbook.yml'<\/span>: line 4, column 7, but may\r\nbe elsewhere <span class=\"k\">in <\/span>the file depending on the exact syntax problem.\r\n\r\nThe offending line appears to be:\r\n\r\n  roles:\r\n    - thisis.ex-am-ple.aaa\r\n      ^ here\r\n<\/code><\/pre>\n<p>\u5982\u679c\u76f4\u63a5\u63a5\u6536\u4e0a\u8ff0\u7684\u9519\u8bef\u6d88\u606f\u201c\u627e\u4e0d\u5230\u89d2\u8272\u201d\uff0c\u7ecf\u8fc7\u4e00\u756a\u8c03\u67e5\u540e\u53d1\u73b0\u8fd9\u4f1a\u6d6a\u8d39\u5927\u91cf\u65f6\u95f4\uff08\u6709\u7ecf\u9a8c\u4e4b\u8c08\uff09\u3002<\/p>\n<p>\u5982\u679c\u60a8\u4ed4\u7ec6\u9605\u8bfb\u4e86Ansible\u6587\u6863\uff08\u6216\u8005\u9605\u8bfb\u4e86\u4e4b\u524d\u663e\u793a\u7684\u8b66\u544a\u4fe1\u606f\uff09\uff0c\u60a8\u5c31\u53ef\u4ee5\u4e86\u89e3\u5230\u5173\u4e8e\u8fd9\u4e2a\u547d\u540d\u9650\u5236\u7684\u5185\u5bb9\u3002\u6216\u8005\u60a8\u4e5f\u53ef\u4ee5\u901a\u8fc7\u9996\u5148\u4f7f\u7528&#8221;ansible-galaxy collection init&#8221;\u547d\u4ee4\u521b\u5efa\u4e00\u4e2a\u6a21\u677f\uff0c\u5982\u679c\u547d\u4ee4\u672c\u8eab\u51fa\u73b0\u9519\u8bef\uff0c\u60a8\u4e5f\u80fd\u591f\u6ce8\u610f\u5230\u8fd9\u4e2a\u95ee\u9898\u3002<\/p>\n<pre class=\"post-pre\"><code>% ansible-galaxy collection init thisis.ex-am-ple\r\nERROR! Invalid collection name <span class=\"s1\">'thisis.ex-am-ple'<\/span>, name must be <span class=\"k\">in <\/span>the format &lt;namespace&gt;.&lt;collection&gt;.\r\nPlease make sure namespace and collection name contains characters from <span class=\"o\">[<\/span>a-zA-Z0-9_] only.\r\n<\/code><\/pre>\n<p>\u56e0\u6b64\uff0c\u9605\u8bfb\u5b98\u65b9\u4fe1\u606f\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u5927\u5bb6\u4e5f\u8981\u6ce8\u610f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u642d\u5efa\u670d\u52a1\u5668\u65f6\uff0c\u5c06\u5e38\u89c1\u7684\u8bbe\u7f6e\u4efb\u52a1\u7b49\u901a\u8fc7 Ansible Collection \u8fdb\u884c\u590d\u7528\u662f\u5f88\u65b9\u4fbf\u7684\u3002\u56e0\u6b64\uff0c\u6211\u4f1a\u8bb0 [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-42714","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>\u4f7f\u7528\u6211\u81ea\u5df1\u5728 git \u4ed3\u5e93\u4e2d\u6258\u7ba1\u7684 Ansible Collection - 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\/\u4f7f\u7528\u6211\u81ea\u5df1\u5728-git-\u4ed3\u5e93\u4e2d\u6258\u7ba1\u7684-ansible-collection\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4f7f\u7528\u6211\u81ea\u5df1\u5728 git \u4ed3\u5e93\u4e2d\u6258\u7ba1\u7684 Ansible Collection\" \/>\n<meta property=\"og:description\" content=\"\u5728\u642d\u5efa\u670d\u52a1\u5668\u65f6\uff0c\u5c06\u5e38\u89c1\u7684\u8bbe\u7f6e\u4efb\u52a1\u7b49\u901a\u8fc7 Ansible Collection \u8fdb\u884c\u590d\u7528\u662f\u5f88\u65b9\u4fbf\u7684\u3002\u56e0\u6b64\uff0c\u6211\u4f1a\u8bb0 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528\u6211\u81ea\u5df1\u5728-git-\u4ed3\u5e93\u4e2d\u6258\u7ba1\u7684-ansible-collection\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-04-04T02:44:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-28T16:54:59+00:00\" \/>\n<meta name=\"author\" content=\"\u5b87, \u534e\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u5b87, \u534e\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \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\/%e4%bd%bf%e7%94%a8%e6%88%91%e8%87%aa%e5%b7%b1%e5%9c%a8-git-%e4%bb%93%e5%ba%93%e4%b8%ad%e6%89%98%e7%ae%a1%e7%9a%84-ansible-collection\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8%e6%88%91%e8%87%aa%e5%b7%b1%e5%9c%a8-git-%e4%bb%93%e5%ba%93%e4%b8%ad%e6%89%98%e7%ae%a1%e7%9a%84-ansible-collection\/\",\"name\":\"\u4f7f\u7528\u6211\u81ea\u5df1\u5728 git \u4ed3\u5e93\u4e2d\u6258\u7ba1\u7684 Ansible Collection - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-04-04T02:44:10+00:00\",\"dateModified\":\"2024-04-28T16:54:59+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8%e6%88%91%e8%87%aa%e5%b7%b1%e5%9c%a8-git-%e4%bb%93%e5%ba%93%e4%b8%ad%e6%89%98%e7%ae%a1%e7%9a%84-ansible-collection\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8%e6%88%91%e8%87%aa%e5%b7%b1%e5%9c%a8-git-%e4%bb%93%e5%ba%93%e4%b8%ad%e6%89%98%e7%ae%a1%e7%9a%84-ansible-collection\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8%e6%88%91%e8%87%aa%e5%b7%b1%e5%9c%a8-git-%e4%bb%93%e5%ba%93%e4%b8%ad%e6%89%98%e7%ae%a1%e7%9a%84-ansible-collection\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4f7f\u7528\u6211\u81ea\u5df1\u5728 git \u4ed3\u5e93\u4e2d\u6258\u7ba1\u7684 Ansible Collection\"}]},{\"@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\/513018e4e121d3add1b7c5de8be21458\",\"name\":\"\u5b87, \u534e\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g\",\"caption\":\"\u5b87, \u534e\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yuhua\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8%e6%88%91%e8%87%aa%e5%b7%b1%e5%9c%a8-git-%e4%bb%93%e5%ba%93%e4%b8%ad%e6%89%98%e7%ae%a1%e7%9a%84-ansible-collection\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u4f7f\u7528\u6211\u81ea\u5df1\u5728 git \u4ed3\u5e93\u4e2d\u6258\u7ba1\u7684 Ansible Collection - 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\/\u4f7f\u7528\u6211\u81ea\u5df1\u5728-git-\u4ed3\u5e93\u4e2d\u6258\u7ba1\u7684-ansible-collection\/","og_locale":"zh_CN","og_type":"article","og_title":"\u4f7f\u7528\u6211\u81ea\u5df1\u5728 git \u4ed3\u5e93\u4e2d\u6258\u7ba1\u7684 Ansible Collection","og_description":"\u5728\u642d\u5efa\u670d\u52a1\u5668\u65f6\uff0c\u5c06\u5e38\u89c1\u7684\u8bbe\u7f6e\u4efb\u52a1\u7b49\u901a\u8fc7 Ansible Collection \u8fdb\u884c\u590d\u7528\u662f\u5f88\u65b9\u4fbf\u7684\u3002\u56e0\u6b64\uff0c\u6211\u4f1a\u8bb0 [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528\u6211\u81ea\u5df1\u5728-git-\u4ed3\u5e93\u4e2d\u6258\u7ba1\u7684-ansible-collection\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-04-04T02:44:10+00:00","article_modified_time":"2024-04-28T16:54:59+00:00","author":"\u5b87, \u534e","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u5b87, \u534e","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8%e6%88%91%e8%87%aa%e5%b7%b1%e5%9c%a8-git-%e4%bb%93%e5%ba%93%e4%b8%ad%e6%89%98%e7%ae%a1%e7%9a%84-ansible-collection\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8%e6%88%91%e8%87%aa%e5%b7%b1%e5%9c%a8-git-%e4%bb%93%e5%ba%93%e4%b8%ad%e6%89%98%e7%ae%a1%e7%9a%84-ansible-collection\/","name":"\u4f7f\u7528\u6211\u81ea\u5df1\u5728 git \u4ed3\u5e93\u4e2d\u6258\u7ba1\u7684 Ansible Collection - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-04-04T02:44:10+00:00","dateModified":"2024-04-28T16:54:59+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8%e6%88%91%e8%87%aa%e5%b7%b1%e5%9c%a8-git-%e4%bb%93%e5%ba%93%e4%b8%ad%e6%89%98%e7%ae%a1%e7%9a%84-ansible-collection\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8%e6%88%91%e8%87%aa%e5%b7%b1%e5%9c%a8-git-%e4%bb%93%e5%ba%93%e4%b8%ad%e6%89%98%e7%ae%a1%e7%9a%84-ansible-collection\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8%e6%88%91%e8%87%aa%e5%b7%b1%e5%9c%a8-git-%e4%bb%93%e5%ba%93%e4%b8%ad%e6%89%98%e7%ae%a1%e7%9a%84-ansible-collection\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u4f7f\u7528\u6211\u81ea\u5df1\u5728 git \u4ed3\u5e93\u4e2d\u6258\u7ba1\u7684 Ansible Collection"}]},{"@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\/513018e4e121d3add1b7c5de8be21458","name":"\u5b87, \u534e","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g","caption":"\u5b87, \u534e"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yuhua\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8%e6%88%91%e8%87%aa%e5%b7%b1%e5%9c%a8-git-%e4%bb%93%e5%ba%93%e4%b8%ad%e6%89%98%e7%ae%a1%e7%9a%84-ansible-collection\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/42714","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\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=42714"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/42714\/revisions"}],"predecessor-version":[{"id":69824,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/42714\/revisions\/69824"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=42714"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=42714"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=42714"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}