剧本看起来像:
- hosts: all
tasks:
- name: "run on all hosts,1"
shell: something1
- name: "run on all hosts,2"
shell: something2
- name: "run on one host, any host would do"
shell: this_command_should_run_on_one_host
- name: "run on all hosts,3"
shell: something3
Run Code Online (Sandbox Code Playgroud)
我知道使用命令行选项--limit,我可以限制为一个主机,是否可以在playbook中执行此操作?
ansible ×1