0

我想了解如何在使用计划创建库存后立即进行库存同步(如下所示):

tower-cli schedule create --name sync_schedule --inventory-source 182 --rrule "DTSTART:20190507T183000Z RRULE:FREQ=DAILY;INTERVAL=1;COUNT=1"

想弄清楚规则在创建后立即同步一次。

4

1 回答 1

1

解决方案是在 API 调用中将“update_on_launch”值设置为 true:

curl  --silent -lk  -u $user:$password -H 'Content-Type:application/json' -XPOST -d '{"name": '\"$project_name\"',"inventory": '\"$inventory_id\"',"source_script": 4,"credential": null,"overwrite_vars": true,"overwrite": true,"update_on_launch": true,"verbosity": 1,"update_cache_timeout": 0,"source_regions":"","source_vars":"---\nTERRAFORM_ENV: stl/'$project_name'","source":"custom"}' https://awx.com/api/v2/inventory_sources/
于 2019-07-12T16:15:09.043 回答