包括剧本到大师剧本

时间:2017-08-09 10:25:22

标签: ansible

如何将儿童剧本纳入大师剧本?儿童游戏手册包含多个主机组

示例: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=started

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

1 个答案:

答案 0 :(得分:1)

这很简单:

主sample.yaml:

- include: child-sample.yml
- include: child-sample2.yml