2016-05-17 73 views
1

我正在使用Ansile 2.0.1.0。
在變量使用變量時出現語法錯誤

在我main.yml我有這樣的任務:

- name: hoge 
    hosts: hoge2 
    connection: docker 
    become: yes 
    become_user: {{ansible_user}} 

在執行我收到此錯誤信息:

ERROR! Syntax Error while loading YAML. 


The error appears to have been in '/Users/fuga/Docker/ansible/main.yml': line 16, column 17, but may 
be elsewhere in the file depending on the exact syntax problem. 

The offending line appears to be: 

    become: yes 
    become_user: {{ansible_user}} 
       ^here 

我如何修正這個錯誤?

回答

相關問題