skipping ":" in ansible with strings already having ""(quotation) -


i trying use lineinfile: replace whole line when executing complains : (colon) tried using " (quotation) think ansible not able differentiate between existing "" , added "" tried \ escape colon still not working

lineinfile:  dest='/etc/sysconfig/network-scripts/ifcfg-team0'  state=present  regexp=^team_config=.*  line=team_config='{"runner": {"name": "{{item.bondmode}}"}, "link_watch": {"name": "ethtool"}}' with_items: - "{{ teaming }}" 

this issue space after colon:

line="team_config={'runner':{'name':'{{item.bondmode}}'}, 'link_watch':{'name':'ethtool'}}" 

will work (it not still valid json), see here


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -