title: How to set environment variable using Chef?
body: <p>Theres a similar question to this, but cant manage it to work:
  I want to simply set an env variable, then use it:</p>
  
  <pre><code>execute "start zookeeper" do
      cwd "/opt/zookeeper-3.4.5/bin"
      command "./zkServer.sh start"
      environment "JVMFLAGS" =&gt; "-Xmx#{heap_jvm} -Xms#{heap_jvm}"
      user "root"
      action :run
  end
  </code></pre>
  
  <p>I've also tried using bash to <code>"export JVMFLAGS='-blabla'"</code> but still it runs the sh with none set to the variable. Is there some issue preventing my sh script from checking the variable?
  I could use the sh like a template and replace the ocurrence of JVMFLAGS... But i want to check if theres a better solution..</p>