我是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任务中,没有调试信息。如果有人有主意,那就太好了。
我已经改变了
command: lxd init --preseed < /tmp/lxcInitFile.yaml
shell: lxd init --preseed < /tmp/lxcInitFile.yaml
和ok