<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Posts on Be an Ansible Pro</title>
    <link>https://ansible.cloudns.pro/post/</link>
    <description>Recent content in Posts on Be an Ansible Pro</description>
    <generator>Hugo -- 0.123.7</generator>
    <language>en</language>
    <lastBuildDate>Sun, 13 Sep 2026 10:00:00 +0800</lastBuildDate>
    <atom:link href="https://ansible.cloudns.pro/post/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>使用 ansible-navigator 與 Execution Environment 執行 Playbook</title>
      <link>https://ansible.cloudns.pro/post/ansible-navigator/using-ansible-navigator/</link>
      <pubDate>Sun, 13 Sep 2026 10:00:00 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/ansible-navigator/using-ansible-navigator/</guid>
      <description>介紹如何使用 pipx 安裝 ansible-navigator，並透過容器化 Execution Environment (EE) 解決 Ansible 版本與目的端 Python/PowerShell 環境相容性問題。</description>
    </item>
    <item>
      <title>Template 裡 for 回圈內的變數處理</title>
      <link>https://ansible.cloudns.pro/post/tips/tip-template-nested-variable/</link>
      <pubDate>Sun, 23 Feb 2025 17:36:31 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/tips/tip-template-nested-variable/</guid>
      <description>&lt;p&gt;ansible template 模組的範本可以使用 jinja2 語法，在一般應用上足敷使用，真的要當程式來寫，for 回圈要配置變數時，就會遇到問題了。&lt;/p&gt;</description>
    </item>
    <item>
      <title>使用 ansible_lvm 要注意的地方</title>
      <link>https://ansible.cloudns.pro/post/system/ansible_lvm/</link>
      <pubDate>Sat, 14 Oct 2023 03:44:28 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/system/ansible_lvm/</guid>
      <description>&lt;p&gt;依據 &lt;a href=&#34;https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_vars_facts.html&#34;&gt;Discovering variables: facts and magic variables&lt;/a&gt; 這篇官方的文件，
ansible_facts 裡有提供 ansible_lvm，可以查到 LVM 的資訊，但實際上執行以後，卻沒看到。&lt;/p&gt;</description>
    </item>
    <item>
      <title>為 List 裡的每個元素加字串</title>
      <link>https://ansible.cloudns.pro/post/tips/tip-add-string-to-elements-in-list/</link>
      <pubDate>Sat, 14 Oct 2023 02:55:58 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/tips/tip-add-string-to-elements-in-list/</guid>
      <description>&lt;p&gt;想為 List 裡的每個元素加字串，也就是原本是這樣的 List&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;my_list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;- &lt;span class=&#34;l&#34;&gt;apple&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;- &lt;span class=&#34;l&#34;&gt;banana&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;- &lt;span class=&#34;l&#34;&gt;watermelon&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;要讓輸出結果變為&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;new_list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;- &lt;span class=&#34;s2&#34;&gt;&amp;#34;fruit: apple&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;- &lt;span class=&#34;s2&#34;&gt;&amp;#34;fruit: banana&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;- &lt;span class=&#34;s2&#34;&gt;&amp;#34;fruit: watermelon&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;那該怎麼做呢？有好幾種方式可以作&lt;/p&gt;</description>
    </item>
    <item>
      <title>Ansible Lightspeed With Watson Code Assistant</title>
      <link>https://ansible.cloudns.pro/post/ansible-lightspeed-with-watson-code-assistant/</link>
      <pubDate>Sun, 13 Aug 2023 22:20:41 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/ansible-lightspeed-with-watson-code-assistant/</guid>
      <description>Ansible 跟 IBM 合作推出了 Watson code assistant 以協助開發者撰寫 Ansible playbook，以下介紹一下怎麼使用。 安裝方法可以參考這篇：Installing the Ansible VS Code extension 安裝 Visual Studio</description>
    </item>
    <item>
      <title>寫 Ansible playbook 來作FTP上傳</title>
      <link>https://ansible.cloudns.pro/post/ansible-ftp/</link>
      <pubDate>Sun, 09 Jul 2023 16:32:55 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/ansible-ftp/</guid>
      <description>&lt;p&gt;要作檔案的複製，可以用 copy ，這會走 SSH 協定；網站檔案上傳，可以用 uri 模組，參數帶入 POST method ，就可以上傳檔案。&lt;/p&gt;
&lt;p&gt;那 FTP 檔案上傳，可以怎麼做呢？&lt;/p&gt;</description>
    </item>
    <item>
      <title>用 Ansible 取得 Kubernetes pod 資訊</title>
      <link>https://ansible.cloudns.pro/post/using-ansible-to-get-pod-kubernetes/</link>
      <pubDate>Fri, 23 Jun 2023 15:10:55 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/using-ansible-to-get-pod-kubernetes/</guid>
      <description>Using ansible to get pod information in kubernetes</description>
    </item>
    <item>
      <title>解壓縮只取第二層目錄以下的檔案與目錄</title>
      <link>https://ansible.cloudns.pro/post/tips/tip-extract-without-first-directory/</link>
      <pubDate>Wed, 03 May 2023 22:00:42 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/tips/tip-extract-without-first-directory/</guid>
      <description>&lt;p&gt;Angular/Vue 這類的前端框架，在執行 &lt;code&gt;npm run build&lt;/code&gt; 建置以後，會產生 dist 的資料夾，裏面就是要佈署的檔案。一般會使用 &lt;code&gt;tar czf dist.tar.gz dist&lt;/code&gt; 將該資料夾裡的檔案打包為 tarball。&lt;/p&gt;
&lt;p&gt;使用 Ansible 佈署時，需要使用 unarchive 模組解壓縮，這時會直接解壓縮出 dist 目錄。&lt;/p&gt;
&lt;p&gt;通常解法會有兩種，第一種是在打包時，先進入 dist 資料夾，再進行打包。&lt;/p&gt;
&lt;p&gt;第二種方法就是本文要介紹的小技巧。&lt;/p&gt;</description>
    </item>
    <item>
      <title>Install AWX on K8S(2)</title>
      <link>https://ansible.cloudns.pro/post/awx/install-awx-on-k8s-2/</link>
      <pubDate>Sun, 12 Mar 2023 13:33:33 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/awx/install-awx-on-k8s-2/</guid>
      <description>&lt;h2 id=&#34;說明&#34;&gt;說明&lt;/h2&gt;
&lt;p&gt;延續之前的安裝，接下來要安裝 microk8s。&lt;/p&gt;
&lt;p&gt;環境有兩個 node，一個 master 一個是 worker。&lt;/p&gt;</description>
    </item>
    <item>
      <title>blockinfile</title>
      <link>https://ansible.cloudns.pro/post/blockinfile/</link>
      <pubDate>Sun, 26 Feb 2023 17:06:28 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/blockinfile/</guid>
      <description>&lt;p&gt;用來確定檔案裡有指定文字片斷的模組，使用很簡單。&lt;/p&gt;</description>
    </item>
    <item>
      <title>等待 API 回應完成</title>
      <link>https://ansible.cloudns.pro/post/wait-for-url-to-respond-or-retry/</link>
      <pubDate>Wed, 25 Jan 2023 06:32:44 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/wait-for-url-to-respond-or-retry/</guid>
      <description>&lt;p&gt;情境是這樣的，Playbook 在送出 HTTP 請求後，需要送出一個 HTTP 請求去持續詢問是否完成，如果還沒完成，就等待一段時間後，再去詢問，那這個情境下可以怎麼做呢？&lt;/p&gt;</description>
    </item>
    <item>
      <title>使用ansible-Vault加密字串</title>
      <link>https://ansible.cloudns.pro/post/encrypt-string-using-vault/</link>
      <pubDate>Sat, 21 Jan 2023 06:46:13 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/encrypt-string-using-vault/</guid>
      <description>&lt;p&gt;在撰寫 Playbook 時，難免會用到敏感性的資訊，Ansible 提供了 ansible-vault 這個工具，可以針對檔案或是字串來做加密。&lt;/p&gt;
&lt;p&gt;如果變數內容需要加密的話，該怎麼使用呢？&lt;/p&gt;</description>
    </item>
    <item>
      <title>Script</title>
      <link>https://ansible.cloudns.pro/post/script/</link>
      <pubDate>Fri, 20 Jan 2023 21:59:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/script/</guid>
      <description>&lt;p&gt;以前我不知道有 script 模組，所以要執行自己的腳本，都是先把腳本複製過去，再用 shell/command 去執行。&lt;/p&gt;</description>
    </item>
    <item>
      <title>小技巧-檢查變數型態</title>
      <link>https://ansible.cloudns.pro/post/tips/tip-check-variable-type/</link>
      <pubDate>Sat, 31 Dec 2022 13:46:59 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/tips/tip-check-variable-type/</guid>
      <description>&lt;p&gt;使用模組常遇到的情況是不知道傳回來的變數是什麼型態，後續使用就不知道怎麼用。&lt;/p&gt;
&lt;p&gt;在這個時候可以怎麼做呢？&lt;/p&gt;</description>
    </item>
    <item>
      <title>Windows SSH setup</title>
      <link>https://ansible.cloudns.pro/post/windows-ssh-setup/</link>
      <pubDate>Sun, 25 Dec 2022 11:22:48 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/windows-ssh-setup/</guid>
      <description>&lt;p&gt;Ansible 可以透過 WinRM 連線到 Windows 主機進行操作，這部份的設置可以參考 &lt;a href=&#34;https://docs.ansible.com/ansible/latest/os_guide/windows_setup.html&#34;&gt;Setting up a Windows Host&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;這篇文章裡，有一部份是我之前沒注意到的，就是 Windows 主機除了可以用 WinRM 之外，也可以用 SSH 來操作。&lt;/p&gt;</description>
    </item>
    <item>
      <title>將指令輸出轉為圖片</title>
      <link>https://ansible.cloudns.pro/post/tips/tip-command-output-to-image/</link>
      <pubDate>Tue, 08 Nov 2022 14:38:00 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/tips/tip-command-output-to-image/</guid>
      <description>&lt;p&gt;最近需要連到遠端主機取得截圖，那就在想是不是有方法可以做到？&lt;/p&gt;</description>
    </item>
    <item>
      <title>Logstash 的安裝設定與日誌的轉送</title>
      <link>https://ansible.cloudns.pro/post/ansible-automation-platform/send-log-to-logstash/</link>
      <pubDate>Tue, 01 Nov 2022 00:15:56 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/ansible-automation-platform/send-log-to-logstash/</guid>
      <description>&lt;p&gt;在 Ansible Automation Controller 可以將日誌發送到其他的日誌聚合主機上，目前支援的日誌類型有&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Logstash&lt;/li&gt;
&lt;li&gt;splunk&lt;/li&gt;
&lt;li&gt;loggly&lt;/li&gt;
&lt;li&gt;sumologic&lt;/li&gt;
&lt;li&gt;other&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;這篇主要是說明 Logstash 該如何設置。&lt;/p&gt;</description>
    </item>
    <item>
      <title>使用 Red Hat OpenShift 來作為執行環境的平台</title>
      <link>https://ansible.cloudns.pro/post/ansible-automation-platform/on-demand-execution-with-red-hat-openshift/</link>
      <pubDate>Sun, 30 Oct 2022 14:49:38 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/ansible-automation-platform/on-demand-execution-with-red-hat-openshift/</guid>
      <description>&lt;p&gt;資料來源：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://www.ansible.com/blog/on-demand-execution-with-red-hat-openshift&#34;&gt;On-Demand execution with Red Hat OpenShift&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.automate.nyc/ansible/aap-container-group/&#34;&gt;How to setup an OpenShift container group with AAP&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Ansible Automation platform 裡的 Automation controller 在執行 playbook 時，已經改用 execution environment (執行環境)這個容器來執行了，換言之，若有建置 OpenShift 的話，應該也可以使用 OpenShift 的運算資源來運行執行環境。&lt;/p&gt;
&lt;p&gt;資料來源的文章就是在介紹設定的方法。&lt;/p&gt;</description>
    </item>
    <item>
      <title>Deploy Percona Server for Mongodb Replica Set</title>
      <link>https://ansible.cloudns.pro/post/database/deploy-percona-server-for-mongodb-replica-set/</link>
      <pubDate>Mon, 24 Oct 2022 00:07:51 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/database/deploy-percona-server-for-mongodb-replica-set/</guid>
      <description>&lt;p&gt;在推特上看到有人分享這篇：&lt;a href=&#34;https://www.percona.com/blog/deploy-percona-server-for-mongodb-replica-set-with-ansible/&#34;&gt;Deploy Percona Server for MongoDB Replica Set With Ansible - Percona Database Performance Blog&lt;/a&gt;，覺得挺值得參考的。&lt;/p&gt;
&lt;p&gt;你能學到什麼？&lt;/p&gt;</description>
    </item>
    <item>
      <title>Terrible</title>
      <link>https://ansible.cloudns.pro/post/terrible/</link>
      <pubDate>Sun, 16 Oct 2022 13:23:07 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/terrible/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://terrible.readthedocs.io/en/latest/readme.html&#34;&gt;Terrible&lt;/a&gt; 不是「糟糕」的意思，而是 Terraform + Ansible = TERRAform to ansiBLE 。&lt;/p&gt;
&lt;p&gt;簡單的說，是可以從 terraform state 檔案產出 inventory 的工具。&lt;/p&gt;</description>
    </item>
    <item>
      <title>Ansible Become in role</title>
      <link>https://ansible.cloudns.pro/post/ansible-become-in-role/</link>
      <pubDate>Sat, 15 Oct 2022 09:03:29 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/ansible-become-in-role/</guid>
      <description>&lt;p&gt;上週在測試 playbook 時，發現 become 行為不如我預期。&lt;/p&gt;</description>
    </item>
    <item>
      <title>Ansible Facts</title>
      <link>https://ansible.cloudns.pro/post/ansible-facts/</link>
      <pubDate>Sat, 15 Oct 2022 08:28:22 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/ansible-facts/</guid>
      <description>什麼是 Facts? 該怎麼使用?</description>
    </item>
    <item>
      <title>include_tasks 與 import_tasks 的差異</title>
      <link>https://ansible.cloudns.pro/post/difference-between-include-and-import/</link>
      <pubDate>Sun, 09 Oct 2022 15:55:27 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/difference-between-include-and-import/</guid>
      <description>&lt;p&gt;Ansible 2.4 以後引入了 include_tasks 與 import_tasks ，那這兩者的差異在哪裡呢？&lt;/p&gt;</description>
    </item>
    <item>
      <title>Ansible Automation Platform Upgrade assistant</title>
      <link>https://ansible.cloudns.pro/post/ansible-automation-platform/upgrade-assistant/</link>
      <pubDate>Sun, 02 Oct 2022 11:37:31 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/ansible-automation-platform/upgrade-assistant/</guid>
      <description>Ansible Automation Platform Upgrade assistant</description>
    </item>
    <item>
      <title>Automation Hub 的8個跟 Execution environment 相關的功能</title>
      <link>https://ansible.cloudns.pro/post/ansible-automation-platform/automation-hub/</link>
      <pubDate>Sat, 01 Oct 2022 21:02:25 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/ansible-automation-platform/automation-hub/</guid>
      <description>&lt;p&gt;Red Hat Ansible automation platform 引入了 Execution Environment ，Execution Environment 說穿了，就是包著 Ansible 執行環境的容器映像。
