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

inventory file host processing order changed #13522

Closed
jschank opened this issue Dec 11, 2015 · 2 comments
Closed

inventory file host processing order changed #13522

jschank opened this issue Dec 11, 2015 · 2 comments
Labels
bug This issue/PR relates to a bug.
Milestone

Comments

@jschank
Copy link

jschank commented Dec 11, 2015

In earlier versions of ansible I tried very hard to ensure my hosts were processed in a specific order

But in recent versions my hosts get processed in some unordered fashion. I understood this might happen if ansible were processing hosts in groups. But I am using "serial: 1" to ensure the hosts are processed 1 at a time.

How can I ensure that my hosts get processed in sequence?

This is how I WAS ensuring sequence. I would run my playbook using deploy_to_verify (for example as my targets. The idea was that the sequence would be built based upon how the groups are defined)

# -----
# This section defines all the
# deployment machines we have
# If you change the shortnames here - be sure to update the two lists in group_vars/all/global.yml
# -----
[change]
abc-wpchange1.abc.prod      user=change1    env_short_name=change
abc-wpchange2.abc.prod      user=change2    env_short_name=change

[content]
abc-wpcontent1.abc.prod     user=content1   env_short_name=content

[verify]
abc-wpverify1.abc.prod      user=change1    env_short_name=verify
abc-wpverify2.abc.prod      user=change1    env_short_name=verify

[preview]
abc-wppreview1.abc.prod     user=change1    env_short_name=preview

[big_dance]
abc-wpbdance1.abc.prod      user=promusr    env_short_name=big_dance    ansible_become='yes'

[production]
; abc-wpweb01.abc.prod        user=promusr    env_short_name=production    ansible_become='yes'
; abc-wpweb02.abc.prod        user=promusr    env_short_name=production    ansible_become='yes'
abc-wpweb03.abc.prod        user=promusr    env_short_name=production    ansible_become='yes'


# -----
# These groups define the 
# deployment sequence
# -----
[deploy_to_change:children]
change

[deploy_to_content:children]
deploy_to_change
content

[deploy_to_verify:children]
deploy_to_content
verify

[deploy_to_preview:children]
deploy_to_verify
preview

[deploy_to_big_dance:children]
deploy_to_preview
big_dance

[deploy_to_production:children]
deploy_to_big_dance
production
@bcoca bcoca added this to the v2 milestone Dec 11, 2015
bcoca added a commit that referenced this issue Dec 11, 2015
swiched to using a list comp and set to still unique but keep expected order
fixes #13522
@bcoca bcoca closed this as completed in ae988ed Dec 11, 2015
@jschank
Copy link
Author

jschank commented Dec 11, 2015

I appreciate the speedy implementation. Color me totally impressed. Thank you

@bcoca
Copy link
Member

bcoca commented Dec 11, 2015 via email

@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 7, 2018
@ansible ansible locked and limited conversation to collaborators Apr 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue/PR relates to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants