doc: update docs/ansible.md (#391) 9680e2a113

This commit is contained in:
jaywcjlove
2023-07-07 04:08:43 +00:00
parent 08808ddf23
commit 8553a49119
3 changed files with 68 additions and 68 deletions

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 4.9 MiB

After

Width:  |  Height:  |  Size: 4.9 MiB

View File

@ -60,7 +60,8 @@
<ul> <ul>
<li><a href="https://docs.ansible.com">Ansible 官方文档</a></li> <li><a href="https://docs.ansible.com">Ansible 官方文档</a></li>
</ul> </ul>
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="配置位置"><a aria-hidden="true" tabindex="-1" href="#配置位置"><span class="icon icon-link"></span></a>配置位置</h3><div class="wrap-body"> </div></div></div><div class="wrap h3body-not-exist col-span-2 row-span-2"><div class="wrap-header h3wrap"><h3 id="配置位置"><a aria-hidden="true" tabindex="-1" href="#配置位置"><span class="icon icon-link"></span></a>配置位置</h3><div class="wrap-body">
<!--rehype:wrap-class=col-span-2 row-span-2-->
@ -82,24 +83,18 @@
<table><thead><tr><th align="left">文件路径</th><th>说明</th></tr></thead><tbody><tr><td align="left"><code>/etc/ansible/ansible.cfg</code></td><td>系统范围的配置</td></tr><tr><td align="left"><code>~/ansible.cfg</code></td><td>用户特定的配置</td></tr><tr><td align="left"><code>$pwd/ansible.cfg</code></td><td>当前目录下的配置</td></tr></tbody></table>
<p>配置文件优先级</p>
<ul class="style-timeline">
<li>如果没有任何其他配置文件,默认使用 <code>/etc/ansible/ansible.cfg</code></li>
<li><code>~/.ansible.cfg</code> <code></code>目录下的 <code>.ansible.cfg</code></li>
<li>当前目录下的 <code>ansible.cfg</code>,即在同一目录下 <code>ansible.cfg</code> 优先级高于 <code>~/.ansible.cfg</code></li>
<li>环境变量 <code>exoport ANSIBLE_CONFIG=/$DIR/ansible.cfg</code></li>
</ul>
<!--rehype:className=style-timeline-->
<p>查看正在使用的 <code>ansible</code> 配置文件:</p>
<pre class="language-bash"><code class="language-bash code-highlight"><span class="code-line">ansible <span class="token parameter variable">--version</span> <span class="token operator">|</span> <span class="token function">grep</span> <span class="token string">"config file"</span>
<table><thead><tr><th align="left">文件路径</th><th>说明</th></tr></thead><tbody><tr><td align="left"><code>/etc/ansible/ansible.cfg</code></td><td>系统范围的配置</td></tr><tr><td align="left"><code>~/ansible.cfg</code></td><td>用户特定的配置</td></tr><tr><td align="left"><code>$pwd/ansible.cfg</code></td><td>当前目录下的配置</td></tr><tr><td align="left">ansible的缺省的配置文件/etc/ansible/ansible.cfg</td><td></td></tr><tr><td align="left">ansible配置文件优先级</td><td></td></tr><tr><td align="left">1.如果没有任何其他的ansible配置文件默认使用/etc/ansible/ansible.cfg</td><td></td></tr></tbody></table>
<pre><code class="code-highlight"><span class="code-line">2. ~/.ansible.cfg 家目录下的.ansible.cfg
</span><span class="code-line">3. ./ansible.cfg 当前目录下的ansible.cfg 即在同一目录下ansible.cfg优先级高于.ansible.cfg
</span><span class="code-line">4.环境变量 exoport ANSIBLE_CONFIG=/$DIR/ansible.cfg
</span></code></pre> </span></code></pre>
<p>查看正在使用的ansible配置文件 ansible --version | grep "config file"</p>
</div></div></div><div class="wrap h3body-exist"><div class="wrap-header h3wrap"><h3 id="inventory文件hosts列表"><a aria-hidden="true" tabindex="-1" href="#inventory文件hosts列表"><span class="icon icon-link"></span></a>Inventory文件(hosts列表)</h3><div class="wrap-body"> </div></div></div><div class="wrap h3body-exist"><div class="wrap-header h3wrap"><h3 id="inventory文件hosts列表"><a aria-hidden="true" tabindex="-1" href="#inventory文件hosts列表"><span class="icon icon-link"></span></a>Inventory文件(hosts列表)</h3><div class="wrap-body">
<h4 id="静态inventory"><a aria-hidden="true" tabindex="-1" href="#静态inventory"><span class="icon icon-link"></span></a>静态Inventory</h4> <h4 id="静态inventory"><a aria-hidden="true" tabindex="-1" href="#静态inventory"><span class="icon icon-link"></span></a>静态Inventory</h4>
<p><code>/etc/ansible/hosts</code></p> <p><code>/etc/ansible/hosts</code></p>

View File

@ -1078,6 +1078,9 @@
</a> </a>
<a href="https://github.com/qwxingzhe" title="行者"> <a href="https://github.com/qwxingzhe" title="行者">
<img src="https://avatars.githubusercontent.com/u/7071651?v=4" width="42;" alt="行者"> <img src="https://avatars.githubusercontent.com/u/7071651?v=4" width="42;" alt="行者">
</a>
<a href="https://github.com/Zeng-qh" title="都一样">
<img src="https://avatars.githubusercontent.com/u/40046415?v=4" width="42;" alt="都一样">
</a><!--GAMFC-END--> </a><!--GAMFC-END-->
<p style="padding-top:1rem;"><a href="https://github.com/jaywcjlove/reference/graphs/contributors">贡献者</a>列表,由 <a href="https://github.com/jaywcjlove/github-action-contributors">contributors</a> 根据提交次数的先后顺序自动生成</p> <p style="padding-top:1rem;"><a href="https://github.com/jaywcjlove/reference/graphs/contributors">贡献者</a>列表,由 <a href="https://github.com/jaywcjlove/github-action-contributors">contributors</a> 根据提交次数的先后顺序自动生成</p>
<!--rehype:style=padding-top:1rem;--> <!--rehype:style=padding-top:1rem;-->
@ -1267,7 +1270,7 @@
<!--rehype:class=home-card home-links--> <!--rehype:class=home-card home-links-->
<p>如果你有资源,可以很方便<a href="https://github.com/jaywcjlove/reference/issues/102#issue-1451649637">部署 web 版</a>,这非常简单,只需要克隆 <a href="https://github.com/jaywcjlove/reference/tree/gh-pages">gh-pages</a> 分支代码到你的静态服务就可以了,还可以使用 <a href="https://hub.docker.com/r/wcjiang/reference">docker</a> 快捷部署 web 版。</p> <p>如果你有资源,可以很方便<a href="https://github.com/jaywcjlove/reference/issues/102#issue-1451649637">部署 web 版</a>,这非常简单,只需要克隆 <a href="https://github.com/jaywcjlove/reference/tree/gh-pages">gh-pages</a> 分支代码到你的静态服务就可以了,还可以使用 <a href="https://hub.docker.com/r/wcjiang/reference">docker</a> 快捷部署 web 版。</p>
</div></div><div class="h2wrap-body"></div></div></div></div><footer class="footer-wrap"><footer class="max-container">© 2022 Kenny Wang. Updated on 2023/07/07 11:43:12</footer></footer><script src="data.js?v=1.4.1" defer></script><script src="js/fuse.min.js?v=1.4.1" defer></script><script src="js/main.js?v=1.4.1" defer></script><div id="mysearch"><div class="mysearch-box"><div class="mysearch-input"><div><svg xmlns="http://www.w3.org/2000/svg" height="1em" width="1em" viewBox="0 0 18 18"> </div></div><div class="h2wrap-body"></div></div></div></div><footer class="footer-wrap"><footer class="max-container">© 2022 Kenny Wang. Updated on 2023/07/07 12:07:52</footer></footer><script src="data.js?v=1.4.1" defer></script><script src="js/fuse.min.js?v=1.4.1" defer></script><script src="js/main.js?v=1.4.1" defer></script><div id="mysearch"><div class="mysearch-box"><div class="mysearch-input"><div><svg xmlns="http://www.w3.org/2000/svg" height="1em" width="1em" viewBox="0 0 18 18">
<path fill="currentColor" d="M17.71,16.29 L14.31,12.9 C15.4069846,11.5024547 16.0022094,9.77665502 16,8 C16,3.581722 12.418278,0 8,0 C3.581722,0 0,3.581722 0,8 C0,12.418278 3.581722,16 8,16 C9.77665502,16.0022094 11.5024547,15.4069846 12.9,14.31 L16.29,17.71 C16.4777666,17.8993127 16.7333625,18.0057983 17,18.0057983 C17.2666375,18.0057983 17.5222334,17.8993127 17.71,17.71 C17.8993127,17.5222334 18.0057983,17.2666375 18.0057983,17 C18.0057983,16.7333625 17.8993127,16.4777666 17.71,16.29 Z M2,8 C2,4.6862915 4.6862915,2 8,2 C11.3137085,2 14,4.6862915 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 Z"></path> <path fill="currentColor" d="M17.71,16.29 L14.31,12.9 C15.4069846,11.5024547 16.0022094,9.77665502 16,8 C16,3.581722 12.418278,0 8,0 C3.581722,0 0,3.581722 0,8 C0,12.418278 3.581722,16 8,16 C9.77665502,16.0022094 11.5024547,15.4069846 12.9,14.31 L16.29,17.71 C16.4777666,17.8993127 16.7333625,18.0057983 17,18.0057983 C17.2666375,18.0057983 17.5222334,17.8993127 17.71,17.71 C17.8993127,17.5222334 18.0057983,17.2666375 18.0057983,17 C18.0057983,16.7333625 17.8993127,16.4777666 17.71,16.29 Z M2,8 C2,4.6862915 4.6862915,2 8,2 C11.3137085,2 14,4.6862915 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 Z"></path>
</svg><input id="mysearch-input" type="search" placeholder="搜索" autocomplete="off"><div class="mysearch-clear"></div></div><button id="mysearch-close" type="button">搜索</button></div><div class="mysearch-result"><div id="mysearch-menu"></div><div id="mysearch-content"></div></div></div></div></body> </svg><input id="mysearch-input" type="search" placeholder="搜索" autocomplete="off"><div class="mysearch-clear"></div></div><button id="mysearch-close" type="button">搜索</button></div><div class="mysearch-result"><div id="mysearch-menu"></div><div id="mysearch-content"></div></div></div></div></body>
</html> </html>