location~\.php${root/web;fastcgi_pass127.0.0.1:9000;fastcgi_index index.php;fastcgi_paramSCRIPT_FILENAME$document_root$fastcgi_script_name;include fastcgi_params;}# deny access to.htaccess files,ifApache's document root # concurswithnginx's one # #location~/\.ht{# deny all;#}}include vhost...
TASK [nginx : debug]***ok: [web1]=>{"rrr": {"changed":true,"failed":false,"rc":0,"stderr":"Shared connection to 192.168.200.131 closed.\r\n","stderr_lines": ["Shared connection to 192.168.200.131 closed."],"stdout":"/usr/bin/wget\r\n--2018-11-12 19:02:03-- http://m...
src:"{{ base_dir }}/ansible_home/auto_deploy/auto_install.sh"dest:"{{ base_dir }}/auto_deploy/"- name:testifnginx has been installedinremote server. shell:ls"{{ install_dir }}/nginx/sbin/nginx"ignore_errors: True register: result - name: execute shell script toinstallnginxinremote ...
/bin/sh## nginx - this script starts and stops the nginx daemon## chkconfig: - 85 15# description: Nginx is an HTTP(S) server, HTTP(S) reverse \# proxy and IMAP/POP3 proxy server# processname: nginx# config: /etc/nginx/nginx.conf# config: /etc/sysconfig/nginx# pidfile: /var/ru...
-import_tasks:script.yml# 此文件为给被控端传送nginx启动脚本并启动服务的 然后接着来看第一步的解压nginx包的文件 nginx/tasks/install.yml 在yml执行时按照tasks的main.yml文件排列好的顺序执行,首先执行install.yml cat/etc/ansible/roles/nginx/tasks/install.yml ...
-nginx_install###roles目录下的nginx_install目录 -nginx_config###roles目录下的nginx_config目录 5、查看目录结构: [root@cml1 roles]# tree . ├── nginx_config │ ├── default │ ├── files │ ├── handlers │ │ └── main.yml ...
mkdir -p roles/nginx_instll/{handlers,files,meta,tasks,templates,vars,default} 1、配置主要逻辑文件: [root@node4 ansible]# cat roles/nginx_install/tasks/main.yml - name: copy nginx package to remote host copy: src=nginx-1.12.0.tar.gz dest=/usr/local/src/nginx-1.12.0.tar.gz#调用files...
80##location ~ \.php$ {# proxy_pass http://127.0.0.1;#}# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000##location ~ \.php$ {# root html;# fastcgi_pass 127.0.0.1:9000;# fastcgi_index index.php;# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;# ...
ansible all-m script-a'test.sh' 直接在-a 后面指定脚本即可。 ===selinux: 管理selinux。 === 代码语言:javascript 复制 conf #指定应用selinux的配置文件。 state=enforcing|permissive|disabled #对应于selinux配置文件的SELINUX。 policy=targeted|minimum...
script模块: 在远程主机上执行主控端的脚本,相当于scp+shell组合。stat模块: 获取远程文件的状态信息,包括atime,ctime,mtime,md5,uid,gid等信息。cron模块: 远程主机crontab配置。mount模块: 挂载文件系统。find模块: 帮助在被管理主机中查找符合条件的文件,就像 find 命令一样。selinux模块:远程管理受控节点的selinux...