New GCE Fact module

Hi,

I am trying to write a fact module to read the Google Compute Engine Metadata. So far I have the following script: https://gist.github.com/pixie79/d5399bbdc9df7e68fb4e

This works fine when I run it via: hacking/test-module -m /opt/ansible/modules/gce_meta -a gcemeta="dc,test"

However, if i try and run it via my playbook I get the following error:

ansible-playbook -M /opt/ansible/modules/ -i /opt/ansible/plugins/inventory/gce.py deploy.yml
ERROR: gce_meta is not a legal parameter in an Ansible Playbook

My deploy.yml looks like this:

Hi Mark,

It sounds like your module is not in your configured ansible library path (ansible.cfg) or in a “./library” directory in your playbook or role.

You may also have some identation errors, but that may just be from copy/paste.

This usually indicates a whitespace problem. Your “gce_meta” is being seen at an indentation level outside of the task definition.

I can’t tell from your email because formatting of whitespace is lost, but can you put up a gist of your deploy.yml? I suspect you need to align the gce_meta: line so that it starts so that the g is right under the “n” of name.

-jlk