title: Puppet manifest to download java by passing cookies and no certificate
body: <p>I am trying to prepare manifests to download java using Puppet. This is my manifest </p>
  
  <pre><code>class java {
   $install_path ="/opt/softwares"
   $user_home="/home/vidyayug"
  
  
  
    exec { "download_java":
      command =&gt; "wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/7u4-b20/jdk-7u4-linux-x64.tar.gz" ",
  
      cwd  =&gt; "$user_home/archives",
      path =&gt; [ "/usr/bin", "/bin"],
      require =&gt; Package["wget"],
      creates =&gt; "$user_home/archives/jdk-7u4-linux-x64.tar.gz",
      timeout =&gt; 60000000
  }
  
  
  
    exec { "untar_jdk" :
      command =&gt; "tar -xvzf $user_home/archives/jdk-7u4-linux-x64.tar.gz",
      cwd =&gt;"$install_path",
      path =&gt; ["/usr/bin","/bin"],
      require =&gt; [Package["tar"],],
      unless =&gt; "test -d ${$install_path}/jdk*"
  
  }
  
  }
  </code></pre>
  
  <p>When i run Puppet, i am having the following issue :</p>
  
  <pre><code> vidyayug@liferay:~/puppet/manifests$ sudo puppet apply site.pp --modulepath=../modules/
  Warning: The use of 'import' is deprecated at /home/vidyayug/puppet/manifests/site.pp:9. See http://links.puppetlabs.com/puppet-import-deprecation
     (at /usr/lib/ruby/vendor_ruby/puppet/parser/parser_support.rb:110:in `import')
  Error: Syntax error at 'Cookie'; expected '}' at /home/vidyayug/puppet/modules/java/manifests/init.pp:16 on node liferay
  Error: Syntax error at 'Cookie'; expected '}' at /home/vidyayug/puppet/modules/java/manifests/init.pp:16 on node liferay
  vidyayug@liferay:~/puppet/manifests$
  </code></pre>
  
  <p>The command to download java is working as expected on the command line but not with Puppet. Previously i was able to install java through apt-get using Puppet.</p>
  
  <p>Please help me to resolve the above issue as i need to install a specific version of JDK.</p>