0
这是我的Ansible剧本来创建一个新的VM。Ansible playbook无法启动?
---
- name: Create a VM in OA resource pool
hosts: local
connection: local
gather_facts: False
tasks:
- name: create VM
vsphere_guest:
vcenter_hostname: https:\\virtualcenter
username: '{{ user }}'
password: '{{ password }}'
guest: '{{ guest }}'
state: powered_off
vm_extra_config:
vcpu.hotadd: yes
mem.hotadd: yes
notes: This is a test VM
vm_disk:
disk1:
size_gb: 10
type: thick
datastore: storage
vm_nic:
type: vmxnet3
network: network1
vm_hardware:
memory_mb: 1024
num_cpus: 1
osid: centos64Guest
scsi: paravirtual
resource_pool: "RP1"
变量从命令行传递。 然而,当我尝试运行的任务,我得到这个:
No config file found; using defaults
[WARNING]: Host file not found: /etc/ansible/hosts
[WARNING]: provided hosts list is empty, only localhost is available
PLAYBOOK: createvm.yml *********************************************************
1 plays in playbooks/vmware/createvm.yml
PLAY [Create a VM in OA resource pool] *****************************************
skipping: no hosts matched
PLAY RECAP *********************************************************************
的,可以是什么原因呢?一个错字?使用列表任务进行语法检查也不会显示任何内容。
谢谢,它的工作,当我改变本地localhost! –