Ok will do.

Lars

On Tuesday, November 19, 2013 2:16:03 PM UTC+1, Michael DeHaan wrote:
>
> Hi, as this is a question about developing modules, please post this to 
> the [email protected] <javascript:> list and we'll help out.
>
> Thanks!
>
>
> On Tue, Nov 19, 2013 at 7:42 AM, Lars Vonk <[email protected]<javascript:>
> > wrote:
>
>> Hi,
>>
>> I am trying to create a custom module based on pyrax (rackspace) to 
>> create reverse dns entries. I followed the hacking guide but I am stuck 
>> testing the new module because of an AttributeError: 'module' object has 
>> no attribute 'ModuleReplacer' error.
>>
>> My set up is as follows:
>>
>> Mac OSX, installed python with brew and using pip for the dependencies. 
>> Local python is at /usr/local/bin/python. Then I following the hacking 
>> guide at http://www.ansibleworks.com/docs/developing_modules.html and 
>> checked out ansible, ran ./hacking/env-setup and than:
>>
>> ./hacking/test-module -m ../servers/modules/rax_dns
>>
>> Output:
>>
>> Traceback (most recent call last):
>>
>>   File "./hacking/test-module", line 163, in <module>
>>
>>     main()
>>
>>   File "./hacking/test-module", line 147, in main
>>
>>     (modfile, module_style) = boilerplate_module(options.module_path, 
>> options.module_args)
>>
>>   File "./hacking/test-module", line 84, in boilerplate_module
>>
>>     replacer = module_common.ModuleReplacer()
>>
>>
>> The rax_dns:
>>
>> #!/usr/bin/python #changing this to /usr/local/bin/python has no effect.
>>
>> import pyrax
>>
>>
>> def main():
>>
>>   module = AnsibleModule(
>>
>>     argument_spec = dict(
>>
>>       credentials = dict(required=True),
>>
>>       hostname    = dict(required=True)
>>
>>       )
>>
>>   )
>>
>>
>>   pyrax.set_setting("identity_type", "rackspace")
>>
>>   pyrax.set_credential_file(credentials)
>>
>> # include magic from lib/ansible/module_common.py
>>
>> #<<INCLUDE_ANSIBLE_MODULE_COMMON>>
>>
>> main()
>>
>>
>> What am I missing? Also can I put my custom modules in my own project? Or 
>> do they need to be in the ansible directory?
>>
>>
>> Lars
>>  
>> -- 
>> 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 [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> -- 
> Michael DeHaan <[email protected] <javascript:>>
> CTO, AnsibleWorks, Inc.
> http://www.ansibleworks.com/
>
>  

-- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to