Ansible进阶 、 Ansible Role
playbook
模块
# 在test组中的主机上,安装httpd、php、php-mysqlnd
[root@control ansible]# vim pkg.yml
---
- name: install pkgs
hosts: test
tasks:
- name: install web pkgs
yum:
name: httpd,php,php-mysqlnd
state: present
# 安装多个软件包,还可以写为:
---
- name: install pkgs
hosts: test
tasks:
- name: install web pkgs
yum:
name: [httpd,php,php-mysqlnd]
state: present
# 安装多个软件包,
共有 0 条评论