在lineinfile模块中,它替换了整行。
如果这条线很长,我必须再次重复整条线。
假设我想替换文件中的单个单词:
#abc.conf
This is my horse
这是剧本:
- lineinfile: dest=abc.conf
state=present
regexp='horse'
line='This is my dog'
backup=yes
有什么办法可以达到类似的效果sed 's/horse/dog/g'
吗?