我是 ansible 的新用戶,我正在嘗試在 yaml 腳本中啟動 lxc init:
- name: Copy LXC init file
ansible.builtin.copy:
src: /home/user/lxcInitFile.yaml
dest: /tmp/
owner: root
group: root
mode: '0644'
#- name: Destroy default zpool storage
# command: zpool destroy default
- name: Launch LXC Initialization
command: lxd init --preseed < /tmp/lxcInitFile.yaml
debugger: always
我的 lxcInitFile.yaml 檔案
config: {}
networks:
- config:
ipv4.address: auto
ipv6.address: none
description: ""
name: custom0
type: ""
storage_pools:
- config:
size: 5GB
description: ""
name: default
driver: zfs
profiles:
- config: {}
description: ""
devices:
eth0:
name: eth0
network: custom0
type: nic
root:
path: /
pool: default
type: disk
name: default
cluster: null
當我使用 ansible 啟動它時,我的腳本卡在 LXC init 任務中,沒有除錯資訊。如果有人有想法,那就太好了。
uj5u.com熱心網友回復:
我變了
command: lxd init --preseed < /tmp/lxcInitFile.yaml
到
shell: lxd init --preseed < /tmp/lxcInitFile.yaml
沒關系
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/329317.html
上一篇:在Crontab中運行程式之前使用printf列印出時間,給出“無效指令”錯誤
下一篇:無法使用GnuPG在PHP中加密