原本裏面有的 Automation hub 軟體可以怎麼跟 Execution Environment 結合呢?&lt;/p&gt;</description>
    </item>
    <item>
      <title>如何把 block 放在回圈裡？</title>
      <link>https://ansible.cloudns.pro/post/block-with-loop/</link>
      <pubDate>Sat, 01 Oct 2022 14:33:09 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/block-with-loop/</guid>
      <description>&lt;p&gt;因為之前寫程式的經驗，很直覺的想可以在 block 加上 loop，像這樣&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;- &lt;span class=&#34;nt&#34;&gt;set_fact&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;user_list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;- &lt;span class=&#34;l&#34;&gt;John&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;- &lt;span class=&#34;l&#34;&gt;Mary&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;- &lt;span class=&#34;l&#34;&gt;Jane&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;- &lt;span class=&#34;nt&#34;&gt;block&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;- &lt;span class=&#34;nt&#34;&gt;debug&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;msg&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;start of loop&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;- &lt;span class=&#34;nt&#34;&gt;debug&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;msg&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;Hello {{ item }}&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;- &lt;span class=&#34;nt&#34;&gt;debug&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;msg&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;end of loop&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;loop&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;{{ user_list }}&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <title>序列</title>
      <link>https://ansible.cloudns.pro/post/sequence/</link>
      <pubDate>Sun, 25 Sep 2022 19:29:11 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/sequence/</guid>
      <description>&lt;p&gt;之前想要產生一堆使用者，例如 user01, user02, user03&amp;hellip; ，那時候在想用 with_items 或 loop 要怎麼做？好像沒有好的方法，找了好一會，才在 Ansible 文件裡找到，原來 Ansible 已經有內建序列可以這樣用了。&lt;/p&gt;</description>
    </item>
    <item>
      <title>AnsibleFest-2022</title>
      <link>https://ansible.cloudns.pro/post/news/ansiblefest-2022/</link>
      <pubDate>Wed, 21 Sep 2022 23:37:55 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/news/ansiblefest-2022/</guid>
      <description>&lt;p&gt;2022 年 10 月 18 日 ~ 2022 年 10 月 19 日，Red Hat 將在 Chicago 舉辦 AnsibleFest 2022，有多項議程也有可以實作的工作坊，有興趣的人可以透過這個連結報名：http://ansiblefest.com/&lt;/p&gt;</description>
    </item>
    <item>
      <title>ansible.posix.firewalld</title>
      <link>https://ansible.cloudns.pro/post/system/firewalld/</link>
      <pubDate>Sun, 18 Sep 2022 21:43:59 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/system/firewalld/</guid>
      <description>ansible.posix.firewalld</description>
    </item>
    <item>
      <title>如何取得主機的IP</title>
      <link>https://ansible.cloudns.pro/post/system/get-host-ip/</link>
      <pubDate>Sat, 03 Sep 2022 14:41:16 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/system/get-host-ip/</guid>
      <description>&lt;p&gt;Ansible 本身在連線時，就會取得主機的相關資訊，這裏面就包含了 IP。&lt;/p&gt;</description>
    </item>
    <item>
      <title>取得所有 SATA 的磁碟</title>
      <link>https://ansible.cloudns.pro/post/system/get-all-ata-disks/</link>
      <pubDate>Sat, 03 Sep 2022 08:32:48 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/system/get-all-ata-disks/</guid>
      <description>&lt;p&gt;最近要使用 smartmontools 套件裡的 smartctl 來查閱硬碟的 S.M.A.R.T. 狀態，做定期檢查，以免來不及去備份跟更換。這邊打算寫 ansible playbook 來作，所以就需要先取得主機上的所有硬碟。
好在 Ansible 本身在收集資訊時，就已經收集了，只是，這裏面還包含有 CD-ROM、Loop 等的裝置，我只想要 SATA 類型的啊~&lt;/p&gt;</description>
    </item>
    <item>
      <title>小技巧 - 如何在迴圈裡註冊變數</title>
      <link>https://ansible.cloudns.pro/post/tips/tip-register-variable-in-loop/</link>
      <pubDate>Sat, 03 Sep 2022 05:48:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/tips/tip-register-variable-in-loop/</guid>
      <description>&lt;p&gt;單一個模組執行結果，可以使用 register 把結果放到變數裡。&lt;/p&gt;
&lt;p&gt;如果這模組要搭配迴圈執行多次，又要把結果放到變數裡時，要怎麼寫呢？因為之前沒有用過，腦袋不禁打結了，心裡開始在盤算該怎麼處理比較好？但好在，早有人提出解答。&lt;/p&gt;</description>
    </item>
    <item>
      <title>Install AWX on K8S(1)</title>
      <link>https://ansible.cloudns.pro/post/awx/install-awx-on-k8s-1/</link>
      <pubDate>Sun, 28 Aug 2022 15:33:33 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/awx/install-awx-on-k8s-1/</guid>
      <description>&lt;h2 id=&#34;說明&#34;&gt;說明&lt;/h2&gt;
&lt;p&gt;現在新版的 AWX 依照官方網站的說法，只能安裝在容器平台上了，接下來的幾篇文將說明一下如何安裝 AWX。&lt;/p&gt;</description>
    </item>
    <item>
      <title>YAML 裡的字串很長該怎麼做？</title>
      <link>https://ansible.cloudns.pro/post/long-string-in-yaml/</link>
      <pubDate>Sat, 27 Aug 2022 20:58:20 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/long-string-in-yaml/</guid>
      <description>&lt;p&gt;Playbook 是使用 YAML 格式，在使用上難免會遇到要放很長的字串的情況，想保留可讀性又不想有多餘的換行符號，該怎麼辦呢？&lt;/p&gt;</description>
    </item>
    <item>
      <title>如何在 list 裡新增內容或合併兩個 list?</title>
      <link>https://ansible.cloudns.pro/post/tips/tip-append-list/</link>
      <pubDate>Sun, 07 Aug 2022 14:55:01 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/tips/tip-append-list/</guid>
      <description>How to append list or merge 2 lists?</description>
    </item>
    <item>
      <title>postgresql_user</title>
      <link>https://ansible.cloudns.pro/post/database/postgresql_user/</link>
      <pubDate>Sun, 05 Jun 2022 21:46:13 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/database/postgresql_user/</guid>
      <description>&lt;p&gt;使用 postgresql_xxx 的模組存取 Postgresql 資料庫時，一般會需要切換為 postgres 使用者來進行操作。在 Ansible 可以怎麼去做呢？&lt;/p&gt;</description>
    </item>
    <item>
      <title>Ansible Automation Platform 2.2</title>
      <link>https://ansible.cloudns.pro/post/ansible-automation-platform/aap-2.2.0/</link>
      <pubDate>Sat, 04 Jun 2022 14:07:56 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/ansible-automation-platform/aap-2.2.0/</guid>
      <description>Ansible Automation Platform 2.2</description>
    </item>
    <item>
      <title>小技巧 - 取得字串中指定的部份</title>
      <link>https://ansible.cloudns.pro/post/tips/tip-extract-part-of-string/</link>
      <pubDate>Sat, 14 May 2022 11:31:27 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/tips/tip-extract-part-of-string/</guid>
      <description>&lt;p&gt;有些時候，會需要取得字串中的某個部份來使用，這時候可以怎麼做呢？&lt;/p&gt;</description>
    </item>
    <item>
      <title>RHEL 8.6 與 9.0 以後的 Ansible</title>
      <link>https://ansible.cloudns.pro/post/updates-to-using-ansible-in-rhel-8.6-9.0/</link>
      <pubDate>Fri, 13 May 2022 16:57:47 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/updates-to-using-ansible-in-rhel-8.6-9.0/</guid>
      <description>&lt;p&gt;前兩天是 Red Hat Summit，Red Hat 也趁勢公佈了一個消息： &lt;a href=&#34;https://www.redhat.com/en/blog/updates-using-ansible-rhel-86-and-90&#34;&gt;Updates to using Ansible in RHEL 8.6 and 9.0&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>如何使用debug模組</title>
      <link>https://ansible.cloudns.pro/post/debug/</link>
      <pubDate>Fri, 29 Apr 2022 22:31:40 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/debug/</guid>
      <description>&lt;p&gt;debug 模組的用途，顧名思義就是除錯用的，一般用來在 playbook 裡列印變數內容，或是指定的訊息。在預設的情況下，模組只會有狀態的輸出，
