add_host is the correct approach.

On Wednesday, August 6, 2014, Steven Ringo <[email protected]> wrote:

> Having a look at the inventory file immediately after the machine is
> provisioned, it does in fact update correctly.
>
> However it appears that the inventory file is run/read only once at the
> beginning of a playbook, so it will not reflect the new host if the deploy
> playbook is run by including it after the provisioning playbook.
>
> Looks like I will need to use add_host then, or find a way to get Ansible
> to refresh the inventory in the middle of a play.
>
>
> On 7 Aug 2014, at 12:02 pm, Steven Ringo <[email protected]
> <javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote:
>
> Hi,
>
> After provisioning a machine on ec2 module, the inventory doesn't reflect
> the new host (using ec2.py).
>
> I am using a tag_name for the target host that comes from the inventory.
>
> I have tried all of the following:
>
>    - pause of 60 seconds after provisioning.
>    - local_action to refresh the cache, calling ec2.py --refresh-cache
>    - changing the cache_max_age timeout to 0 in ec2.ini
>
> The other thing I tried was to use not use the inventory script, but to
> use add_host with the same group name as my tag name. This seems hacky
> though and seems also not read the group_vars, which is a problem.
>
> If anyone has any ideas, that would be great.
>
> Thanks,
>
> Steve
>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ansible-project/yWo3VGmNQH4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected]
> <javascript:_e(%7B%7D,'cvml','ansible-project%[email protected]');>
> .
> To post to this group, send email to [email protected]
> <javascript:_e(%7B%7D,'cvml','[email protected]');>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/f3fb161f-79f2-4b7f-b110-3e05c43c4f43%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/f3fb161f-79f2-4b7f-b110-3e05c43c4f43%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected]
> <javascript:_e(%7B%7D,'cvml','ansible-project%[email protected]');>
> .
> To post to this group, send email to [email protected]
> <javascript:_e(%7B%7D,'cvml','[email protected]');>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/AB2E0A34-3B5C-4990-A8E1-702F92D544DB%40stevenringo.com
> <https://groups.google.com/d/msgid/ansible-project/AB2E0A34-3B5C-4990-A8E1-702F92D544DB%40stevenringo.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Matt Martz
[email protected]
http://sivel.net/

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAD8N0v8ecNyuL%3DQR54D8etyck%2Bbot4AyLCszg3_F7JWvYDDdPg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to