Ansible 使用加密的组变量运行playbook时出错

Ansible 使用加密的组变量运行playbook时出错,ansible,ansible-2.x,Ansible,Ansible 2.x,我正在尝试使用ansible vault加密的文件运行剧本。但是,我得到以下错误: ERROR! Syntax Error while loading YAML. could not find expected ':' The error appears to have been in 'inventories/group_vars/main_server': line 41, column 1, but may be elsewhere in the file depending on

我正在尝试使用ansible vault加密的文件运行剧本。但是,我得到以下错误:

ERROR! Syntax Error while loading YAML.
  could not find expected ':'

The error appears to have been in 'inventories/group_vars/main_server': line 41, column 1, but may
be elsewhere in the file depending on the exact syntax problem.
vault文件的内容:

me@server:ansible$ cat inventories/group_vars/main_server
$ANSIBLE_VAULT;1.1;AES256
...
我正在运行的命令:

ansible-playbook -i inventories/group_vars/main_server --extra-vars "target=my_target" playbook.yml --ask-become-pass --ask-pass --vault-password-file vault_pwd.txt
vault_pwd.txt将填充所需的密码。我一直在加密/解密我的剧本。例如,带有encrypting命令的shell脚本:

ansible-vault encrypt inventories/group_vars/main_server --vault-password-file vault_pwd.txt
编辑1

Ansible版本:

me@server:ansible$ ansible --version
ansible 2.7.5
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/me/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.12 (default, Nov 12 2018, 14:36:49) [GCC 5.4.0 20160609]

你看到的错误

错误!加载YAML时出现语法错误。 找不到预期的“:”

错误似乎出现在“库存/组变量/主服务器”中:第41行,第1列,但可能是错误 根据确切的语法问题,在文件中的其他位置


…是一个YAML语法错误。Ansible可能在抱怨未加密内容中存在实际语法错误,如果幸运的话,错误消息中引用的行实际上就是出现错误的行。

该错误可能源于Vault内容中的YAML语法问题。为了调试此问题,您需要向我们显示Vault文件的未加密内容。谢谢!我在这儿看看。我没有考虑过这一点。我使用=在一个点而不是冒号中赋值。另一个是缺少双引号的IP。如果您指定了答案,我将接受。请确认:您提供的库存文件是加密的吗?看起来这个特定的用例不受支持:很乐意帮忙。好了!