Fix use agent can do esx inventory in tasks. closes #2263