A workaround for this is to reset the persistently-saved config on the unit to what it was previously and re-run the config-changed hook. For example, if the original source value was 'distro' and the new source value is 'cloud:bionic-rocky', then the following sequence should work:
juju run --unit ceph-osd/<unit#> -- sed -i 's/cloud-bionic-rocky/distro/g' .juju-persistent-config
juju run --unit ceph-osd/<unit#> -- hooks/config-changed
A workaround for this is to reset the persistently-saved config on the unit to what it was previously and re-run the config-changed hook. For example, if the original source value was 'distro' and the new source value is 'cloud: bionic- rocky', then the following sequence should work:
juju run --unit ceph-osd/<unit#> -- sed -i 's/cloud- bionic- rocky/distro/ g' .juju-persisten t-config changed
juju run --unit ceph-osd/<unit#> -- hooks/config-