我正在尝试使用OpenShift 3.9上的ansible k8s模块从yaml文件创建DeploymentConfig,Service,Pod和Router。该模块具有3个参数“ wait”,“ wait_condition”和“ wait_timeout”。就我而言,我想创建这些对象并检查pod何时变为 ready 状态。
我认为Ansible会忽略该参数,它必须等待200秒,但对我而言不起作用。 当我在调试模式下启动Ansible时:
"changed": true,
"invocation": {
"module_args": {
"api_key": null,
"api_version": "v1",
"append_hash": false,
"ca_cert": null,
"client_cert": null,
"client_key": null,
"context": null,
"force": false,
"host": null,
"kind": null,
"kubeconfig": null,
"merge_type": null,
"name": null,
"namespace": null,
"password": null,
"resource_definition": null,
"src": "template.yml",
"state": "present",
"username": null,
"validate": null,
"validate_certs": null,
"wait": true,
"wait_condition": null,
"wait_timeout": 200
我可以在标准输出中看到“ wait_timeout”:200 ,但这是行不通的。
我的剧本看起来像:
- name: create something great!
k8s:
state: present
src: template.yml
wait: yes
wait_timeout: 200
template.yml中的对象被-分割:
---
apiVersion: v1
kind: DeploymentConfig
metadata:
generation: 1
labels:
...
---
apiVersion: v1
kind: Service
metadata:
labels:
...