In ansible, I'd like to replace this:
pgsql:
useCluster: false
addr: 127.0.0.1:5432
password: ""
email:
to: [email protected]
port: 465
password: ""
replace to this:
pgsql:
useCluster: false
addr: 127.0.0.1:5432
password: "2024xxx"
email:
to: [email protected]
port: 465
password: ""
Because there are two identical variables that cannot be replaced,I use this method.But it cannot be achieved. How should everyone handle it?
replace:
path: "config.yaml"
regexp: '(redis:[^<]*)password: ""'
replace: '\1password: "2024xxx"'