Cherry-pick changes from master

  * agent_template requires parameter

Change-Id: Ib149d31086db9e576e0a71e2db3b5c847cfcf324
Closes-bug: 1263727