如何将子剧本包含到主剧本中?子剧本包含多个主机组
示例: child-sample.yml
- hosts: webservers
remote_user: root
- tasks:
name: ensure apache is at the latest version
yum: name=httpd state=latest
name: write the apache config file
template: src=/srv/httpd.j2 dest=/etc/httpd.conf
- hosts: databases
remote_user: root
- tasks:
name: ensure postgresql is at the latest version
yum: name=postgresql state=latest
name: ensure that postgresql is started
service: name=postgresql state=startedmaster-sample.yml应该如何包含这样的子剧本?
发布于 2017-08-09 18:28:42
它就像这样简单:
master-sample.yaml:
- include: child-sample.yml
- include: child-sample2.ymlhttps://stackoverflow.com/questions/45588027
复制相似问题