ansible install vm on vcenter
vsphere client 5.5
vcenter 5.5
DC must be added
Cluster must be added
folder under DC to be added
vsphere host must be added 192.168.45.143
template cent must be created from virtual machne centos-server-6.4-x86_64
deploy ovf template centos-server-6.4-x86_64-OVF
vm.yml
---
- name: Create a VM from a template
hosts: localhost
connection: local
gather_facts: no
tasks:
- name: Clone the template
vmware_guest:
hostname: 192.168.45.148 ( vcenter)
username: root
password: vmware
validate_certs: False
name: testvm_2
template: cent
folder: /dc/vm
state: poweredon
wait_for_ip_address: yes
~
~
~
~
"cc.yml" 18L, 395C
[root@localhost ~]# ansible-playbook --connection=local vm.yml
PLAY [Create a VM from a template] ****************************************************
TASK [Clone the template] *************************************************************
changed: [localhost]
PLAY RECAP ****************************************************************************
localhost : ok=1 changed=1 unreachable=0 failed=0
[root@localhost ~]#

Comments
Post a Comment