ftao / vpn-deploy-playbook

A Collection of Ansible Playbook for deploy vpn services
GNU General Public License v3.0
919 stars 160 forks source link

树莓派上运行pptp报错 #130

Open mengbingrock opened 8 years ago

mengbingrock commented 8 years ago

ubuntu mate 系统,这个报错看起来很trivial,可是我不知道正确的格式是什么。

安装参考了这篇文章: https://www.whiskykilo.com/install-ansible-on-rpi.html

ERROR! Syntax Error while loading YAML.

The error appears to have been in '/home/mengbing/Downloads/vpn-deploy-playbook/host_vars/testvm.yml': line 3, column 100, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

pptp_users:
- 'username': "test"                                                                               $
                                                                                                   ^ here
This one looks easy to fix.  It seems that there is a value started
with a quote, and the YAML parser is expecting to see the line ended
with the same kind of quote.  For instance:

    when: "ok" in result.stdout

Could be written as:

   when: '"ok" in result.stdout'

Or equivalently:

   when: "'ok' in result.stdout"

我的testvm.yml 文件内容为:

pptp_use_radius: false
pptp_users:
- username: "test"                                                                               $
  password: "test"
- username: "hello"
  password: "hello"

我试了试将 username 和 password 等字段改为 'username' 和 'password', 依旧无效

ftao commented 8 years ago
  1. 文件头上加一个 ---
  2. username 应该不要引号的俄。 其他看起来没问题。