我在主机清单中有 100 台主机。主机清单如下所示:
[workstations-new]
de001pc[100:201] ansible_connection=ssh ansible_ssh_user=root
当我运行 ansible-playbook 命令时:
ansible-playbook playbooks/linux/uptime.yml -i hosts-inventory --extra-vars "hosts=workstations-new" -k
正在所有主机上运行它,但它不会按升序排列主机。它以非顺序(103、14、102、100,...)
例子:
TASK: [uptime machine] ********************************************************
changed: [de001pc103]
changed: [de001pc104]
changed: [de001pc102]
changed: [de001pc100]
changed: [de001pc101]
changed: [de001pc107]
changed: [de001pc106]
changed: [de001pc108]
changed: [de001pc109]
changed: [de001pc110]
changed: [de001pc116]
changed: [de001pc112]
................................................
如何运行命令以升序获取主机?