一、设置tab键双空格缩进

[student@workstation ~]$ vim ~/.vimrc
autocmd FileType yaml setlocal ai ts=2 sw=2 et

二、样例(考题)

[student@workstation ansible]$ vim install.yml
—-
- name: install
hosts:
- servera
- serverb
- serverc(列表操作)
tasks:
- name: install the latest version of Apache
yum:
name: httpd
state: latest
需注意缩进

三、空运行脚本

[student@workstation ansible]$ ansible-playbook -C install.yml
(检查语法)