How get other job's task ip

I have two job ,A is ldap server,B is a web app,now I want B get A’s ip,but I use NOMAD_IP_label is can’t get a value ,my hcl like

A.hcl

    task "openldap" {
      driver = "docker"
      config {
        image = "osixia/openldap"
        ports = ["ldap","ldap2"]
      }

    }

B.hcl

    task "test" {
      driver = "docker"
      env {
        LDAP_LOGIN_SERVER="ldap://${NOMAD_IP_ldap}"  
       }

      config {
        image = "test:latest"
        ports = ["http"]
      }

    }