---- hosts: webserroles:- { role: nginx, tags: ['web', 'nginx'] } #设置角色标签- { role: php, when: ansible_version == "7" }- role: mysqld
指定标签运行: ansible-playbook -t web lamp.yaml
#task main.yaml- include: yum.yaml- include: template.yaml- include: roles/httpd/
