我想循环从s0
to s60
和来自s100
to s100
用这个命令:
- name: "Network scan at port 22 {{ nom_base }}"
when: inventory_hostname in groups['exos_switch']
wait_for:
port: 22
host: "{{ nom_base }}-{{ item }}"
state: started
timeout: 2
with_items:
- s0
- s1
- s2
- s3
- s4
- s5
....
- s60
- s100
...
- s110
任何想法?
关于您的问题并评论解决方案,例如
- name: Show sequence
debug:
msg: "s{{ item }}"
with_sequence:
- "0-60"
- "100-110"
tags: seq
可能适合你。
- name: "Network scan at port 22 {{ nom_base }}"
wait_for:
port: 22
host: "{{ nom_base }}-s{{ item }}"
state: started
timeout: 2
with_sequence:
- "0-60"
- "100-110"
when: inventory_hostname in groups['exos_switch']
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)