vars_files 可以把var定义的变量分离出来方便修改和复用
- hosts: 127.0.0.1
vars_files:
- ./var1.yaml
tasks:
- name: debug
debug:
msg: http://{{ bind.ip }}:{{ bind.port }}
# var1.yaml
bind:
ip: 127.0.0.1
port: 8000
标签:files,vars,0.1,bind,playbook,ip
From: https://www.cnblogs.com/wangend/p/17061425.html