ansible - 1.9.3
Dynamic inventory is used. bootstrapping an EC2 instance and adding the instance to host using add-host, but it skips the plays for the newly created hosts. But when running the play next time, it finds the host and starts executing. here is the snippet,
hosts: localhost
tasks:
- name: something
ec2: this module will create instances
- name: adding hosts
add host: name=(name of the new instance)
hosts: new host
tasks:
- something