title: How to dynamically get IP address from already executed recipe in Chef
body: <p>I am a new to Chef and I am trying to test AWS cluster configuration for 2 db serves + 2 application servers using kitchen-ec2 and facing the following problem:   </p>
  
  <p>I cannot dynamically pass <strong>ip_address_1 from recipe#1</strong> (recipe#1 for server1 is completed) <strong>to recipe#2</strong> (which is config recipe for server2 and is being executed). It would be helpful to hear your advice.</p>
  
  <p>One of the things I can do is to explicitly set IP address in .kitchen.yml for each box I am trying to configure , but I am curious if there is any way I can do it on the fly, smth like <strong>Ohai node['ipaddress']</strong> attribute  but more generic, maybe a list of all server IP addresses configured in my cluster.</p>
  
  <p><strong>recipe#1</strong> - <strong>done</strong> - <em>server1</em> is configured, AWS assigned private <em>ipaddress1</em><br>
  <strong>recipe#2</strong> - <strong>in progress</strong> - <em>server2</em> configuration is being applied but it <strong>requires</strong> <em>ipaddress1</em>  </p>
  
  <p>Thank you in advance,<br>
  Dmitry</p>