【发布时间】:2018-10-05 07:20:10
【问题描述】:
如何设置过滤器以仅从模板中获取主机,这些主机的自定义变量设置为 true?
通过这个 curl,我得到了模板中的所有主机,但不是那些设置 custom_var 为真的主机
curl -k -s -u $apiuser:$apipassword -H 'Accept: application/json' -X
POST -H 'X-HTTP-Method-Override: GET' https://$url:$port/v1/objects
/hosts -d '{ "filter": "\"template\" in host.templates",
"filter_vars": { "custom_var": true } } ' | jq '.'
关于如何获取特定主机的任何想法?
【问题讨论】: