首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将攻略包含到主攻略中

将攻略包含到主攻略中
EN

Stack Overflow用户
提问于 2017-08-09 18:25:22
回答 1查看 255关注 0票数 0

如何将子剧本包含到主剧本中?子剧本包含多个主机组

示例: child-sample.yml

代码语言:javascript
复制
- 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=started

master-sample.yml应该如何包含这样的子剧本?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-08-09 18:28:42

它就像这样简单:

master-sample.yaml:

代码语言:javascript
复制
- include: child-sample.yml
- include: child-sample2.yml
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45588027

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档