Questions tagged «json»

1
在Jinja2模板中循环Ansible变量数组
当Ansible收集有关主机的事实时,例如获取主机的所有坐骑: "ansible_mounts": [ { "block_available": 7800291, "block_size": 4096, "block_total": 8225358, "block_used": 425067, "device": "/dev/mapper/foobar", "fstype": "xfs", "inode_available": 16403366, "inode_total": 16458752, "inode_used": 55386, "mount": "/", "options": "rw,seclabel,relatime,attr2,inode64,noquota", "size_available": 31949991936, "size_total": 33691066368, "uuid": "2ebc82cb-5bc2-4db9-9914-33d65ba350b8" }, { "block_available": 44648, "block_size": 4096, "block_total": 127145, "block_used": 82497, "device": "/dev/sda1", "fstype": "xfs", "inode_available": 255595, "inode_total": 256000, …
12 ansible  json  jinja 

2
我可以将所有目录请求别名到nginx中的单个文件吗?
我试图弄清楚如何在nginx中接收对特定目录的所有请求并返回不带重定向的json字符串。 例: curl -i http://example.com/api/call1/ 预期结果: HTTP/1.1 200 OK Accept-Ranges: bytes Content-Type: application/json Date: Fri, 13 Apr 2012 23:48:21 GMT Last-Modified: Fri, 13 Apr 2012 22:58:56 GMT Server: nginx X-UA-Compatible: IE=Edge,chrome=1 Content-Length: 38 Connection: keep-alive {"logout": true} 到目前为止,我的nginx conf中包含以下内容: location ~ ^/api/(.*)$ { index /api_logout.json; alias /path/to/file/api_logout.json; types { } …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.