网站首页 文章专栏 ansible-ruuner-service https 请求测试
前提进入目录 /etc/ansible-runner-service/certs/client
# 执行 runnertest.yml playbook
curl -i -k --key ./client.key --cert ./client.crt -H "Content-Type: application/json" --data '{"time_delay": 30}' https://localhost:5001/api/v1/playbooks/runnertest.yml -X POST
# 查看job 状态
curl -i -k --key ./client.key --cert ./client.crt https://localhost:5001/api/v1/playbooks/0a73d698-94bc-11ed-8b05-00155d3d0101 -X GET
# 查看job 运行时或结果后的打印输出列表
curl -i -k --key ./client.key --cert ./client.crt https://localhost:5001/api/v1/jobs/0a73d698-94bc-11ed-8b05-00155d3d0101/events -X GET
# 查看 某一个 event 的打印输出
curl -i -k --key ./client.key --cert ./client.crt https://localhost:5001/api/v1/jobs/0a73d698-94bc-11ed-8b05-00155d3d0101/events/16-c4128771-d0cd-4016-af28-bf170c64b4fa -X GET
当然这样一个一个看每行的结果不太方便。我们可以Python 脚本查看python 脚本查看ansible-runner-service任务运行结果
部署 anisble-runner-ansible 查看另一个文章 ansible rest api ansible-runner-service 容器部署