How to do it...

  1. We should go to the Templates page and click on the name of the template.
  2. Here, we need to scroll down to the options and check Allow Provisioning Callbacks.
  3. We have to provide a config key. Ideally, this should be a long string. We can also click on the wand button next to the host config key to generate a random string, and then we can click on the SAVE button.
  1. Any instance can call for the job using the Callback URL. Typically, this can be done through curl in /etc/rc.local, or by using the various mechanisms provided by cloud providers, such as cloud-init. The command that we should put is as follows:
$ curl -k --data ...

Get Ansible 2 Cloud Automation Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.