【发布时间】:2022-06-28 02:40:42
【问题描述】:
Ansible Playbook:我想在“主机”中使用 IP 地址范围。
我想执行从 10.134.10.1 到 10.134.10.99 IP 范围的剧本。即 10.134.10.[1-99].
我尝试了以下方法,但没有成功。
- name: Adhoc Commands
hosts: "10.134.10.1-99"
connection: local
gather_facts: false
tasks:
- name: running multiple commands
ios_command:
commands: "{{ item }}"
with_items: "{{ commandList }}"
register: output
【问题讨论】:
-
这能回答你的问题吗? Hosts with IP range
-
尝试用 "10.134.10.[1:99]" 修改 "10.134.10.1-99"