Stop hardcoding host's config volume path
authorMartin André <m.andre@redhat.com>
Wed, 16 Aug 2017 10:41:41 +0000 (12:41 +0200)
committerEmilien Macchi <emilien@redhat.com>
Mon, 4 Sep 2017 15:57:44 +0000 (15:57 +0000)
Get the path from the CONFIG_VOLUME_PREFIX environment variable.

This is useful for debugging and generate configuration files to
a different directory.

Change-Id: Ib85e3898804312ebb6677a5fa189fbfc357ce27c
(cherry picked from commit 0c62b6cd8d696befb1c0c31bb6e206199ce1edac)

docker/docker-puppet.py

index 4659cf5..613adf1 100755 (executable)
@@ -257,7 +257,7 @@ def mp_puppet_config((config_volume, puppet_tags, manifest, config_image, volume
                 '--volume', '%s:/etc/config.pp:ro' % tmp_man.name,
                 '--volume', '/etc/puppet/:/tmp/puppet-etc/:ro',
                 '--volume', '/usr/share/openstack-puppet/modules/:/usr/share/openstack-puppet/modules/:ro',
-                '--volume', '/var/lib/config-data/:/var/lib/config-data/:rw',
+                '--volume', '%s:/var/lib/config-data/:rw' % os.environ.get('CONFIG_VOLUME_PREFIX', '/var/lib/config-data'),
                 '--volume', 'tripleo_logs:/var/log/tripleo/',
                 # Syslog socket for puppet logs
                 '--volume', '/dev/log:/dev/log',