add auto fetch ssl certs
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
"articleSection" : "post",
|
||||
"name" : "[筆記] ansible 設定 ssh_args 開啟 ForwardX11 \/ config ansible ssh_args to enable forwardagent",
|
||||
"headline" : "[筆記] ansible 設定 ssh_args 開啟 ForwardX11 \/ config ansible ssh_args to enable forwardagent",
|
||||
"description" : "\x3cp\x3e正確來說,我不曉得到底怎麼「稱呼」這個 forwardx11 \/ forwardagent\x3c\/p\x3e\n\n\x3cp\x3e總之就是在寫一隻ansible playbook\x3c\/p\x3e\n\n\x3cp\x3e目的是用來安裝、設定 firefox\x3c\/p\x3e\n\n\x3cp\x3e包含安裝 firefox addon\x3c\/p\x3e\n\n\x3cp\x3e但是一開始在執行的時候,碰到了一些錯誤\x3c\/p\x3e",
|
||||
"description" : "\x3cp\x3e正確來說,我不曉得到底怎麼「稱呼」這個 forwardx11 \/ forwardagent\x3c\/p\x3e\n\x3cp\x3e總之就是在寫一隻ansible playbook\x3c\/p\x3e\n\x3cp\x3e目的是用來安裝、設定 firefox\x3c\/p\x3e\n\x3cp\x3e包含安裝 firefox addon\x3c\/p\x3e\n\x3cp\x3e但是一開始在執行的時候,碰到了一些錯誤\x3c\/p\x3e",
|
||||
"inLanguage" : "en",
|
||||
"author" : "Eric Chang",
|
||||
"creator" : "Eric Chang",
|
||||
@@ -45,9 +45,9 @@
|
||||
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
|
||||
|
||||
<link href="https://h.cowbay.org/css/style.css?v=1626744134" rel="stylesheet" id="theme-stylesheet" type='text/css' media='all'>
|
||||
<link href="https://h.cowbay.org/css/style.css?v=1629951055" rel="stylesheet" id="theme-stylesheet" type='text/css' media='all'>
|
||||
|
||||
<link href="https://h.cowbay.org/css/custom.css?v=1626744134" rel="stylesheet" type='text/css' media='all'>
|
||||
<link href="https://h.cowbay.org/css/custom.css?v=1629951055" rel="stylesheet" type='text/css' media='all'>
|
||||
<link rel="shortcut icon" href="https://h.cowbay.org/img/favicon.ico" type="image/x-icon">
|
||||
<link rel="icon" href="https://h.cowbay.org/img/favicon.ico" type="image/x-icon">
|
||||
|
||||
@@ -81,10 +81,6 @@ if (!doNotTrack) {
|
||||
|
||||
<ul id="menu-secondary-items" class="menu-secondary-items">
|
||||
|
||||
<li class="menu-item menu-item-type-taxonomy menu-item-object-category">
|
||||
<a href="/categories/"></a>
|
||||
</li>
|
||||
|
||||
<li class="menu-item menu-item-type-taxonomy menu-item-object-category">
|
||||
<a href="/categories/ansible">ansible</a>
|
||||
</li>
|
||||
@@ -309,19 +305,12 @@ if (!doNotTrack) {
|
||||
<div class="entry-content">
|
||||
<article>
|
||||
<p>正確來說,我不曉得到底怎麼「稱呼」這個 forwardx11 / forwardagent</p>
|
||||
|
||||
<p>總之就是在寫一隻ansible playbook</p>
|
||||
|
||||
<p>目的是用來安裝、設定 firefox</p>
|
||||
|
||||
<p>包含安裝 firefox addon</p>
|
||||
|
||||
<p>但是一開始在執行的時候,碰到了一些錯誤</p>
|
||||
|
||||
<h3 id="錯誤訊息">錯誤訊息</h3>
|
||||
|
||||
<p>playbook 在執行時的錯誤訊息如下</p>
|
||||
|
||||
<pre><code>TASK [firefox : Create profiles] *************************************************************************************************
|
||||
Tuesday 24 December 2019 14:28:58 +0800 (0:00:00.067) 0:00:00.946 ******
|
||||
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: Exception: b'Error: no DISPLAY environment variable specified\n'
|
||||
@@ -365,18 +354,11 @@ Shared connection to 192.168.11.75 closed.
|
||||
PLAY RECAP ***********************************************************************************************************************
|
||||
hqdc075 : ok=3 changed=1 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p>稍微google 一下,都說是要設定 ssh forwardagent</p>
|
||||
|
||||
</code></pre><p>稍微google 一下,都說是要設定 ssh forwardagent</p>
|
||||
<p>所以翻了一下 ansible 的設定文件,看要怎麼做</p>
|
||||
|
||||
<p>發現可以用 ssh_args 加入-o xxxxxx</p>
|
||||
|
||||
<p>可是又找不到 ssh 怎麼用這個 -o</p>
|
||||
|
||||
<p>只好又回去找辣個男人問看看ssh的參數</p>
|
||||
|
||||
<pre><code> -o option
|
||||
Can be used to give options in the format used in the configuration file. This is useful for specifying options
|
||||
for which there is no separate command-line flag. For full details of the options listed below, and their possi‐
|
||||
@@ -424,33 +406,18 @@ hqdc075 : ok=3 changed=1 unreachable=0 failed=1 s
|
||||
IdentitiesOnly
|
||||
.....
|
||||
.....
|
||||
</code></pre>
|
||||
|
||||
<p>很長,就不全部列出來了</p>
|
||||
|
||||
</code></pre><p>很長,就不全部列出來了</p>
|
||||
<p>看到重點是 ForwardAgent / ForwardX11 了</p>
|
||||
|
||||
<p>但是真的不曉得怎麼區分這兩種</p>
|
||||
|
||||
<p>反正只有兩個,就 try and error 吧</p>
|
||||
|
||||
<p>在ansible 中修改inventory file ,在想要修改的 host 後面加入 ssh_args=“-o ForwardAgent=yes”</p>
|
||||
|
||||
<p>在ansible 中修改inventory file ,在想要修改的 host 後面加入 ssh_args=”-o ForwardAgent=yes”</p>
|
||||
<pre><code>hqdc075 ansible_host=192.168.11.75 ssh_args="-o ForwardAgent=yes"
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p>或者 ansible.cfg</p>
|
||||
|
||||
</code></pre><p>或者 ansible.cfg</p>
|
||||
<p>在[ssh_connection]區段中</p>
|
||||
|
||||
<p>加入</p>
|
||||
|
||||
<pre><code>ssh_args="-o ForwardAgent=yes"
|
||||
</code></pre>
|
||||
|
||||
<p>再跑一次 就看到正常執行了</p>
|
||||
|
||||
</code></pre><p>再跑一次 就看到正常執行了</p>
|
||||
<pre><code>PLAY RECAP ************************************************************************************************
|
||||
hqdc075 : ok=7 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
|
||||
|
||||
@@ -464,21 +431,12 @@ firefox : export display -------- 0.44s
|
||||
firefox : Configure profiles ---- 0.10s
|
||||
firefox : debug ex ---- 0.07s
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p>這次的過程,順便了解了ssh 加入 -X 可以在ssh session 中執行遠端主機上的圖形界面程式</p>
|
||||
|
||||
</code></pre><p>這次的過程,順便了解了ssh 加入 -X 可以在ssh session 中執行遠端主機上的圖形界面程式</p>
|
||||
<p>例如</p>
|
||||
|
||||
<pre><code>ssh -X username@hostname firefox
|
||||
</code></pre>
|
||||
|
||||
<p>就可以透過ssh 執行遠端的firefox</p>
|
||||
|
||||
</code></pre><p>就可以透過ssh 執行遠端的firefox</p>
|
||||
<p>如下圖</p>
|
||||
|
||||
<p><img src="https://i.imgur.com/5xoDFRe.png" alt="" /></p>
|
||||
|
||||
<p><img src="https://i.imgur.com/5xoDFRe.png" alt=""></p>
|
||||
<p>很酷!</p>
|
||||
</article>
|
||||
</div>
|
||||
@@ -758,7 +716,7 @@ title="pinterest icon"></i>
|
||||
|
||||
</ul> <div class="design-credit">
|
||||
|
||||
<p>© 2018 Göran Svensson</p>
|
||||
<p>© 2018 Göran Svensson</p>
|
||||
|
||||
<p>Nederburg Hugo Theme by <a href="https://appernetic.io">Appernetic</a>.</p>
|
||||
|
||||
@@ -770,7 +728,7 @@ title="pinterest icon"></i>
|
||||
</div>
|
||||
<script src="https://h.cowbay.org/js/jquery.min.js"></script>
|
||||
<script src="https://h.cowbay.org/js/jquerymigrate.js"></script>
|
||||
<script src="https://h.cowbay.org/js/production.min.js?v=1626744134"></script>
|
||||
<script src="https://h.cowbay.org/js/production.min.js?v=1629951055"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user