-
Notifications
You must be signed in to change notification settings - Fork 23.8k
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 backward_sorted and backward_reverse_sorted ordering strategies #69801
Conversation
We're on the fence about accepting this feature. What is the use case for this? The test case gives the same result as needs_info |
Test cases give the same result because you need hostnames like fw-dc1-01, fw-dc1-02, fw-dc2-01, fw-dc2-02 for seeing the difference. As you can see with the 2 new algorithms you can run a play on primary or secondary nodes first. This can be handy if you have an active-backup HA solution in multiple data centers. Putting DC's name before numbering in hostnames is pretty common in larger companies that have multiple DCs. Should 'reverted name' be 'reversed name'? |
Ok. Can you add a changelog fragment and update the test data? See this fragment as an example. This would be classified as |
@segal90. This isn't intuitive and can lead to unexpected results. For example, if I had servers ending in -01 through -12, with backward_sorted I will get: -10, -01, -11, -02, -12, -03, etc. Could you get the ordering you want using |
@acozine, This algorithm could be useful with active-backup HA clusters where you have only 2-3 hosts (eg: lots of network device pairs). Probably you are right and it can lead to unexpected results but comparing to the benefit mentioned above, I think it worth. |
@segal90 thanks for the response. If this functionality gets merged, the docs team can add a sample inventory to the playbooks_strategies page to illustrate the results of each ordering strategy. |
@segal90 Would you be able to attend an IRC meeting to bring this up for discussion? ansible/community#541 |
Hi! Thanks very much for your submission to Ansible. It sincerely means a lot to us that you've taken time to contribute. Unfortunately, we're not sure if we want this feature in the program, and I don't want this to seem confrontational. Our reasons for this are:
However, we're absolutely always up for discussion. Since this is a really busy project, we don't always see comments on closed tickets, but want to encourage In the future, sometimes starting a discussion on the development list prior to implementing a feature can make getting things included a little easier, but it's not always necessary. Thank you once again for this and your interest in Ansible! |
SUMMARY
Add backward_sorted and backward_reverse_sorted ordering strategies.
ISSUE TYPE
COMPONENT NAME
Orders
ADDITIONAL INFORMATION
This ordering can be useful if you have hostnames like fw-dc1-01, fw-dc1-02, fw-dc2-01, fw-dc2-02.
With these orders you can run plays against 02 (backup) nods first then the 01 (primary) nodes.