Skip to content

Instantly share code, notes, and snippets.

@amg1127
Last active July 27, 2021 10:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amg1127/d7a6b61d058a31d273ed0197825579ed to your computer and use it in GitHub Desktop.
Save amg1127/d7a6b61d058a31d273ed0197825579ed to your computer and use it in GitHub Desktop.
Ansible execution order issue - https://github.com/ansible/ansible/issues/75334
---
all:
children:
LBs:
children:
LBs_PRD_east:
hosts:
LBs_PRD_east_A:
pos: 10
LBs_PRD_east_B:
pos: 11
LBs_PRD_west:
hosts:
LBs_PRD_west_A:
pos: 12
LBs_PRD_west_B:
pos: 13
LBs_STG_east:
hosts:
LBs_STG_east_A:
pos: 14
LBs_STG_east_B:
pos: 15
LBs_STG_west:
hosts:
LBs_STG_west_A:
pos: 16
LBs_STG_west_B:
pos: 17
Linux:
children:
Linux_CnC:
hosts:
Linux_CnC_A:
pos: 18
Linux_CnC_B:
pos: 19
Linux_DBs:
children:
Linux_DBs_PRD:
children:
Linux_MariaDBs_PRD:
children:
Linux_MariaDBs_PRD_east:
hosts:
Linux_MariaDBs_PRD_east_A:
pos: 20
Linux_MariaDBs_PRD_east_B:
pos: 21
Linux_MariaDBs_PRD_west:
hosts:
Linux_MariaDBs_PRD_west_A:
pos: 22
Linux_MariaDBs_PRD_west_B:
pos: 23
Linux_RedisDBs_PRD:
children:
Linux_RedisDBs_PRD_east:
hosts:
Linux_RedisDBs_PRD_east_A:
pos: 24
Linux_RedisDBs_PRD_east_B:
pos: 25
Linux_WebSrvs:
children:
Linux_WebSrvs_PRD:
children:
Linux_ApacheWebSrvs_PRD:
children:
Linux_ApacheWebSrvs_PRD_east:
hosts:
Linux_ApacheWebSrvs_PRD_east_A:
pos: 26
Linux_ApacheWebSrvs_PRD_east_B:
pos: 27
Linux_ApacheWebSrvs_PRD_west:
hosts:
Linux_ApacheWebSrvs_PRD_west_A:
pos: 28
Linux_ApacheWebSrvs_PRD_west_B:
pos: 29
Linux_nginxWebSrvs_PRD:
children:
Linux_nginxWebSrvs_PRD_east:
hosts:
Linux_nginxWebSrvs_PRD_east_A:
pos: 30
Linux_nginxWebSrvs_PRD_east_B:
pos: 31
Linux_nginxWebSrvs_PRD_east_C:
pos: 32
Linux_nginxWebSrvs_PRD_east_D:
pos: 33
Linux_nginxWebSrvs_PRD_east_E:
pos: 34
Linux_nginxWebSrvs_PRD_west:
hosts:
Linux_nginxWebSrvs_PRD_west_A:
pos: 35
Linux_nginxWebSrvs_PRD_west_B:
pos: 36
Linux_nginxWebSrvs_PRD_west_C:
pos: 37
Linux_nginxWebSrvs_PRD_west_D:
pos: 38
Linux_nginxWebSrvs_PRD_west_E:
pos: 39
Linux_SquidSrvs_PRD:
children:
Linux_SquidSrvs_PRD_east:
hosts:
Linux_SquidSrvs_PRD_east_A:
pos: 40
Linux_SquidSrvs_PRD_west:
hosts:
Linux_WebSrvs_STG:
children:
Linux_ApacheWebSrvs_STG:
children:
Linux_ApacheWebSrvs_STG_east:
hosts:
Linux_ApacheWebSrvs_STG_east_A:
pos: 41
Linux_ApacheWebSrvs_STG_east_B:
pos: 42
Linux_ApacheWebSrvs_STG_west:
hosts:
Linux_ApacheWebSrvs_STG_west_A:
pos: 43
Linux_ApacheWebSrvs_STG_west_B:
pos: 44
Linux_nginxWebSrvs_STG:
children:
Linux_nginxWebSrvs_STG_east:
hosts:
Linux_nginxWebSrvs_STG_east_A:
pos: 45
Linux_nginxWebSrvs_STG_east_B:
pos: 46
Linux_nginxWebSrvs_STG_east_C:
pos: 47
Linux_nginxWebSrvs_STG_east_D:
pos: 48
Linux_nginxWebSrvs_STG_east_E:
pos: 49
Linux_nginxWebSrvs_STG_west:
hosts:
Linux_nginxWebSrvs_STG_west_A:
pos: 50
Linux_nginxWebSrvs_STG_west_B:
pos: 51
Linux_nginxWebSrvs_STG_west_C:
pos: 52
Linux_nginxWebSrvs_STG_west_D:
pos: 53
Linux_nginxWebSrvs_STG_west_E:
pos: 54
Linux_SquidSrvs_STG:
children:
Linux_SquidSrvs_STG_east:
hosts:
Linux_SquidSrvs_STG_west:
hosts:
Linux_WebSrvs_DEV:
children:
Linux_ApacheWebSrvs_DEV:
children:
Linux_ApacheWebSrvs_DEV_east:
hosts:
Linux_ApacheWebSrvs_DEV_east_A:
pos: 55
Linux_ApacheWebSrvs_DEV_east_B:
pos: 56
Linux_ApacheWebSrvs_DEV_west:
hosts:
Linux_ApacheWebSrvs_DEV_west_A:
pos: 57
Linux_ApacheWebSrvs_DEV_west_B:
pos: 58
Linux_nginxWebSrvs_DEV:
children:
Linux_nginxWebSrvs_DEV_east:
hosts:
Linux_nginxWebSrvs_DEV_east_A:
pos: 59
Linux_nginxWebSrvs_DEV_east_B:
pos: 60
Linux_nginxWebSrvs_DEV_east_C:
pos: 61
Linux_nginxWebSrvs_DEV_east_D:
pos: 62
Linux_nginxWebSrvs_DEV_east_E:
pos: 63
Linux_nginxWebSrvs_DEV_west:
hosts:
Linux_nginxWebSrvs_DEV_west_A:
pos: 64
Linux_nginxWebSrvs_DEV_west_B:
pos: 65
Linux_nginxWebSrvs_DEV_west_C:
pos: 66
Linux_nginxWebSrvs_DEV_west_D:
pos: 67
Linux_nginxWebSrvs_DEV_west_E:
pos: 68
Linux_SquidSrvs_DEV:
children:
Linux_SquidSrvs_DEV_east:
hosts:
Linux_SquidSrvs_DEV_east_A:
pos: 69
Linux_SquidSrvs_DEV_west:
hosts:
Linux_SquidSrvs_DEV_west_A:
pos: 70
---
- hosts: all
gather_facts: no
serial: 1
order: inventory
tasks:
- name: Debug
debug:
msg: "{{ pos }}: {{ inventory_hostname }}"
---
- hosts:
- Linux_nginxWebSrvs_STG_west
- Linux_ApacheWebSrvs_STG_west
gather_facts: no
serial: 1
order: inventory
tasks:
- name: Debug
debug:
msg: "{{ pos }}: {{ inventory_hostname }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment