This time I spent a bit on the workaround automation.
haunit=hacluster-gnocchi/2
# Extract the principal unit on which the hacluster is deployed on
unit=$(juju run -u $haunit 'relation-list -r $(relation-ids ha | cut -d: -f2)')
# Dump current relation data in case something
juju run -u $haunit 'relation-get -r $(relation-ids ha) json_resource_params '$unit
# Rewrite the resource_params field with bringing timeout to front
juju run -u $haunit 'rel_id=$(relation-ids ha); relation-get -r $rel_id json_resource_params '$unit' | sed "s/depth=..0.. timeout=..20s.. interval=..10s../timeout=\\\"20s\\\" interval=\\\"10s\\\" depth=\\\"0\\\"/g" > /tmp/json_resource_params_fix'
juju run -u $unit 'rel_id=$(relation-ids ha); relation-set -r $rel_id json_resource_params="$(cat /tmp/json_resource_params_fix)"'
# Re-dump relation data to confirm it got rewritten as desired
juju run -u $haunit 'relation-get -r $(relation-ids ha) json_resource_params '$unit
# Resolve and retry if unit is in error state
juju resolved $haunit
The commands above are not working. Couldn't figure out how to in place update the backslashes.
Ended up dumping the relation data to /tmp/json_resource_params_fix and edited manually.
Then loaded back with the relation-set command above.
This time I spent a bit on the workaround automation.
haunit= hacluster- gnocchi/ 2
# Extract the principal unit on which the hacluster is deployed on params '$unit $(relation- ids ha); relation-get -r $rel_id json_resource_ params '$unit' | sed "s/depth=..0.. timeout=..20s.. interval= ..10s.. /timeout= \\\"20s\ \\" interval= \\\"10s\ \\" depth=\\\"0\\\"/g" > /tmp/json_ resource_ params_ fix' $(relation- ids ha); relation-set -r $rel_id json_resource_ params= "$(cat /tmp/json_ resource_ params_ fix)"' params '$unit
unit=$(juju run -u $haunit 'relation-list -r $(relation-ids ha | cut -d: -f2)')
# Dump current relation data in case something
juju run -u $haunit 'relation-get -r $(relation-ids ha) json_resource_
# Rewrite the resource_params field with bringing timeout to front
juju run -u $haunit 'rel_id=
juju run -u $unit 'rel_id=
# Re-dump relation data to confirm it got rewritten as desired
juju run -u $haunit 'relation-get -r $(relation-ids ha) json_resource_
# Resolve and retry if unit is in error state
juju resolved $haunit
The commands above are not working. Couldn't figure out how to in place update the backslashes. resource_ params_ fix and edited manually.
Ended up dumping the relation data to /tmp/json_
Then loaded back with the relation-set command above.