Skip to content
Ricky
Chinese

搜尋

Searching… No matching pages. Matching pages are listed below. Search is unavailable. Please try again.

Ansible

All posts

Windows SSH setup Install OpenSSH for Windows 預設的 shell 是使用 cmd,照文件說,若需要修改,是要改 ansible_shell_type 變數,這應該是要在 inventory 主機裡加入主機變數:ansible_shell_type,變數內容可以是 cmd 或 powershell。 inventory 主機裡要加入 ansible_connection …

將指令輸出轉為圖片 --- - name: Capture command output and convert to image hosts: all tasks: - name: Display content of /etc/redhat-release shell: cat /etc/redhat-release register: redhat_release_result - name: …

1 分鐘

LVM - lvg 與 lvol 卷群組 - name: 在 /dev/sda1 跟 /dev/sdb1 之上建立 volume group,其 extend size 設置為 32MB community.general.lvg: vg: vg.services pvs: /dev/sda1,/dev/sdb1 pesize: 32 本地卷 - name: 建立一個大小為 512m 的 local volume …

YAML 裡的字串很長該怎麼做? 在 YAML 裡已經有規範此部份,在這種情況有四種方法可以幫助我們: |: 其下內容的換行,就是換行,最後一行會有換行。 >: 其下內容的換行,不會是換行,會變為一個很長的字串,最後會有換行。 |-: 其下內容的換行,就是換行,但最後一行不會有換行。 >-: 其下內容的換常,不會是換行,最後一行也不會有換行。 簡單的說,> 跟 >- 可以增加 YAML 的可讀性,又不會有多餘的換行 …

將 List 轉置為 dict 的 list list my_users: - aaa - bbb - ccc dict my_users: - Name: aaa - Name: bbb - Name: ccc playbook - name: Transform data vars: orig_users: - aaa - bbb - ccc my_users: [] set_fact: my_users: …

1 分鐘

[網友好文]Cisco UCS CIMC 系列文章 Ansible - 設定 Cisco UCS CIMC 時區 Ansible - 設定 Cisco UCS CIMC DNS 和停用 IPv6 Ansible - 設定 Cisco UCS CIMC Fan Policy Ansible - 設定 Cisco UCS CIMC Mail Alert Ansible - 設定 Cisco UCS CIMC 40Gb …

ansible.builtin.slurp - 讀取檔案內容 --- - name: Use HTTP POST to upload file hosts: all tasks: - name: Read binary file content slurp: path: "/bin/ls" register: bin_file - name: Send HTTP POST Request uri: url: …

1 分鐘

# hosts 可以這樣寫 $ ansible 'max-compute[!3:9][0:3][0:3]' -m setup --list-hosts hosts (4): max-compute10 max-compute13 max-compute20 max-compute23 $ ansible 'max-compute[!3:9][0:4][0:4]' -m setup --list-hosts hosts …

1 分鐘