1、在模拟一个http的role
1 [root@linux-node1 ansible]# cat httpd_role.yml 2 - hosts: date 3 remote_user: root 4 5 roles: 6 - httpd 7 [root@linux-node1 tasks]# cat main.yml 8 - include: user.yml 9 - include: copyfile.yml 10 [root@linux-node1 tasks]# cat copyfile.yml 11 - name: copy files 12 copy: src=httpd.conf dest=/data1/ owner=apache 13 [root@linux-node1 tasks]# cat user.yml 14 - name: create user 15 user: name=apache 16 17 #httpd.conf 模拟的测试文件