Chef cookbook - reload PATH

后端 未结 3 662
小蘑菇
小蘑菇 2021-01-14 07:06

I just installed java using chef cookbook and updated PATH environment variable for all users (added new file to /etc/profile.d/).

Is it possible to tell chef to rel

3条回答
  •  悲哀的现实
    2021-01-14 07:34

    I found that it is not possible to update ENV variables pemanently (to be available after chef finishes), but it is possible to update variables for future commands of current chef run.

    ruby_block  "set-env-" do
      block { ENV[variable_name] = variable_value }
      not_if { ENV[variable_name] == variable_value }
    end
    

提交回复
热议问题