When i run below playbook getting error i am trying to set Java path. 
Please suggest ASAP

[cdhadmin@vboacisbs13 ansible]$ ansible-playbook java.yml --syntax -check

ERROR! Syntax Error while loading YAML.

  did not find expected key


The error appears to have been in '/etc/ansible/java.yml': line 12, column 
6, but may

be elsewhere in the file depending on the exact syntax problem.


The offending line appears to be:


     # lineinfile is used to add additional or append lines to existing 
files.

     - lineinfile :

     ^ here


[cdhadmin@vboacisbs13 ansible]$ sudo vi java.yml
---
- hosts: cloudera
  become: true
  tasks:
   - name: Download Java
     get_url: url=http://10.85.16.186/cm/cm5.14.2-centos7.tar.gz 
dest=/home/cdhadmin/Downloads
   - name: Extract & install Java
     command: tar zxvf /home/cdhadmin/Downloads/cm5.14.2-centos7.tar.gz -C 
/usr
   - name: Update Profile
     copy: content="export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk \n" 
dest=/etc/profile
     # lineinfile is used to add additional or append lines to existing 
files.
     - lineinfile :
       path: /etc/profile
       line: 'JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk'
       create: yes
   - name: Source profile
     shell: source /etc/profile.d

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/32ee6a20-2f7c-4af0-9793-e542fbfd7636%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to