0

I am providing the ipaddress of the machine within my kitchen.yml:

  - name: node_abc
    driver:


      network:
      - ['private_network', {ip: '193.169.33.84'}]

When I try to retrieve the value of ipaddress using

ohai node[ipaddres]

I get 10.0.2.15 instead of 193.169.33.84.

How can i get 193.169.33.84?

StephenKing
  • 36,187
  • 11
  • 83
  • 112
meallhour
  • 13,921
  • 21
  • 60
  • 117

1 Answers1

0

Use

node["network"]["interfaces"]["eth1"]["addresses"].first.

The reason, why ohai picks the first interface (even if it's only a non-globally routed IP) is because the default route uses this interface. This should be the place in the code.

StephenKing
  • 36,187
  • 11
  • 83
  • 112