# \<built-in method replace of AnsibleUnsafeText object at 0x7fec9aea8c50\>

**URL:** <https://forum.ansible.com/t/built-in-method-replace-of-ansibleunsafetext-object-at-0x7fec9aea8c50/36620>\
**Category:** Ansible Project\
**Created:** [May 12, 2022, 3:33pm UTC](https://forum.ansible.com/t/built-in-method-replace-of-ansibleunsafetext-object-at-0x7fec9aea8c50/36620 "2022-05-12T15:33:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tony\_Wong](https://avatars.discourse-cdn.com/v4/letter/t/3ab097/32.png) [@Tony\_Wong](https://forum.ansible.com/u/Tony_Wong)\
**Post date:** [May 12, 2022, 3:33pm UTC](https://forum.ansible.com/t/built-in-method-replace-of-ansibleunsafetext-object-at-0x7fec9aea8c50/36620/1 "2022-05-12T15:33:58Z")

</div>

When I run this pb, The line keeps getting replaced with this

\<built-in method replace of AnsibleUnsafeText object at 0x7fec9aea8c50\>

vars.yml

line\_to\_replace: “‘search: ‘image: jenkins/jenkins:2.332.1’, replace: ‘#image: jenkins/jenkins:2.332.1’’”

main.yml

- name: comment line  
lineinfile:  
backup: no  
backrefs: yes  
state: present  
path: “{{ file\_path }}”  
regexp: “{{ exp }}”  
line: ‘\1{{ item.replace }}’  
with\_items:
- ‘{{ line\_to\_replace }}’

any idea?
