I'm trying to append to a line that has a reasonably complicated snippet of 
python looking code.


defaultStatsSchema= [_tuple for _tuple in defaultArchiveSchema if _tuple[0] 
in stats_types] + [('wind', 'VECTOR')]


to that line, I'm trying to add the following:


+ [('windAv', 'VECTOR')] + [('outTempDay', 'REAL')] + [('outTempNight', 
'REAL')]



The pythonish format of the lines seem to be confusing the replace: module 
in ansible 1.7.2 -  I *think*....


- replace: dest=/home/weewx/bin/user/schemas.py regexp="{{ item.orig }}" 
replace="{{ item.new }}"

     with_items:

          - { 

              orig: "defaultStatsSchema= [_tuple for _tuple in 
defaultArchiveSchema if _tuple[0] in stats_types] + [('wind', 'VECTOR')]" ,

               new: "defaultStatsSchema= [_tuple for _tuple in 
defaultArchiveSchema if _tuple[0] in stats_types] + [('wind', 'VECTOR')] + 
[('windAv', 'VECTOR')] + [('outTempDay', 'REAL')] + [('outTempNight', 
'REAL')]

             }


I guess I'm lost what to (or to not) escape in the original line above.   
 The multiple [whatever] words in there seem to confuse the heck out of the 
replace module and either say 'ok' when it isn't actually matching 
anything, or blowing up with an error at runtime.   Clarification/help 
appreciated....







-- 
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/74518805-36e8-46d5-903b-62ced4d0b84a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to