Ansible: lineinfile syntax error when there is a space after colon(:)

后端 未结 2 822
遇见更好的自我
遇见更好的自我 2021-01-15 08:19

Ansible\'s lineinfile gives a syntax error when there\'s a space after colon(:) in the line, like line=\'item: value\'. If there\'s no space like <

2条回答
  •  一生所求
    2021-01-15 09:15

    I got another suggestion at Ansible's github issue, which is actually suggested in the error message...

    lineinfile: "dest=/etc/sudoers line='%testgroup ALL= NOPASSWD: /sbin/shutdown -r now' state=present insertafter=EOF validate='visudo -cf %s'"
    

    And also, aonther thing that's worth sharing is that I was suggested to stop by one of the two mailing lists, as appropriate:

    • https://groups.google.com/forum/#!forum/ansible-project - for user questions, tips, and tricks
    • https://groups.google.com/forum/#!forum/ansible-devel - for strategy, future planning, and questions about writing code

提交回复
热议问题