syntax error with lineinfile

42 views
Skip to first unread message

Dave Thacker

unread,
Mar 26, 2015, 10:50:39 AM3/26/15
to ansible...@googlegroups.com

I'm getting an unbalance quote error on this short playbook.   I'm not seeing the error

---
- hosts: devcluster
  remote_user: ansible
  sudo: yes

  tasks:

  -name: add jmx host entry to devjboss cluster
   action: lineinfile dest="/etc/hosts" backup=yes  state="present" insertafter="mydomain.local" line="10.53.153.37 jms-server01"

Error:
ERROR: Syntax Error while loading YAML script, add_host_test.yml
Note: The error may actually appear before this position: line 9, column 10

  -name: add jmx host entry to devjboss cluster
   action: lineinfile dest="/etc/hosts" backup=yes  state="present" insertafter="gordmans.local" line="10.53.153.37 jms-server01"
         ^
We could be wrong, but this one looks like it might be an issue with
unbalanced quotes.  If starting a value with a quote, make sure the
line ends with the same set of quotes.  For instance this arbitrary
example:

TIA

Dave

Greg Andrews

unread,
Mar 27, 2015, 7:47:21 AM3/27/15
to ansible...@googlegroups.com

Dave Thacker <dtha...@gmail.com> wrote:
-name: add jmx host entry to devjboss cluster


Could it be the lack of whitespace between '-' and 'name' on that line?

  -Greg
Reply all
Reply to author
Forward
0 new messages