vsphere_guest module not recognizing from_template param

Greetings,

Ansible: 1.9
pysphere: 1.7

I’ve been experimenting with the vsphere_guest module and am experiencing some problems with the ‘from_template’ parameter. I am using the “# Deploy a guest from a template” example from the docs. Immediately after executing the play, which matches the doc example, I get the following failed message:

“unsupported parameter for module: from_template.”

Also just for my own sanity, I confirmed ‘from_template’ is a param in my checkout out ansible/lib/ansible/modules/core/cloud/vmware/vsphere_guest.py. Anyone have any ideas?

Cheers,
John-Paul

Can you share your playbook?

Sure! http://pastebin.com/1KM7Zyez

Let me know if you have any other questions. Thanks!

Hello John-Paul,

You’ve not, by any chance, got more than one Ansible on your system have you?

A very valid question haha, but no I do not. I’ve tested it locally on my laptop, as well as an ansible control box I have in the same environment as my vsphere cluster.

Worth checking :wink:

I’ve been using the template stuff since late December, and it’s working all fine. However, saying that, I’ve not tried a recent code base. Is your 1.9 pull really recent? I’ll try a bang up to date pull and see if I get the same…

OK, with an RPM built last weekend it still works just fine for me…

$ rpm -q ansible
ansible-1.9-0.git201502131321.el7.centos.noarch

$ ansible --version
ansible 1.9
configured module search path = None

$ ./scripts/newvm mptest.satapp

PLAY [vmcreate] ***************************************************************

TASK: [Check for required variables] ******************************************
skipping: [local]

TASK: [Check for vSphere access parameters] ***********************************
skipping: [local]

TASK: [Create VM from template] ***********************************************
changed: [local]

My play looks like: https://gist.github.com/phips/7c25ccc74f2aee268ed8

It is indeed a very recent pull, I installed from source. Would you mind trying the same and giving it a go?

Regardless, thank you for the quick check, all signs point to my local install. I guess this gives me a great excuse to finally Ansible the bootstrapping of my control boxes themselves so I can figure this out!

Well, I went to roll the latest and greatest and there are some tests failing (I have the ‘make rpm’ rolled up in Jenkins) - so it doesn’t build.

Will check it again for you tomorrow John-Paul, in case something gets fixed today.

OK, ignored tests and rolled RPM from a pull in the last five minutes.

Still works fine for me :slight_smile:

Sorry John-Paul, must be something locally.

$ rpm -q ansible
ansible-1.9-0.git201502181612.el7.centos.noarch
$ !$ --version
ansible --version
ansible 1.9
configured module search path = None

Thank you Mark! I’m going to figure this out. Using a VM and re-installing, I think it was me being an oaf and not running source ./hacking/env-setup post checkout…

Good thing is, I am not motivated to create a role for Ansible control boxes themselves, and I got to take a peek at your usage of vsphere_guest, which I think looks very nice and elegant (plus the tasks to check for extra params are something I have been wanting to add!).

Appreciate everyone’s time and the Ansible community as a whole.