# Convert a kubectl command to ansible equivalent command

**URL:** <https://forum.ansible.com/t/convert-a-kubectl-command-to-ansible-equivalent-command/34851>\
**Category:** Ansible Developer\
**Created:** [March 25, 2021, 9:55am UTC](https://forum.ansible.com/t/convert-a-kubectl-command-to-ansible-equivalent-command/34851 "2021-03-25T09:55:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![George\_Tsoumplekas](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@George\_Tsoumplekas](https://forum.ansible.com/u/George_Tsoumplekas)\
**Post date:** [March 25, 2021, 9:55am UTC](https://forum.ansible.com/t/convert-a-kubectl-command-to-ansible-equivalent-command/34851/1 "2021-03-25T09:55:53Z")

</div>

I am using helm operators and I would like to convert the following command

kubectl patch deployment -n my\_namespace myoperator-operator --type=‘json’ -p=‘[{“op”: “replace”, “path”: “/spec/template/spec/containers/0/image”, “value”:“127.0.0.1/my-operator:myoperator\_new\_version”}]’

in an ansible equivalent command. The reason behind this, is that I would like to create a role which will be called from a playbook. How to do this?

My question has been posted in stackoverflow as well

[https://stackoverflow.com/questions/66796835/convert-a-kubectl-command-to-ansible-equivalent-command](https://stackoverflow.com/questions/66796835/convert-a-kubectl-command-to-ansible-equivalent-command)

Thank you in advance

George
