1.deploy_nginx.yml
---
- hosts: webservers
become: yes
become_method: sudo
vars:
worker_processes: 4
worker_connections: 1000
max_open_files: 1000
tasks:
- name: install nginx
yum: name=nginx state=latest
- name: copy nginx config file
template: src=/root/nginx.conf.j2 dest=/etc/nginx/nginx.conf
notify: restart nginx
handlers:
- name: restart nginx
service: name=nginx state=restarted
2.nginx.conf.j2
worker_processes {{ worker_processes }};
worker_rlimit_nofile {{ max_open_files }};
events {
worker_connections {{ worker_connections }};
}
http{
......
}
「 文章如果对你有帮助,请点个赞哦^^ 」 
1+
若无特殊注明,文章均为本站原创或整理发布。
转载请注明本文地址:https://om.fangxiaoxiong.com/2574.html