Ansible vars_prompt

72 views
Skip to first unread message

Andreas Larsen

unread,
Sep 22, 2015, 9:44:43 AM9/22/15
to Ansible Project
I have a error I really can't figure out why this is happening 

My playbook looks as following 

---
- name: "Generate Mikrotik Config"
  hosts: localhost
  vars_prompt:
      - name: "hostname"
        prompt: "Hostname on the unit"
        private: no
        default: "test"


When I run the playbook I  get the following error. 

ansible-playbook RB2011.yml 
ERROR: Syntax Error while loading YAML script, RB2011.yml
Note: The error may actually appear before this position: line 8, column 1

        private: no
        default: "test"
^

As soon as I remove the default: the playbook works as intended 


This is my ansible version 

ansible --version
ansible 1.9.3
  configured module search path = None

Josh Smift

unread,
Sep 22, 2015, 9:54:35 AM9/22/15
to ansible...@googlegroups.com
AL> ansible-playbook RB2011.yml
AL> ERROR: Syntax Error while loading YAML script, RB2011.yml
AL> Note: The error may actually appear before this position: line 8, column 1

YAML likes spaces, and not tabs; do you have a tab character at the start
of the 'default: "test"' line? If so, change it to spaces, and it should work.

(I was able to reproduce both the failure, and make it succeed, by
switching between a tab and eight spaces.)

-Josh (j...@care.com)



This email is intended for the person(s) to whom it is addressed and may contain information that is PRIVILEGED or CONFIDENTIAL. Any unauthorized use, distribution, copying, or disclosure by any person other than the addressee(s) is strictly prohibited. If you have received this email in error, please notify the sender immediately by return email and delete the message and any attachments from your system.
Reply all
Reply to author
Forward
0 new messages