Discussion:
cannot run an ansible playbook with vsphere_guest support
John Shen
2014-05-01 17:06:10 UTC
Permalink
$ ansible-playbook vmtest.yml
ERROR: vsphere_guest is not a legal parameter in an Ansible Playbook
$ ansible --version
ansible 1.6 (devel c0f92317ef) last updated 2014/05/01 10:56:27 (GMT -600)

i used the first example here with only auth and vcenter info changed.
thanks for any help!

http://docs.ansible.com/vsphere_guest_module.html

$ cat vmtest.yml

# Create a new VM on an ESX server
# Returns changed = False when the VM already exists
# Returns changed = True and a adds ansible_facts from the new VM
# State will set the power status of a guest upon creation. Use powered_on to create and boot.
# Options ['state', 'vm_extra_config', 'vm_disk', 'vm_nic', 'vm_hardware', 'esxi'] are required together

- vsphere_guest:
vcenter_hostname: myvcenter

.

.

.
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/fb954b06-a0dd-4801-bb00-552c422eb618%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
James Cammarata
2014-05-01 17:14:30 UTC
Permalink
If you do the following, does it work as expected?

- name: test vsphere
vsphere_guest:
...

If not, it would seem that you've got some issue with your module path.
Post by John Shen
$ ansible-playbook vmtest.yml
ERROR: vsphere_guest is not a legal parameter in an Ansible Playbook
$ ansible --version
ansible 1.6 (devel c0f92317ef) last updated 2014/05/01 10:56:27 (GMT -600)
i used the first example here with only auth and vcenter info changed.
thanks for any help!
http://docs.ansible.com/vsphere_guest_module.html
$ cat vmtest.yml
# Create a new VM on an ESX server
# Returns changed = False when the VM already exists
# Returns changed = True and a adds ansible_facts from the new VM
# State will set the power status of a guest upon creation. Use powered_on to create and boot.
# Options ['state', 'vm_extra_config', 'vm_disk', 'vm_nic', 'vm_hardware', 'esxi'] are required together
vcenter_hostname: myvcenter
.
.
.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/fb954b06-a0dd-4801-bb00-552c422eb618%40googlegroups.com<https://groups.google.com/d/msgid/ansible-project/fb954b06-a0dd-4801-bb00-552c422eb618%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAMFyvFh37TwUOw3fT7keZ%3DAdjSe4ioNK%2BkdxJdgrGF0W%2B1yaXA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Michael DeHaan
2014-05-01 21:27:47 UTC
Permalink
You are writing a list of tasks so can't just run the task file directly.

- hosts: localhost
tasks:
- include: your_other_file.yml
- shell: task goes here

ETC

So it thinks you are defining a play, not a list of tasks, and needs
vsphere_guest at task level.
Post by James Cammarata
If you do the following, does it work as expected?
- name: test vsphere
...
If not, it would seem that you've got some issue with your module path.
Post by John Shen
$ ansible-playbook vmtest.yml
ERROR: vsphere_guest is not a legal parameter in an Ansible Playbook
$ ansible --version
ansible 1.6 (devel c0f92317ef) last updated 2014/05/01 10:56:27 (GMT -600)
i used the first example here with only auth and vcenter info changed.
thanks for any help!
http://docs.ansible.com/vsphere_guest_module.html
$ cat vmtest.yml
# Create a new VM on an ESX server
# Returns changed = False when the VM already exists
# Returns changed = True and a adds ansible_facts from the new VM
# State will set the power status of a guest upon creation. Use powered_on to create and boot.
# Options ['state', 'vm_extra_config', 'vm_disk', 'vm_nic', 'vm_hardware', 'esxi'] are required together
vcenter_hostname: myvcenter
.
.
.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/fb954b06-a0dd-4801-bb00-552c422eb618%40googlegroups.com<https://groups.google.com/d/msgid/ansible-project/fb954b06-a0dd-4801-bb00-552c422eb618%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CAMFyvFh37TwUOw3fT7keZ%3DAdjSe4ioNK%2BkdxJdgrGF0W%2B1yaXA%40mail.gmail.com<https://groups.google.com/d/msgid/ansible-project/CAMFyvFh37TwUOw3fT7keZ%3DAdjSe4ioNK%2BkdxJdgrGF0W%2B1yaXA%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgyxjRqw_DXqmF5mWOQgaQ%3DG4oDxwbEOd7x%2Bz5v1Qo_9fw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Prashant Shelke
2015-06-24 14:03:31 UTC
Permalink
Hi,

Did you get the resolution to the problem? I am also facing similar issue.

Thanks,
Prashant
Post by John Shen
$ ansible-playbook vmtest.yml
ERROR: vsphere_guest is not a legal parameter in an Ansible Playbook
$ ansible --version
ansible 1.6 (devel c0f92317ef) last updated 2014/05/01 10:56:27 (GMT -600)
i used the first example here with only auth and vcenter info changed.
thanks for any help!
http://docs.ansible.com/vsphere_guest_module.html
$ cat vmtest.yml
# Create a new VM on an ESX server
# Returns changed = False when the VM already exists
# Returns changed = True and a adds ansible_facts from the new VM
# State will set the power status of a guest upon creation. Use powered_on to create and boot.
# Options ['state', 'vm_extra_config', 'vm_disk', 'vm_nic', 'vm_hardware', 'esxi'] are required together
vcenter_hostname: myvcenter
.
.
.
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/46bd0a85-646d-4d55-bd89-71fe301958fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
einarc
2015-07-17 20:51:34 UTC
Permalink
The solution is to index the vsphere_guest module call under tasks, as
Michael Dehaan posted, like this:

- hosts: localhost
tasks:
- vsphere_guest:
vcenter_hostname: myvcenter
Post by John Shen
$ ansible-playbook vmtest.yml
ERROR: vsphere_guest is not a legal parameter in an Ansible Playbook
$ ansible --version
ansible 1.6 (devel c0f92317ef) last updated 2014/05/01 10:56:27 (GMT -600)
i used the first example here with only auth and vcenter info changed.
thanks for any help!
http://docs.ansible.com/vsphere_guest_module.html
$ cat vmtest.yml
# Create a new VM on an ESX server
# Returns changed = False when the VM already exists
# Returns changed = True and a adds ansible_facts from the new VM
# State will set the power status of a guest upon creation. Use powered_on to create and boot.
# Options ['state', 'vm_extra_config', 'vm_disk', 'vm_nic', 'vm_hardware', 'esxi'] are required together
vcenter_hostname: myvcenter
.
.
.
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/69aea09e-fe9f-481e-82e9-1c0501243404%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...