Reputation: 1200
I keep getting the an error when I try to use the environment
attribute in a chef recipe:
git name do
repository repo_url
revision "master"
environment { 'VAR' => 'whatever' }
action :sync
end
The error is :
ERROR: /tmp/vagrant-chef-3/chef-solo-3/cookbooks/JandJ/recipes/git_repo.rb:11: syntax error, unexpected tASSOC, expecting '}'
==> default: environment { 'VAR' => 'whatever' }
I copied the example from the chef docs here
Upvotes: 1
Views: 1733
Reputation: 37600
The correct syntax would be either
environment({ 'VAR' => 'whatever' })
or
environment 'VAR' => 'whatever'
Upvotes: 1