1. ---
    2. - hosts: webser
    3. roles:
    4. - { role: nginx, tags: ['web', 'nginx'] } #设置角色标签
    5. - { role: php, when: ansible_version == "7" }
    6. - role: mysqld

    指定标签运行: ansible-playbook -t web lamp.yaml

    1. #task main.yaml
    2. - include: yum.yaml
    3. - include: template.yaml
    4. - include: roles/httpd/