菜单可以调用之前所有的剧本
文件内使用 - import_playbook模块调用剧本
[root@ansible-40-155 ansible.ceshi.yaml]# vim main.yaml
- import_playbook: back.yaml
- import_playbook: yum.yaml
- import_playbook: apacheck.yaml
[root@ansible-40-155 ansible.ceshi.yaml]# ansible-playbook -C main.yaml
PLAY [web] ***********************************************************************************
TASK [Gathering Facts] ***********************************************************************
ok: [192.168.40.156]
ok: [192.168.40.157]
TASK [Copy Stop selinux] *********************************************************************
ok: [192.168.40.156]
ok: [192.168.40.157]
TASK [Shell stop selinux] ********************************************************************
skipping: [192.168.40.156]
skipping: [192.168.40.157]
TASK [Stop firewalld] ************************************************************************
ok: [192.168.40.157]
ok: [192.168.40.156]
TASK [Wget yum.repo] *************************************************************************
skipping: [192.168.40.157]
skipping: [192.168.40.156]
PLAY [nfs] ***********************************************************************************
TASK [Gathering Facts] ***********************************************************************
ok: [192.168.40.157]
TASK [Install Httpd] *************************************************************************
ok: [192.168.40.157]
TASK [Cory conf] *****************************************************************************
ok: [192.168.40.157]
TASK [Start Sevice] **************************************************************************
changed: [192.168.40.157]
PLAY RECAP ***********************************************************************************
192.168.40.156 : ok=3 changed=0 unreachable=0 failed=0 skipped=2 rescued=0 ignored=0
192.168.40.157 : ok=7 changed=1 unreachable=0 failed=0 skipped=2 rescued=0 ignored=0