我们知道ansible playbook可由多个play组成,而每个play又可以由多个task组成,如果不熟悉playbook play概念的可参考ansible playbook基本概念
下面是一个常用的playbook,里面包括3个play,以其中一个“apply common configuration to all nodes“为例,这就是一个play,其中name, hosts, remote_user 和roles都是属于play的参数。
---
# This playbook deploys the whole application stack in this site.
- name: apply common configuration to all nodes
hosts: all
remote_user: root
roles:
- common
- name: configure and deploy the webservers and application code
hosts: webservers
remote_user: root
roles:
- web
- name: deploy MySQL and configure the databases
hosts: dbservers
remote_user: root
roles:
- db
那除了这些参数,play还有哪些比较常用的参数可配置呢?这篇文章我们就会列出一些常用的参数
参数<
推荐文章
发表评论