卷曲命令从ansible塔获取库存ID

时间:2019-07-04 17:50:48

标签: curl ansible ansible-inventory ansible-tower

我需要使用curl命令从ansible塔中检索给定项目(project_dev是项目名称)的ventory_id

curl -X GET -s -k -u "user:password" -vvv  -H 'Content-Type:application/json' -d '{"organization": 1,"name": "project-dev"}' https://ansibletower.com/api/v2/inventories/"

1 个答案:

答案 0 :(得分:0)

Q: I need to retrieve the inventory_id from ansible tower.

A:使用tower-cli

  

用法:tow​​er-cli库存获得[选项] [ID]

Q: How to add special character password to tower-cli config?

A:使用tower_cli.cfg

$ cat $HOME/.tower_cli.cfg 
[general]
host = http://srv.example.com
username = admin
password = password
verify_ssl = no