The conditions of the task block were incorrect, which is why the local configuration file was not updated. \
As a result, we encountered errors archiving WAL and backing up to a dedicated pgBackRest server because the new version of Postgres was indicated there while the old version was still in the local configuration.\
This fix ensures that the pg-path option will be updated on both the dedicated server and the local database servers.
Update the grep command and use the replace module.
Make the code more reliable by using the replace module instead of lineinfile, which will prevent adding new lines instead of changing the content. Also, change the conditions of the grep command to look for a more accurate match for the pgN-path option.
Update pg-path in local pgbackrest.conf
pg-path
option will be updated on both the dedicated server and the local database servers.Update the
grep
command and use thereplace
module.replace
module instead oflineinfile
, which will prevent adding new lines instead of changing the content. Also, change the conditions of thegrep
command to look for a more accurate match for thepgN-path
option.