vars
定义方法
第一种定义方法
---
- hosts: testB
vars: 定义变量
var1: file 变量值
remote_user: root
tasks:
- name: touch file
file: path=/testdir/{
{
var1}} state=touch
第二种定义方法
---
- hosts: testB
vars:
- var1: file
remote_user: root
tasks:
- name: touch file
file: path=/testdir/{
{
var1}} state=touch
定义多个变量
第一种
---
- hosts: testB
vars:
- var1: file
- var2: file2
remote_user: root
tasks: