It should be possible to write something like that as an action plugin. The only problem I see would be: what to do with group_vars?
Michael Peters <[email protected]> napisał: >You could try abstracting out the logic into a separate script that >both your inventory and your provisioning playbook could call to >determine which groups to put it in. I agree that it's a bit of a >pain. I'd really like to have this be possible as well since it would >really simplify some workflows. > >On Mon, Nov 17, 2014 at 6:14 PM, Josh Smift <[email protected]> wrote: >> MP> No, but you can add the machine to the necessary groups when you >use >> MP> add_host after its created. >> >> Yeah, I can mostly do this; the tricky thing is that there are some >> derived groups that the host gets added to based on logic in the >dynamic >> inventory script. I could in theory duplicate that logic in my >playbook, >> but it'd be hard to be sure to get right. >> >> Another workaround would be to have a wrapper script that calls >Ansible >> twice, once to launch and then a second time to configure; the tricky >> thing there is that we're using exact_count, and registering the new >> instances, so that we know which ones are new. I'm not sure how we'd >> preserve that across Ansible runs. >> >> -Josh ([email protected]) >> >> >> >> This email is intended for the person(s) to whom it is addressed and >may contain information that is PRIVILEGED or CONFIDENTIAL. Any >unauthorized use, distribution, copying, or disclosure by any person >other than the addressee(s) is strictly prohibited. If you have >received this email in error, please notify the sender immediately by >return email and delete the message and any attachments from your >system. >> >> -- >> 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/21610.33080.147191.662844%40gargle.gargle.HOWL. >> 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]. >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/CAJQqANf9QZVz%3D4bus83gRbFXtPYx6c6vYN-k8_AuR2kQ_wzAqg%40mail.gmail.com. >For more options, visit https://groups.google.com/d/optout. -- Wysłane za pomocą K-9 Mail. -- 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/fb594a00-3bf3-4efe-9c68-3cf24d97d825%40email.android.com. For more options, visit https://groups.google.com/d/optout.
