Hi Tim,

Thank you very much for the update. It helps a lot, thank you very much. 
Indeed, I have chosen your second option as it is easier to maintain and 
avoid any conflict with other systems. The inifile.py is too big to be 
included in the custom module but I would not do this as I wouldn't be able 
to re-utilise it.

Here is how I did it:

In my playbook or role:
tasks:
  - name: Upload python module
    copy: src=library/inifile.py dest=/tmp/inifile.py
In my custom module:
import sys
sys.path.append('/tmp')
from inifile import IniFile

And to answer your question, what I am trying to achieve here is an 
extension to the ini_file module in Ansible. The current module doesn't 
answer my needs such as:

   - setting easily a continious list of options such as:
      - whitelist.0 = item1
      - whitelist.1 = item2
      - whitelist.2 = item3
   - checking and replacing a list of options (such as ["ower", "owne"]) by 
   one option name ("owner")
   - Dealing with options that doesn't have section (generally mean that 
   this is default to all sections)
   - Dealing with empty name section ([]) and comments - this one I am less 
   sure about but I know that the ConfigParser cannot handle this.

Thank you again for your precious help.


Regards,

Olivier

On Thursday, 16 July 2015 15:20:03 UTC+1, Timothy Appnel wrote:
>
> I didn't give up at all. Far from it! I started working for Ansible. 
>
> Last I spoke to my former co-workers they are still using options 2 that I 
> setup because they do not have the ability to install python libraries in 
> the default library path.
>
> <tim/>
>
>
> On Thu, Jul 16, 2015 at 10:14 AM, Martin <[email protected] 
> <javascript:>> wrote:
>
>> Hi,
>>
>> On Thu, Jul 16, 2015 at 4:05 PM Timothy Appnel <[email protected] 
>> <javascript:>> wrote:
>>
>>> In a previous life I've had to do what you are attempting.
>>>
>>
>> So what do you do now? It sound like you went on and are using a 
>> completely different approach to achieve what the op wants to do (load 
>> custom code) 
>>
>> I'm not asking about options but rather what you actually ended up with 
>> doing (give up and/or stopped using the tool are viable answers to me)
>>
>> /Martin
>>
>> -- 
>> -- 
>> http://www.xing.com/profile/Martin_Marcher
>> http://www.linkedin.com/in/martinmarcher
>> Mobil: +43 / 660 / 62 45 103
>> UID: ATU68801424
>>
>> -- 
>> 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:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/CAK1mKEQxjUW0kB9Yb426THm8HZCMOy%3DbdbCzztjARScFrYsKzQ%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/CAK1mKEQxjUW0kB9Yb426THm8HZCMOy%3DbdbCzztjARScFrYsKzQ%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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a7ac54d2-e808-4c46-855e-5f3326b5b069%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to