I have a very simple sed line to help do instal of Glance for openstack.
sudo sed -i \
's|identity_uri = http://127.0.0.1:35357|identity_uri = http://$MY_PRIVATE_IP:35357|g' \
/etc/glance/glance-api.conf
The part with the $MY_PRIVATE_IP shows up in the config file just as that not the value of 10.0.0.35 which is set in the tty.
If I do an echo you see the correct value.
echo $MY_PRIVATE_IP
10.0.0.35
Not sure what I am missing in the sed statement to make sure the value is inserted in to the config.