2014-09-26 82 views
1

我有ansibleAnsible YAML語法失敗

# role: common 
    # # common tasks 
    # --- 
    # # 
    # # create default mariadb Audit db users 
    # # 
-name: common | setup impactGroup group 
group: name=group system=no gid=510 
ignore_errors: yes 
~ 
YAML文件

我也有正確的服務器列表•在清單文件

定義,當我執行ansible-劇本命令我碰到下面的錯誤

/usr/bin/ansible-playbook -D /tmp/eabinay/test.yml -i /tmp/eabinay/dbServerInventory 
    ERROR: parse error: playbooks must be formatted as a YAML list, got <type 'dict'> 

回答

7

審查縮進。此代碼適用於我。

- name: common | setup impactGroup group 
    group: name=group system=no gid=510 
    ignore_errors: yes 

首先檢查與--syntax檢查選項:

/usr/bin/ansible-playbook -D /tmp/eabinay/test.yml -i /tmp/eabinay/dbServerInventory --syntax-check