title: Chef - If elsif statements
body: <p>Trying to do something rather simple in Chef but can't seem to get right. I know it would be easier to use the IIS cookbook but long story short it's not available at this time.</p>
  
  <p>Trying to run a <code>if</code> <code>elsif</code> from the Attributes file like this. But the <code>if node[:domain]</code> section doesn't seem to run, it just ignores it or it's not being validated, I can't tell. The default section works</p>
  
  <pre><code>      if node[:platform] == 'windows'
  
      default['WebSiteCreation']['Dir'] = 'D:\Websites'
      default['WebSiteCreation']['AppPool'] = 'MySite'
      end
  
  if node[:domain] == 'Dev.com'
  
      default['WebSiteCreation']['HostHeader'] = 'Dev'
  
  elsif node[:domain] == 'Test.com'
  
      default['WebSiteCreation']['HostHeader'] = 'Test'
  
  elsif node[:domain] == 'Preprod.com'
  
      default['WebSiteCreation']['HostHeader'] = 'PreProd'
  
  elsif node[:domain] == 'prod.com'
  
      default['WebSiteCreation']['HostHeader'] = 'Prod'
  
      else
  end
  </code></pre>
  
  <p>However, when I call anything referenced from if node section as a variable in the recipe blank is passed, so it can't be defined.</p>
  
  <p>I've tried moving the code to the recipe, no effect. </p>
  
  <p>What am I doing wrong....</p>