I have an Ansible playbook which is supposed to replace some characters using stream editor.
sed -i "s+foo+$(<replace_file)+g" some_file
or
sed -i "s/foo/$(<replace_file)/g" some_file
cat some_file
line one: foo
cat replace_file
bar
expected result
line one: bar
actual result
line one: $(<bar)
I have tried the command directly on Ubuntu distro and it works perfectly, but running the command through Ansible gives the error.