像是 changed, ignored 等等的，使用 debug 模組，就可以印出變數內容或者是運算式的結果。基本上就把他想做是 bash 裡的 echo，或是 python 裡的 print。&lt;/p&gt;</description>
    </item>
    <item>
      <title>分析任務執行時間</title>
      <link>https://ansible.cloudns.pro/post/profiling-tasks/</link>
      <pubDate>Mon, 18 Apr 2022 10:13:43 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/profiling-tasks/</guid>
      <description>&lt;p&gt;在遇到執行 playbook 花費較多時間的情況時，該怎麼去進行分析，找出執行效能瓶頸呢？&lt;/p&gt;
&lt;p&gt;在 ansible-core 2.15 版以前，可以在 ansible.cfg 裡加上 &lt;code&gt;callback_whitelist = profile_tasks&lt;/code&gt; 來進行分析。
在 ansible-core 2.15 版以後，就強制要使用新的設定 &lt;code&gt;callback_enabled = profile_tasks&lt;/code&gt; 了。&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rundeck 的 Ansible 整合</title>
      <link>https://ansible.cloudns.pro/post/rundeck-and-ansible-integration/</link>
      <pubDate>Sun, 03 Apr 2022 20:19:19 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/rundeck-and-ansible-integration/</guid>
      <description>介紹如何使用 Rundeck 的 Ansible 整合功能</description>
    </item>
    <item>
      <title>ansible_user 與 remote_user 的差異</title>
      <link>https://ansible.cloudns.pro/post/ansible_user-and-remote_user/</link>
      <pubDate>Sun, 27 Mar 2022 12:20:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/ansible_user-and-remote_user/</guid>
      <description>&lt;p&gt;有同事問我這兩個變數的差異在哪裡？&lt;/p&gt;
&lt;p&gt;我查了之後才知道，其實是一樣的。這部份可以在 ansible 原始碼裏面看到。&lt;/p&gt;</description>
    </item>
    <item>
      <title>Windows-取得本機帳號清單</title>
      <link>https://ansible.cloudns.pro/post/windows-get-local-users/</link>
      <pubDate>Fri, 11 Mar 2022 12:20:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/windows-get-local-users/</guid>
      <description>&lt;p&gt;在 Windows 要取得本機帳號清單，Ansible 沒有這樣的模組，只能透過 win_shell 或 win_powershell 來達成。&lt;/p&gt;
&lt;p&gt;PowerShell 要使用的指令是 &lt;code&gt;Get-LocalUser&lt;/code&gt; 。&lt;/p&gt;</description>
    </item>
    <item>
      <title>將 List 轉置為 dict 的 list</title>
      <link>https://ansible.cloudns.pro/post/how-to-transform-list-to-object-list/</link>
      <pubDate>Fri, 25 Feb 2022 17:58:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/how-to-transform-list-to-object-list/</guid>
      <description>&lt;p&gt;需求是這樣子的，需要把 List 裡的元素轉置為 dict，再放到 List 裡。&lt;/p&gt;
&lt;p&gt;也就是&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;my_users&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;- &lt;span class=&#34;l&#34;&gt;aaa&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;- &lt;span class=&#34;l&#34;&gt;bbb&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;- &lt;span class=&#34;l&#34;&gt;ccc&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;要轉換為&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;my_users&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;- &lt;span class=&#34;nt&#34;&gt;Name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;aaa&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;- &lt;span class=&#34;nt&#34;&gt;Name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;bbb&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;- &lt;span class=&#34;nt&#34;&gt;Name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;ccc&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;用 Ansible 該怎麼做呢？看這篇：&lt;a href=&#34;https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html&#34;&gt;Using filters to manipulate data&lt;/a&gt; 看了好久，都沒找到適合的 filter&amp;hellip;&lt;/p&gt;</description>
    </item>
    <item>
      <title>最簡單的 git server</title>
      <link>https://ansible.cloudns.pro/post/simplest-git-server/</link>
      <pubDate>Tue, 15 Feb 2022 23:20:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/simplest-git-server/</guid>
      <description>&lt;p&gt;一般來說，Ansible Playbook 要讓 Ansible Tower (或新的名字 Ansible Automation Controller) 或 AWX 使用，有幾種方式：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;放在 Ansible Tower / Ansible Automation Controller / AWX 的主機裡，這樣的作法是最簡單，但若需要放新的 playbook 進去，勢必要使用 SSH 登入，然後才能處理。&lt;/li&gt;
&lt;li&gt;放在 git server，這是 Best practice，一來 playbook 的變更有紀錄可循，二來也能很方便的取用。但缺點是需要架設 git server，這時候就會自建 gitlab、gitea 或是放在外部的 github、gitlab 。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;這裡要介紹一種方式，是我突然想到的，也是我之前忽略的。&lt;/p&gt;
&lt;p&gt;git server 本身只要有 SSH server ，其實就可以了，無需額外架設。架設的方法可以參考 &lt;a href=&#34;https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server&#34;&gt;Setting up the server&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;以下紀錄如何進行&lt;/p&gt;</description>
    </item>
    <item>
      <title>研究-ansible_distribution</title>
      <link>https://ansible.cloudns.pro/post/study-ansible_distribution/</link>
      <pubDate>Fri, 11 Feb 2022 12:20:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/study-ansible_distribution/</guid>
      <description>&lt;p&gt;最近想要試著在 Oracle Linux 上安裝 Ansible Tower，Ansible Tower 的安裝腳本會中止安裝，
因為這並不是 Ansible Tower 所支援的發行版，那我就想是不是可以繞過 Linux 發行版本的檢查。&lt;/p&gt;
&lt;p&gt;在 Ansible Tower 的安裝腳本裡去找，有找到，但卻太複雜，改不了，大致知道是依據 facts 來做。
那只好退而求其次，改為修改 ansible_distribution 這變數，看能不能騙過 Ansible Tower 的安裝腳本。&lt;/p&gt;</description>
    </item>
    <item>
      <title>LVM - lvg and lvol</title>
      <link>https://ansible.cloudns.pro/post/system/lvm/</link>
      <pubDate>Tue, 25 Jan 2022 21:20:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/system/lvm/</guid>
      <description>&lt;p&gt;最近幫同事看 DRBD 還有準備考 RHCSA/RHCE，就想說可以趁這機會來練習如何用 Ansible 來操作磁碟分割區與 LVM。&lt;/p&gt;
