开源软件名称:nginx-ansible
开源软件地址:https://gitee.com/pippozq/nginx-ansible
开源软件介绍:
nginx-ansible- 采用ansible自动编译,安装,配置nginx
- 动态生成configure.sh脚本
- 已测试nginx 1.12.2版本
- 支持增加新模块
- 支持centos7.x + , OpenSuse, Ubuntu
安装 nginx- 下载nginx 版本到本地任意目录
- 更新vars/var_nginx.yml 文件中的{{download_path}},工程中files下已放有部分文件,可直接指定为此目录, configure命令添加模块,是采取读取config_list 列表信息,如果你需要增加或删减模块,可在此处更新。同时需要额外编译的模块,可以在role中进行增加,而后在install_nginx role的main.yml文件进行引用
---# versionnginx_version: 1.12.2 # your nginx versionlibunwind_version: 1.1 # mode versiongperftools_version: 2.2.1mod_strip_version: 0.1echo_nginx_module_version: 0.58#set_misc_nginx_module_version: 0.29# system sys_user: rootsys_group: rootnginx_user: rootdownload_path: '/home/pippo/Downloads/nginx' # local download pathdownload_dir: /tmp # remote download_dirinstall_dir: /opt # install dir# nginx config list, add your new mod into listconfig_list: - "--prefix={{install_dir}}/nginx-{{nginx_version}}" - "--with-stream" - "--with-http_realip_module" - "--with-google_perftools_module" - "--with-pcre" - "--with-http_ssl_module" - "--with-http_gzip_static_module" - "--with-http_stub_status_module" - "--add-module={{download_dir}}/temp/mod_strip-{{mod_strip_version}}"# nginx config path http_conf_path: "http_conf.d" # for http tcp_conf_path: "tcp_conf.d" # for tcp #nginx.configworker_processes: 8 # nginx process# create pathcreate_path: - "{{install_dir}}" - "{{download_dir}}/temp"# firewall port firewall_ports: - "80" - 更新hosts文件
- 执行shell
ansible-playbook -i hosts nginx.yml LicenseGNU General Public License v3.0 |
请发表评论