I want to change replace a particular line in an exiting file (after having 
pushed a template of it to the remote)

this is ant extract of the file content

> cat bin/.myenv
# Mysql Environment
...
MYBASE=/opt/db/mysql/mariadb
MYHOME=/opt/db/mysql/mariadb-10.0.23-linux-x86_64
MYDATA=/opt/db/data/mysql
MYBACK=/opt/db/backup/mysql/dumps
...
 
I want to replace the line
MYHOME=/opt/db/mysql/mariadb-10.0.23-linux-x86_64

with this new line
MYHOME=/opt/db/mysql/mariadb-10.5.4-linux-x86_64

my TASK looks like this

 - name: replace mariadb version in " {{ mariadb_base }}"/bin/.myenv
lineinfile:
path: " {{ mariadb_base }}/bin/.myenv "
regexp: 'MYHOME=/opt/db/mysql/*'
line: MYHOME=/opt/db/mysql/mariadb-10.5.4-linux-x86_64
where {{ mariadb_base }} equals /opt/db/mysql

the error I am getting is:

TASK [mariadb_install : replace mariadb version in " /opt/db/mysql"/bin/.myenv] 
*******************************************************************
fatal: [vm-51150-0198]: FAILED! => changed=false
msg: Destination /opt/db/mysql/bin/.myenv does not exist !
rc: 257

however checking on the target I can see that the file /opt/db/mysql/bin/.myenv 
actually does exist

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/32365982.212197.1642256863668%40office.mailbox.org.

Reply via email to