0

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

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/"
4

1 回答 1

0

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

A:使用tower-cli

用法: tower-cli 库存获取 [OPTIONS] [ID]

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

答:使用tower_cli.cfg

$ cat $HOME/.tower_cli.cfg 
[general]
host = http://srv.example.com
username = admin
password = password
verify_ssl = no
于 2019-07-04T18:50:52.040 回答