&lt;p&gt;這邊有個誤會，我一直以來都以為 pvcreate / vgcreate / lvcreate 都有對應的模組可以使用，經過這次研讀後，發現只要用到 lvg 跟 lvol 這兩個模組就可以來建立。&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://docs.ansible.com/ansible/latest/collections/community/general/lvg_module.html&#34;&gt;community.general.lvg&lt;/a&gt; 是 LVM volume groups 的縮寫, 主要是用來設置 LVM volume groups 的模組。
這個模組包辦了 pvcreate / vgcreate 這兩個指令。&lt;/p&gt;</description>
    </item>
    <item>
      <title>使用 ara 來側錄 Ansible Playbook</title>
      <link>https://ansible.cloudns.pro/post/recording-ansible-playbooks-with-ara/</link>
      <pubDate>Wed, 19 Jan 2022 21:20:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/recording-ansible-playbooks-with-ara/</guid>
      <description>&lt;p&gt;在 Reddit 上看到有趣的標題：&lt;a href=&#34;https://ara.recordsansible.org/blog/2021/12/23/recording-ansible-playbooks-from-awx-with-ara/&#34;&gt;Recording Ansible playbooks from AWX with ara&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;覺得有趣是因為居然可以側錄 Playbook ，而且從文章看起來，可以不需要使用 Ansible Tower / AWX 就可以很方便的去查閱執行結果，這種好東西要找時間來試試看。&lt;/p&gt;</description>
    </item>
    <item>
      <title>如何偵測受管主機上的Python版本</title>
      <link>https://ansible.cloudns.pro/post/system/detect-python-version/</link>
      <pubDate>Mon, 17 Jan 2022 21:20:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/system/detect-python-version/</guid>
      <description>&lt;p&gt;因為需要知道受管主機上的 Python，所以就弄了個簡單的 Playbook 來偵測。&lt;/p&gt;
&lt;p&gt;Ansible 因為本身需要 Python 來運行 Playbook，自然會收集 Python 的資訊以作為執行的參考。&lt;/p&gt;</description>
    </item>
    <item>
      <title>如何在 vim 直接查詢 ansible module 使用方法</title>
      <link>https://ansible.cloudns.pro/post/how-to-use-ansible-doc-manpages-in-vim/</link>
      <pubDate>Wed, 29 Dec 2021 21:20:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/how-to-use-ansible-doc-manpages-in-vim/</guid>
      <description>&lt;p&gt;今天在 Reddit 上看到這篇：&lt;a href=&#34;https://www.reddit.com/r/ansible/comments/rqyrx7/how_to_use_ansibledoc_manpages_in_vim/&#34;&gt;How to use ansible-doc manpages in vim : ansible&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;覺得很實用，就來介紹一下。&lt;/p&gt;</description>
    </item>
    <item>
      <title>安裝 Ansible Automation Platform 2.1.0</title>
      <link>https://ansible.cloudns.pro/post/ansible-automation-platform-2.1.0-installation/</link>
      <pubDate>Mon, 06 Dec 2021 14:08:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/ansible-automation-platform-2.1.0-installation/</guid>
      <description>&lt;p&gt;這篇主要是講如何安裝 Ansible Automation Platform 2.1.0 。&lt;/p&gt;
&lt;p&gt;硬體需求：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;CPUs: 4&lt;/li&gt;
&lt;li&gt;RAM: 16G&lt;/li&gt;
&lt;/ul&gt;</description>
    </item>
    <item>
      <title>安裝 AWX 17.1.0</title>
      <link>https://ansible.cloudns.pro/post/awx/awx-17.1.0-installation/</link>
      <pubDate>Sun, 05 Dec 2021 14:08:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/awx/awx-17.1.0-installation/</guid>
      <description>&lt;p&gt;AWX 目前最新版本是 19.5.0，從 18.0.0 開始，安裝方法只有一種，就是以 AWX Operator 形式安裝在 k8s / OpenShift 上。&lt;/p&gt;
&lt;p&gt;想要安裝到本機使用，只有兩種方法，第一種是安裝為開發 AWX 用的環境，第二種方法是退版，使用 17.1.0。這邊要介紹的是第二種方法，安裝 17.1.0。&lt;/p&gt;</description>
    </item>
    <item>
      <title>Ansible Tower license 檔案的格式</title>
      <link>https://ansible.cloudns.pro/post/ansible-tower-license-file-format/</link>
      <pubDate>Thu, 02 Dec 2021 17:58:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/ansible-tower-license-file-format/</guid>
      <description>&lt;p&gt;在購買 Ansible Tower license 或是取得 Ansible Tower Trial license 以後，一般可以直接在 Ansible Tower 裡登入 RHN 帳號，
從而取得 license。但是在離線環境的時候，就沒辦法這樣做，這時候得從 &lt;a href=&#34;https://acccess.redhat.com&#34;&gt;https://acccess.redhat.com&lt;/a&gt; 網站上進行訂閱分配，然後取得
license 檔案。這個檔案就可以在離線環境的時候，提供給 Ansible Tower 使用。&lt;/p&gt;</description>
    </item>
    <item>
      <title>以指令設定 Ansible Tower 的 License</title>
      <link>https://ansible.cloudns.pro/post/upload-ansible-tower-license-in-cli/</link>
      <pubDate>Mon, 29 Nov 2021 15:58:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/upload-ansible-tower-license-in-cli/</guid>
      <description>&lt;p&gt;這兩天遇到一個狀況，以瀏覽器登入 Ansible Tower 網站，發生了無法設定 License 的情況。是故，只能透過 CLI 方式來進行。&lt;/p&gt;
&lt;p&gt;方法有幾個：&lt;/p&gt;</description>
    </item>
    <item>
      <title>ansible-builder</title>
      <link>https://ansible.cloudns.pro/post/ansible-builder/</link>
      <pubDate>Thu, 25 Nov 2021 14:08:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/ansible-builder/</guid>
      <description>&lt;p&gt;轉貼去年 12 月時寫的 ansible-builder。&lt;/p&gt;
&lt;p&gt;看到這篇：&lt;a href=&#34;https://www.ithome.com.tw/news/141682&#34;&gt;紅帽推出IT自動化工具Ansible Builder以加速執行環境創建 | iThome&lt;/a&gt;，所以就來試試看。&lt;/p&gt;
&lt;p&gt;就我試用過以後，我的理解是，這工具可以幫忙創建出一個具有 Ansible 環境的 container image。&lt;/p&gt;</description>
    </item>
    <item>
      <title>Ansible automation Platform 2</title>
      <link>https://ansible.cloudns.pro/post/ansible-automation-platform-2/</link>
      <pubDate>Sun, 07 Nov 2021 14:08:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/ansible-automation-platform-2/</guid>
      <description>&lt;p&gt;在9月底的時候，Red Hat 釋出了 Ansible Automation Platform 2，詳情可以參考： &lt;a href=&#34;https://www.ansible.com/blog/introducing-ansible-automation-platform-2&#34;&gt;Introducing Ansible Automation Platform 2&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>佈署 repository 伺服器的 Playbook</title>
      <link>https://ansible.cloudns.pro/post/mirror-repository/</link>
      <pubDate>Wed, 08 Sep 2021 21:58:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/mirror-repository/</guid>
      <description>&lt;p&gt;要怎麼佈署 repository 伺服器呢？&lt;/p&gt;
&lt;p&gt;這蠻簡單的，可以參考&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://www.redhat.com/sysadmin/how-mirror-repository&#34;&gt;https://www.redhat.com/sysadmin/how-mirror-repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://gist.github.com/ziozzang/f37f04c27cff85f093e146a27537fe81&#34;&gt;https://gist.github.com/ziozzang/f37f04c27cff85f093e146a27537fe81&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;受管主機的環境：RHEL 8.2&lt;/p&gt;</description>
    </item>
    <item>
      <title>Ansible 4.3.0</title>
      <link>https://ansible.cloudns.pro/post/ansible-4.3.0/</link>
      <pubDate>Mon, 06 Sep 2021 22:20:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/ansible-4.3.0/</guid>
      <description>&lt;p&gt;Ansible 4.3.0 在 2021/07/20 釋出了。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;公告： (&lt;a href=&#34;https://groups.google.com/g/ansible-announce/c/ssbMIqs4qNM&#34;&gt;Ansible 4.3.0 final has been released!&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/ansible-community/ansible-build-data/blob/main/4/CHANGELOG-v4.rst#v4-3-0&#34;&gt;ChangeLog&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;這一版有什麼新的功能呢？摘錄如下&lt;/p&gt;</description>
    </item>
    <item>
      <title>Keepalived</title>
      <link>https://ansible.cloudns.pro/post/setup-keepalived/</link>
      <pubDate>Tue, 31 Aug 2021 19:58:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/setup-keepalived/</guid>
      <description>&lt;p&gt;主要是想試著用 vagrant 搭建 keepalived 環境來練習。&lt;/p&gt;
&lt;p&gt;環境需要四台機器：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;keepalived: 兩台，一台 master，一台 slave，這兩台同時也會安裝 HAProxy。
&lt;ul&gt;
&lt;li&gt;主機名稱：master, 192.168.60.11&lt;/li&gt;
&lt;li&gt;主機名稱：slave: 192.168.60.12&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Apache: 一台，當作是 HAProxy 的 backend。
&lt;ul&gt;
&lt;li&gt;主機名稱：u3&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Bastion: 一台，當作是客戶端，用來存取 VIP。
&lt;ul&gt;
&lt;li&gt;主機名稱：u4&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;</description>
    </item>
    <item>
      <title>Ansible navigator</title>
      <link>https://ansible.cloudns.pro/post/ansible-navigator/</link>
      <pubDate>Sun, 29 Aug 2021 15:58:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/ansible-navigator/</guid>
      <description>&lt;p&gt;在看 Ansible 4.1.0 的釋出新聞時，看到 Ansible navigator 這個專案，這個專案的網址是在 &lt;a href=&#34;https://github.com/ansible/ansible-navigator&#34;&gt;GitHub - ansible/ansible-navigator: A text-based user interface (TUI) for the Red Hat Ansible Automation Platform.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;從說明可以得知，這是 Ansible Automation Platform 的 text-based 使用者介面 (TUI)，而不是 Ansible Tower 的 text-based 使用者介面，這讓我有點小失望。&lt;/p&gt;</description>
    </item>
    <item>
      <title>如何判別 Linux 發行版</title>
      <link>https://ansible.cloudns.pro/post/system/detect-distribution/</link>
      <pubDate>Fri, 13 Aug 2021 10:58:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/system/detect-distribution/</guid>
      <description>&lt;p&gt;Task 要依據 Linux 發行版來處理，該怎麼做呢？&lt;/p&gt;
&lt;p&gt;這些資訊在 gather_facts 後，會放到 ansible_facts 裡，在寫 task 時，就可以直接使用。&lt;/p&gt;
&lt;p&gt;主要的變數有這幾個：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;ansible_distribution: 發行版名稱，例如 &amp;ldquo;CentOS&amp;rdquo;&lt;/li&gt;
&lt;li&gt;ansible_distribution_major_version: 發行版主要版號，例如 &amp;ldquo;7&amp;rdquo;&lt;/li&gt;
&lt;li&gt;ansible_distribution_version: 發行版版本，例如 &amp;ldquo;7.5.1804&amp;rdquo;&lt;/li&gt;
&lt;li&gt;ansible_os_family: 發行版家族名稱，例如 CentOS 的 ansible_os_family 會是 RedHat&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;要看 ansible_facts 還有哪些變數可使用，可以參考 &lt;a href=&#34;https://docs.ansible.com/ansible/latest/user_guide/playbooks_vars_facts.html&#34;&gt;Discovering variables: facts and magic variables — Ansible Documentation&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Ansible 4.2.0</title>
      <link>https://ansible.cloudns.pro/post/ansible-4.2.0/</link>
      <pubDate>Sun, 18 Jul 2021 22:20:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/ansible-4.2.0/</guid>
      <description>&lt;p&gt;Ansible 4.2.0 在 2021/06/30 釋出了。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;公告： (&lt;a href=&#34;https://groups.google.com/g/ansible-devel/c/J1Yr2Fa2fgc&#34;&gt;Ansible 4.2.0 final has been released!&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/ansible-community/ansible-build-data/blob/main/4/CHANGELOG-v4.rst#v4-2-0&#34;&gt;ChangeLog&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;這一版有什麼新的功能呢？摘錄如下&lt;/p&gt;</description>
    </item>
    <item>
      <title>Ansible 4.1.0</title>
      <link>https://ansible.cloudns.pro/post/ansible-4.1.0/</link>
      <pubDate>Sun, 18 Jul 2021 15:58:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/ansible-4.1.0/</guid>
      <description>&lt;p&gt;Ansible 4.1.0 在 2021/06/11 釋出了。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;公告： (&lt;a href=&#34;https://groups.google.com/g/ansible-devel/c/JnJU7g0XjLo&#34;&gt;Ansible 4.1.0 final has been released!&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/ansible-community/ansible-build-data/blob/main/4/CHANGELOG-v4.rst#v4-1-0&#34;&gt;ChangeLog&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;這一版有什麼新的功能呢？摘錄如下&lt;/p&gt;</description>
    </item>
    <item>
      <title>Ansible 4.0.0</title>
      <link>https://ansible.cloudns.pro/post/ansible-4.0.0/</link>
      <pubDate>Sun, 11 Jul 2021 15:58:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/ansible-4.0.0/</guid>
      <description>&lt;p&gt;Ansible 在 2021 年五月中的時候釋出了。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;公告： (&lt;a href=&#34;https://groups.google.com/g/ansible-announce/c/H7LvB-uYMWg&#34;&gt;Ansible 4.0.0 final has been released!&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/ansible-community/ansible-build-data/blob/main/4/CHANGELOG-v4.rst#v4-0-0&#34;&gt;ChangeLog&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;這一版有什麼新的功能呢？摘錄如下&lt;/p&gt;</description>
    </item>
    <item>
      <title>[網友好文]Cisco UCS CIMC系列文章</title>
      <link>https://ansible.cloudns.pro/post/cisco-ucs-cimc/</link>
      <pubDate>Wed, 07 Jul 2021 08:00:00 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/cisco-ucs-cimc/</guid>
      <description>&lt;p&gt;網友 &lt;a href=&#34;https://www.weithenn.org&#34;&gt;Weithenn&lt;/a&gt; 分享的好文，是講怎麼用 Ansible 設定 Cisco UCS CIMC 的文章，現整理目錄如下：&lt;/p&gt;</description>
    </item>
    <item>
      <title>Module 預設值 - module defaults</title>
      <link>https://ansible.cloudns.pro/post/module-defaults/</link>
      <pubDate>Sat, 03 Jul 2021 17:19:41 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/module-defaults/</guid>
      <description>&lt;p&gt;前一陣子在撰寫 playbook 操作 OpenShift 時，常常模組是同一個，裏面的 kubeconfig 是固定的，寫起來就很重複。
在以前不知道有 &lt;code&gt;module_defaults&lt;/code&gt; 的時候，都是用變數來處理。現在知道有 &lt;code&gt;module_defaults&lt;/code&gt; 以後，就可以用這個語法來處理了。&lt;/p&gt;</description>
    </item>
    <item>
      <title>小技巧 - 在 --extra-vars 帶入 boolean 變數</title>
      <link>https://ansible.cloudns.pro/post/tips/tip-extra-vars-with-boolean-variable/</link>
      <pubDate>Sat, 15 May 2021 12:19:41 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/tips/tip-extra-vars-with-boolean-variable/</guid>
      <description>&lt;p&gt;前兩天在執行 playbook 時，想試著以 &amp;ndash;extra-vars / -e 帶入 boolean 型態的變數，卻發現怎麼傳都不行。&lt;/p&gt;</description>
    </item>
    <item>
      <title>如何執行 oc start-build</title>
      <link>https://ansible.cloudns.pro/post/how-to-run-oc-start-build/</link>
      <pubDate>Wed, 12 May 2021 14:58:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/how-to-run-oc-start-build/</guid>
      <description>&lt;p&gt;&lt;code&gt;oc start-build&lt;/code&gt; 是 OpenShift 裡很方便的一個指令，事先建立好 build config 以後，就可以用 start-build 來指示 openshift 來幫忙建置，在建置完成以後，就自動完成佈署了。&lt;/p&gt;
&lt;p&gt;等等，那 &lt;code&gt;oc start-build&lt;/code&gt; 不是直接用 command/shell 模組就可以完成了嗎？為什麼還需要特別寫？
這是因為使用指令的話，在同時執行多個工作時，在後續的 &lt;code&gt;oc get&lt;/code&gt; 會有些問題，所以才想去試試。&lt;/p&gt;</description>
    </item>
    <item>
      <title>ansible.builtin.slurp - 讀取檔案內容</title>
      <link>https://ansible.cloudns.pro/post/slurp-read-file-content/</link>
      <pubDate>Wed, 12 May 2021 10:58:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/slurp-read-file-content/</guid>
      <description>&lt;p&gt;在某些情況需要讀取檔案內容，例如送出 HTTP POST 請求，或者是需要對內容編碼，那麼可以怎麼去寫 Playbook 呢？&lt;/p&gt;</description>
    </item>
    <item>
      <title>OpenShift</title>
      <link>https://ansible.cloudns.pro/post/openshift/</link>
      <pubDate>Tue, 04 May 2021 11:58:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/openshift/</guid>
      <description>&lt;p&gt;要存取 OpenShift ，可以透過 community.okd 這個模組來達成&lt;/p&gt;</description>
    </item>
    <item>
      <title>ansible_date_time</title>
      <link>https://ansible.cloudns.pro/post/system/ansible_date_time/</link>
      <pubDate>Mon, 03 May 2021 15:58:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/system/ansible_date_time/</guid>
      <description>&lt;p&gt;仔細算算，已經查了 ansible_date_time 這個變數的用法超過三次，所以記錄一下，以後查找也方便。&lt;/p&gt;</description>
    </item>
    <item>
      <title>Ansible Tower - Launch job template API 未處理 extra vars</title>
      <link>https://ansible.cloudns.pro/post/tower-job-template-with-extra-vars/</link>
      <pubDate>Mon, 26 Apr 2021 15:19:41 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/tower-job-template-with-extra-vars/</guid>
      <description>&lt;h2 id=&#34;狀況描述&#34;&gt;狀況描述&lt;/h2&gt;
&lt;p&gt;在 Ansible Tower 上已經設置好 Job template，Playbook 會接收 version 參數，但使用 tower-cli 或 curl 去呼叫 API 帶入 version 啟動 job template 後，發現 playbook 沒有用到 version&lt;/p&gt;</description>
    </item>
    <item>
      <title>小技巧 - 執行指定的 task</title>
      <link>https://ansible.cloudns.pro/post/tips/tip-running-selected-task/</link>
      <pubDate>Sat, 24 Apr 2021 14:19:41 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/tips/tip-running-selected-task/</guid>
      <description>&lt;p&gt;要執行指定的 Tasks 時，可以藉著 tag 來幫助我們。&lt;/p&gt;</description>
    </item>
    <item>
      <title>小技巧 - 遇到需要兩個大括號該怎麼辦？</title>
      <link>https://ansible.cloudns.pro/post/tips/tip-escape-double-brace/</link>
      <pubDate>Tue, 20 Apr 2021 18:13:29 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/tips/tip-escape-double-brace/</guid>
      <description>&lt;p&gt;最近在使用 openshift 的指令 - oc，oc 可以使用 template 來輸出所需要的結果，可是 oc 的 template 裡剛巧也是用 &lt;code&gt;{{&lt;/code&gt;，這就導致了 Ansible 以為這是自己要處理的而導致處理錯誤。&lt;/p&gt;
&lt;p&gt;那麼該怎麼辦呢？&lt;/p&gt;</description>
    </item>
    <item>
      <title>課程與證照</title>
      <link>https://ansible.cloudns.pro/post/course-and-certification/</link>
      <pubDate>Mon, 12 Apr 2021 18:13:29 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/course-and-certification/</guid>
      <description>&lt;p&gt;目前主要的課程、證照都是紅帽推出的。已經退休的課程跟證照，下面就不列出來了。&lt;/p&gt;</description>
    </item>
    <item>
      <title>小技巧 - 處理 JSON 檔案之二</title>
      <link>https://ansible.cloudns.pro/post/tips/tip-json-file-handling-2/</link>
      <pubDate>Mon, 12 Apr 2021 14:19:41 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/tips/tip-json-file-handling-2/</guid>
      <description>&lt;p&gt;這篇主要是延續前篇的 &lt;a href=&#34;https://ansible.cloudns.pro/post/tips/tip-json-file-handling/&#34; title=&#34;Tip - 處理 JSON 檔案&#34;&gt;Tip - 處理 JSON 檔案&lt;/a&gt;，前篇寫完以後，突然想到，如果要移除其中一個鍵值該怎麼辦？&lt;/p&gt;</description>
    </item>
    <item>
      <title>小技巧 - 處理 JSON 檔案</title>
      <link>https://ansible.cloudns.pro/post/tips/tip-json-file-handling/</link>
      <pubDate>Sat, 10 Apr 2021 14:19:41 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/tips/tip-json-file-handling/</guid>
      <description>&lt;p&gt;現在有不少服務都是使用 JSON 作為設定檔，所以常常會需要讀取 JSON 格式的設定檔，修改內容值後再寫回，那麼用 Ansible 的話，該怎麼做呢？&lt;/p&gt;</description>
    </item>
    <item>
      <title>ansible.builtin.copy</title>
      <link>https://ansible.cloudns.pro/post/copy/</link>
      <pubDate>Sat, 10 Apr 2021 12:19:41 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/copy/</guid>
      <description>&lt;p&gt;copy 可以把檔案複製到連線的主機去。&lt;/p&gt;</description>
    </item>
    <item>
      <title>小技巧 - Inventory 格式的轉換</title>
      <link>https://ansible.cloudns.pro/post/tips/tip-inventory-conversion/</link>
      <pubDate>Sun, 04 Apr 2021 16:13:29 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/tips/tip-inventory-conversion/</guid>
      <description>&lt;p&gt;Inventory 就是主機清單，裏面描述主機的連線資訊，一般文件常用的是 ini 格式。&lt;/p&gt;
&lt;p&gt;但在 DO447 的第二章有提到 inventory 格式的轉換，我自己是比較熟悉 ini 格式的 inventory，所以對於要轉換為 YAML 格式的地方就覺得比較卡頓。&lt;/p&gt;
&lt;p&gt;那該怎麼克服呢？我臨機一動，想到 ansible 有提供 ansible-inventory 指令，用這個就可以解決我的問題。&lt;/p&gt;</description>
    </item>
    <item>
      <title>祕訣 - 關於 ansible.cfg</title>
      <link>https://ansible.cloudns.pro/post/tips/tip-ansible.cfg/</link>
      <pubDate>Sun, 04 Apr 2021 08:17:41 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/tips/tip-ansible.cfg/</guid>
      <description>&lt;p&gt;這是我在前兩天在寫 DO447 練習題時所發現的一個小技巧，覺得非常實用，特別是在無法上網查詢的時候。&lt;/p&gt;
&lt;p&gt;ansible.cfg 是 ansible 預設會去讀取的設定檔，裏面可以設定很多，例如：&lt;/p&gt;</description>
    </item>
    <item>
      <title>lookup - password</title>
      <link>https://ansible.cloudns.pro/post/lookup-password/</link>
      <pubDate>Wed, 24 Mar 2021 08:19:41 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/lookup-password/</guid>
      <description>&lt;p&gt;lookup 是很方便的查詢函式，第一個參數是 &amp;lsquo;password&amp;rsquo; 的時候，可以用來產生密碼。&lt;/p&gt;</description>
    </item>
    <item>
      <title>Inventory - Overview</title>
      <link>https://ansible.cloudns.pro/post/inventory---overview/</link>
      <pubDate>Sun, 21 Mar 2021 08:29:41 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/inventory---overview/</guid>
      <description>&lt;p&gt;Inventory 就是主機清單，Ansible 要連到哪些主機做操作，就是依據這個檔案。&lt;/p&gt;
&lt;p&gt;Inventory 可以使用很多種格式，每種格式的處理都依靠 Plugin，這可以在 ansible.cfg 裡去啟用跟關閉。&lt;/p&gt;</description>
    </item>
    <item>
      <title>ansible.builtin.shell</title>
      <link>https://ansible.cloudns.pro/post/shell/</link>
      <pubDate>Thu, 11 Mar 2021 12:19:41 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/shell/</guid>
      <description>&lt;p&gt;shell 是用來執行指令用的，等等，&lt;a href=&#34;https://ansible.cloudns.pro/post/command/&#34; title=&#34;command&#34;&gt;command&lt;/a&gt; 不也一樣嗎？。&lt;/p&gt;
&lt;p&gt;對，其實大同小異，但有個很重要的差別，就是 pipe 或重導向 。
command 只能執行單一個指令，若需要作 pipe 串接或重導向時，就需要用到 shell 了。&lt;/p&gt;</description>
    </item>
    <item>
      <title>lookup - template</title>
      <link>https://ansible.cloudns.pro/post/lookup-template/</link>
      <pubDate>Tue, 09 Mar 2021 05:58:29 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/lookup-template/</guid>
      <description>&lt;p&gt;lookup 是很方便的查詢函式，第一個參數是 &amp;rsquo;template&amp;rsquo; 的時候，可以把範本檔案放到第二個參數，然後 lookup 會把範本內容替換變數以後，再傳回字串。&lt;/p&gt;</description>
    </item>
    <item>
      <title>ansible.builtin.command</title>
      <link>https://ansible.cloudns.pro/post/command/</link>
      <pubDate>Sun, 07 Mar 2021 12:19:41 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/command/</guid>
      <description>&lt;p&gt;command 是用來執行指令用的。&lt;/p&gt;</description>
    </item>
    <item>
      <title>lookup 一覽</title>
      <link>https://ansible.cloudns.pro/post/lookup/</link>
      <pubDate>Thu, 04 Mar 2021 15:58:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/lookup/</guid>
      <description>&lt;p&gt;lookup 函式的第一個參數可以填哪些項目，又能拿到什麼樣的資訊呢？你可以參考下面的一覽表。&lt;/p&gt;</description>
    </item>
    <item>
      <title>祕訣 - 關於 lookup</title>
      <link>https://ansible.cloudns.pro/post/tips/tip-lookup/</link>
      <pubDate>Wed, 03 Mar 2021 22:30:41 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/tips/tip-lookup/</guid>
      <description>&lt;p&gt;你可以使用 &lt;code&gt;ansible-doc -t lookup -l&lt;/code&gt; 列出所有可用的 lookup plugins。&lt;/p&gt;
&lt;p&gt;找到以後，就可以用 &lt;code&gt;ansible-doc -t lookup &amp;lt;the_plugin&amp;gt;&lt;/code&gt; 來看它的用法。&lt;/p&gt;</description>
    </item>
    <item>
      <title>lookup - dig</title>
      <link>https://ansible.cloudns.pro/post/lookup-dig/</link>
      <pubDate>Wed, 03 Mar 2021 22:00:41 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/lookup-dig/</guid>
      <description>&lt;p&gt;lookup 是很方便的查詢函式，第一個參數是 &amp;lsquo;dig&amp;rsquo; 的時候，會拿第二個參數來做 DNS 查詢。&lt;/p&gt;</description>
    </item>
    <item>
      <title>ansible.builtin.assert</title>
      <link>https://ansible.cloudns.pro/post/assert/</link>
      <pubDate>Wed, 03 Mar 2021 00:11:41 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/assert/</guid>
      <description>&lt;p&gt;ansible.builtin.assert 這個模組可以用來檢查是否滿足指定的條件，不滿足的時候，會發生錯誤並離開。&lt;/p&gt;
&lt;p&gt;用法很簡單，在 that 裡指定條件式即可。&lt;/p&gt;</description>
    </item>
    <item>
      <title>Jinja2 filter - subelements</title>
      <link>https://ansible.cloudns.pro/post/jinja2-filter---subelement/</link>
      <pubDate>Thu, 25 Feb 2021 10:11:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/jinja2-filter---subelement/</guid>
      <description>&lt;p&gt;subelements 這個 filter 是取出 list 裡每個項目裡的 attribute ，然後轉為每個元素為 list 的 list。
xxx
很繞口，對吧，這個不太容易理解，用例子比較好講。&lt;/p&gt;
&lt;p&gt;從下面的變數定義可以看到，users 是一個 list，裏面有兩個項目，每個項目代表一個 user&lt;/p&gt;</description>
    </item>
    <item>
      <title>Ansible 3.0.0</title>
      <link>https://ansible.cloudns.pro/post/ansible-3.0.0/</link>
      <pubDate>Sat, 20 Feb 2021 15:58:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/ansible-3.0.0/</guid>
      <description>&lt;p&gt;Ansible 釋出 3.0.0 了，之前的版本是 2.10，目前所釋出的 3.0.0 有點特別。
這是新聞稿：&lt;a href=&#34;https://www.ansible.com/blog/announcing-the-community-ansible-3.0.0-package&#34;&gt;Announcing the Community Ansible 3.0.0 Package&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;為什麼說有點特別呢？&lt;/p&gt;</description>
    </item>
    <item>
      <title>如何在 RHEL 上安裝 Ansible 2.9</title>
      <link>https://ansible.cloudns.pro/post/how-to-install-ansible-2.9-on-rhel/</link>
      <pubDate>Tue, 16 Feb 2021 10:11:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/how-to-install-ansible-2.9-on-rhel/</guid>
      <description>&lt;p&gt;介紹如何在 RHEL 上安裝 Ansible 2.9，Ansible 提供了兩個主要的 repository ，
一個是 Red Hat 官方所提供的 repository，另外一個則是 EPEL 的 repository，
下面我們就針對這兩者來介紹其安裝方式。&lt;/p&gt;</description>
    </item>
    <item>
      <title>如何在 Ubuntu 上安裝 Ansible</title>
      <link>https://ansible.cloudns.pro/post/how-to-install-ansible-on-ubuntu/</link>
      <pubDate>Thu, 07 Jan 2021 19:08:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/how-to-install-ansible-on-ubuntu/</guid>
      <description>&lt;p&gt;Ubuntu 上的安裝很簡單，先加入 apt repository 以後，就可以安裝了。&lt;/p&gt;</description>
    </item>
    <item>
      <title>需求規格</title>
      <link>https://ansible.cloudns.pro/post/prerequisites/</link>
      <pubDate>Tue, 05 Jan 2021 14:08:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/prerequisites/</guid>
      <description>&lt;p&gt;控制端 (Control node) 必須要能以 SSH / WinRM 等協定連接到被控端 (Managed node)。&lt;/p&gt;</description>
    </item>
    <item>
      <title>Ansible 的好朋友 - vagrant</title>
      <link>https://ansible.cloudns.pro/post/vagrant/</link>
      <pubDate>Fri, 01 Jan 2021 17:08:37 +0800</pubDate>
      <guid>https://ansible.cloudns.pro/post/vagrant/</guid>
      <description>&lt;h2 id=&#34;簡介&#34;&gt;簡介&lt;/h2&gt;
&lt;p&gt;在介紹 Ansible 之前，必須要介紹 vagrant 這個工具。&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
