Ansible kubernetes module ignores the "wait" or "wait_timeout" Parameters

8/13/2019

I am trying to create DeploymentConfig, Service, Pod and Router from yaml file using ansible k8s module on OpenShift 3.9. The module hat a 3 Parameters "wait","wait_condition" and "wait_timeout". In my case I want to create those object and check when the pod come to a ready status.

I think Ansible ignore that parameters, it have to wait 200s, but it doesn't work for me. When I start Ansible in debug mode:

    "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

I can see "wait_timeout": 200 in stdout, but it doesnt work.

My playbook looks like:

- name: create something great!
  k8s:
    state: present
    src: template.yml
    wait: yes
    wait_timeout: 200

The object in template.yml are splited by ---:

---
apiVersion: v1
kind: DeploymentConfig
metadata:
  generation: 1
  labels:
...

---
apiVersion: v1
kind: Service
metadata:
  labels:
...
-- OleksandrM
ansible
kubernetes
openshift

0 Answers