Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to launch a new instance on every run #1937

Open
1 task done
elnur opened this issue Dec 28, 2023 · 0 comments
Open
1 task done

Add a way to launch a new instance on every run #1937

elnur opened this issue Dec 28, 2023 · 0 comments
Labels
jira needs_verified Some one might want to take a look at this and reproduce it to confirm

Comments

@elnur
Copy link

elnur commented Dec 28, 2023

Summary

ec2_instance — back when it was just ec2 — would start a new instance on every run. At some point, it stopped doing that. Now, if there's an existing instance matching some properties of the instance I'm trying to create, it would target that instance instead of launching a new one.

Given that Ansible tasks are supposed to be idempotent, I guess the new way of working makes more sense. But there are cases where I need the old behavior.

I browsed the docs of the module and couldn't find anything — like a flag — to force creation of a new instance. Either I'm missing something, or it's just impossible to do it anymore.

A workaround I'm currently using to reproduce the old behavior is appending the current timestamp to the name of the instance. That makes the Name tag unique and hence it launches a new instance on every run. But it'd be nice to have a more elegant solution.

I'm proposing to add a new state like launched which would do exactly that — launch a new instance.

Issue Type

Feature Idea

Component Name

ec2_instance

Additional Information

No response

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@hakbailey hakbailey added needs_verified Some one might want to take a look at this and reproduce it to confirm jira and removed needs_triage labels Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira needs_verified Some one might want to take a look at this and reproduce it to confirm
Projects
None yet
Development

No branches or pull requests

2 participants