# Rollback in existing deployment fails

**URL:** <https://forum.ansible.com/t/rollback-in-existing-deployment-fails/34849>\
**Category:** Ansible Developer\
**Tags:** kubernetes\
**Created:** [March 25, 2021, 9:00am UTC](https://forum.ansible.com/t/rollback-in-existing-deployment-fails/34849 "2021-03-25T09:00:49Z")\
**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:00am UTC](https://forum.ansible.com/t/rollback-in-existing-deployment-fails/34849/1 "2021-03-25T09:00:49Z")

</div>

Hello all  
I am using ansible and helm operators in order to rollback a current deployment  
The content of the path is simiral to the following

{  
“spec”: {  
“template”: {  
“spec”: {  
“containers”: [  
{  
“name”: “patch-demo-ctr-2”,  
“image”: “redis”  
}  
]  
}  
}  
}  
}

I have created in ansible the following command

- name: Demo  
k8s:  
api\_version: apps/v1  
kind: Deployment  
state: present  
namespace: ‘{{ meta.namespace }}’  
name: my-operator  
definition: |  
spec:  
template:  
spec:  
containers:  
my-operator:  
image: {{ installed\_software\_image }}  
register: output

when the command is running the rollback fails

NewReplicaSetAvailable\\\“,\\\“message\\\”:\\\“ReplicaSet \\\\\\\“my-operator-66ff64c9f4\\\\\\\” has successfully progressed.\\\”}]}}\”: v1.Deployment.Spec: v1.DeploymentSpec.Template: v1.PodTemplateSpec.Spec: v1.PodSpec.Containers: v1.Container: decode slice: expect [or n, but found {, error found in #10 byte of …|tainers\":{\“new-opera|…, bigger context …|t\”:\“2021-03-24T22:26:02Z\”}},\“spec\”:{\“containers\”:{\“my-operator\”:\“image:\\\“27.0.0.1:5050/my-ope|…”,“field”:“patch”}]},“code”:422}\n’”, “reason”: “Unprocessable Entity”, “status”: 422}

I put my question in stackoverflow  
[https://stackoverflow.com/questions/66790966/kubernetes-ansible-operators-patch-an-existing-deployment-fails](https://stackoverflow.com/questions/66790966/kubernetes-ansible-operators-patch-an-existing-deployment-fails)

Is any one who can help to verify what goes wrong or to provide me a way to  
debug the command that I send

Thank you  
George
