Ansible-vault errors with “Odd-length string”

前端 未结 4 1219
生来不讨喜
生来不讨喜 2021-01-11 18:19

I\'m running Ansible 1.8.2. I have a vaulted file created on another system. On that system it works without any problems. However, when I run it on my local sy

4条回答
  •  鱼传尺愫
    2021-01-11 19:10

    Turns out this error is because as of Ansible 1.8.2 it requires a very specific line-end encoding for the vaulted files.

    When I had this type of file it would fail:

    $» file vaulted_vars.yml
    vaulted_vars.yml: ASCII text, with CRLF line terminators
    

    However, once I changed it to this, it started working:

    $» file vaulted_vars.yml
    vaulted_vars.yml: ASCII text
    

    This whole problem happened because my git client was changing linefeed characters. See this article for specifics: https://help.github.com/articles/dealing-with-line-endings/

提交回复
热议问题