Ansible

如何增加25的awx cli結果限制

  • May 18, 2021

我在擁有超過 100 台伺服器的環境中使用 awx cli (19.1.0) 和 awx (13.0.0)

當(例如)查詢失敗或更改結果時:

awx --conf.host https://my.awx --conf.username myuser --conf.password mypass -k -f human --filter 'event_display,event_data,host_name,play,task,stdout' job_events list --job 1234 --event runner_on_ok --changed true > /tmp/tmp

我只得到 25 個結果。

(這適合 awx api 的分頁嗎?!)

是否可以選擇獲取 awx 執行的每個結果?

ARA將是 cli 的絕佳替代品,但不適用於我的環境/任務)


更新/提示--help我不知道如果成功通過身份驗證 ,似乎只能獲得正確的命令行幫助( )(請參閱我對答案的評論

要獲取所有結果,請將標誌 –all 添加到查詢中。

usage: awx job_events list [-h] [--all] [-f {json,yaml,jq,human}]
                      [--filter TEXT] [--conf.color BOOLEAN] [-v]
                      [--type {job_event}] [--created CREATED]
                      [--modified MODIFIED] [--job ID]
                      [--event {runner_on_failed,runner_on_start,runner_on_ok,runner_on_error,runner_on_skipped,runner_on_unreachable,runner_on_no_hosts,runner_on_async_poll,runner_on_async_ok,runner_on_async_failed,runner_item_on_ok,runner_item_on_failed,runner_item_on_skipped,runner_retry,runner_on_file_diff,playbook_on_start,playbook_on_notify,playbook_on_include,playbook_on_no_hosts_matched,playbook_on_no_hosts_remaining,playbook_on_task_start,playbook_on_vars_prompt,playbook_on_setup,playbook_on_import_for_host,playbook_on_not_import_for_host,playbook_on_play_start,playbook_on_stats,debug,verbose,deprecated,warning,system_warning,error}]
                      [--counter INTEGER] [--event_data JSON/YAML]
                      [--failed BOOLEAN] [--changed BOOLEAN]
                      [--uuid TEXT] [--parent_uuid TEXT] [--host ID]
                      [--host_name TEXT] [--playbook TEXT] [--play TEXT]
                      [--task TEXT] [--role TEXT] [--stdout TEXT]
                      [--start_line INTEGER] [--end_line INTEGER]
                      [--verbosity INTEGER]

--all

   fetch all pages of content from the API when returning results (instead of just the first page)

參考:Ansible Tower/AWX CLI v3.8.3 使用者指南

引用自:https://serverfault.com/questions/1063803