Closed shayrybak closed 6 years ago
In addition I tried removing the task that deletes the namespace and create the namespace manually Then when I run the playbook I get:
(ansible-container) Shays-MBP:deploy-test shay$ ansible-playbook ansible-deployment/test.yml
[WARNING]: Unable to parse /etc/ansible/hosts as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
PLAY [Manage the lifecycle of test on K8s] *****************************************************************************************************************************************************************
TASK [ansible.kubernetes-modules : Install latest openshift client] ****************************************************************************************************************************************
skipping: [localhost]
TASK [Create namespace test] *******************************************************************************************************************************************************************************
ok: [localhost]
TASK [Create service] **************************************************************************************************************************************************************************************
ok: [localhost]
TASK [Stop running containers by scaling replicas down to 0] ***********************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: Exception: Error initializing AnsibleModuleHelper: {"message": "Error: Apps_v1beta1Deployment was not found in client.models. Did you specify the correct Kind and API Version?"}
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/var/folders/69/63n5td7x39nc0vt9y2m28fbw0000gn/T/ansible_G9_MMc/ansible_module_k8s_apps_v1beta1_deployment.py\", line 4751, in <module>\n main()\n File \"/var/folders/69/63n5td7x39nc0vt9y2m28fbw0000gn/T/ansible_G9_MMc/ansible_module_k8s_apps_v1beta1_deployment.py\", line 4742, in main\n raise Exception(exc.message)\nException: Error initializing AnsibleModuleHelper: {\"message\": \"Error: Apps_v1beta1Deployment was not found in client.models. Did you specify the correct Kind and API Version?\"}\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 0}
to retry, use: --limit @/Users/shay/projects/ansible-container/projects/deploy-test/ansible-deployment/test.retry
PLAY RECAP *************************************************************************************************************************************************************************************************
localhost : ok=2 changed=0 unreachable=0 failed=1
The playbook generated contains all parts of the lifecycle for your app, separated by tags. So the appropriate command to run would be ansible-playbook test.yml --tags=start
for example.
@j00bar , Thanks for that. I missed that part. Can you look at my previous comment? I get that error even after using --tags start
Hi @shayrybak -
Does this error still occur with the latest version of Ansible Container, relying on the newest python-openshift bindings? Thanks!
This was fixed with the python-openshift update. Thanks
ISSUE TYPE
container.yml
OS / ENVIRONMENT
SUMMARY
After creating a deploy playbook and running it with ansible-playbook, I get an error that the namespace doesn't exist
STEPS TO REPRODUCE
EXPECTED RESULTS
working playbook deploying to k8s
ACTUAL RESULTS