<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_to_inventory(self):
 """Adds lb IPs to stack inventory"""

        if self.lb_attrs:
            self.lb_attrs = self.consul.lb_details(
                    self.lb_attrs[A.loadbalancer.ID]
                    )
            host = self.lb_attrs['virtualIps'][0]['address']
            self.stack.add_lb_secgroup(self.name, [host], self.backend_port)
            self.stack.add_host(
                    host,
                    [self.name],
                    self.lb_attrs
                    )