我正在尝试使用 Ansible 注释掉下面的行。我遇到一个问题,每次运行剧本时都会添加评论。
\n如果已经注释掉,如何更改我的正则表达式以忽略该行?
\n- replace:\n\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0 path: /etc/rsyslog.conf\n\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0 regexp: \'(.*@hostname.*)\'\n\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0 replace: \'#\\1\'\n\xc2\xa0 notify:\n\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0 - Restart rsyslog\nRun Code Online (Sandbox Code Playgroud)\n ansible ×1