ubuntu – ansible lineinfile转义引号丢失

前端之家收集整理的这篇文章主要介绍了ubuntu – ansible lineinfile转义引号丢失前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
使用ansible 1.5.4,命令
lineinfile: dest=/etc/bash.bashrc line="bind '\"\e[B\"':history-search-forward"

添加了这条线

bind '"\e[B"':history-search-forward

到/etc/bash.bashrc完全没问题.

在ansible 1.9.1上,相同的ansible指令产生以下行,这会混淆我在lineinfile命令中转义的引号:

bind \e[B:history-search-forward

如何修复引号,以便添加正确的行

您通常可以通过使用多行输入形式来避免一些逃避混乱,特别是在输入冒号时:

命令:>curl -X POST -H’Content-Type:application / json’ – data'{“name”:“{{item.name}}”,“comment”:“{{item.comment}}”,“DefaultDistribution “:”{{item.default_distribution}}“,”DefaultComponent“:”{{item.default_component}}“}’http:// localhost:8080 / api / repos

原文链接:https://www.f2er.com/ubuntu/347859.html

猜你在找的Ubuntu相关文章