[openstack-glance] update common and parameterized config centrally
Pádraig Brady
pbrady at fedoraproject.org
Thu Oct 3 19:48:43 UTC 2013
commit ba8853d71d030e4ab26e76a15617e74f790e21fc
Author: Pádraig Brady <P at draigBrady.com>
Date: Wed Oct 2 15:33:19 2013 +0100
update common and parameterized config centrally
i.e. from the spec file
glance-api-dist.conf | 11 +----------
glance-registry-dist.conf | 10 ----------
openstack-glance.spec | 17 +++++++++++++++++
3 files changed, 18 insertions(+), 20 deletions(-)
---
diff --git a/glance-api-dist.conf b/glance-api-dist.conf
index 5928ac6..93d4fc0 100644
--- a/glance-api-dist.conf
+++ b/glance-api-dist.conf
@@ -1,13 +1,4 @@
[DEFAULT]
+
debug = False
verbose = True
-
-sql_connection = mysql://glance:glance@localhost/glance
-
-[keystone_authtoken]
-admin_tenant_name = %%SERVICE_TENANT_NAME%%
-admin_user = %SERVICE_USER%
-admin_password = %SERVICE_PASSWORD%
-auth_host = 127.0.0.1
-auth_port = 35357
-auth_protocol = http
diff --git a/glance-registry-dist.conf b/glance-registry-dist.conf
index ad3fe20..93d4fc0 100644
--- a/glance-registry-dist.conf
+++ b/glance-registry-dist.conf
@@ -2,13 +2,3 @@
debug = False
verbose = True
-sql_connection = mysql://glance:glance@localhost/glance
-
-[keystone_authtoken]
-
-admin_tenant_name = %%SERVICE_TENANT_NAME%%
-admin_user = %SERVICE_USER%
-admin_password = %SERVICE_PASSWORD%
-auth_host = 127.0.0.1
-auth_port = 35357
-auth_protocol = http
diff --git a/openstack-glance.spec b/openstack-glance.spec
index 1b1d8a0..def187a 100644
--- a/openstack-glance.spec
+++ b/openstack-glance.spec
@@ -183,6 +183,23 @@ install -p -D -m 640 %{SOURCE7} %{buildroot}%{_datadir}/glance/glance-scrubber-d
install -p -D -m 640 etc/policy.json %{buildroot}%{_sysconfdir}/glance/policy.json
install -p -D -m 640 etc/schema-image.json %{buildroot}%{_sysconfdir}/glance/schema-image.json
+# Update common config and paramterized config
+openstack-config --set %{buildroot}%{_datadir}/glance/glance-api-dist.conf DEFAULT filesystem_store_datadir %{_localstatedir}/lib/glance/images/
+openstack-config --set %{buildroot}%{_datadir}/glance/glance-api-dist.conf DEFAULT scrubber_datadir %{_localstatedir}/lib/glance/scrubber
+openstack-config --set %{buildroot}%{_datadir}/glance/glance-api-dist.conf DEFAULT image_cache_dir %{_localstatedir}/lib/glance/image-cache/
+for svc in api registry; do
+ openstack-config --set %{buildroot}%{_datadir}/glance/glance-$svc-dist.conf DEFAULT sql_connection mysql://glance:glance@localhost/glance
+ openstack-config --set %{buildroot}%{_datadir}/glance/glance-$svc-dist.conf DEFAULT log_file %{_localstatedir}/log/glance/$svc.log
+ openstack-config --set %{buildroot}%{_datadir}/glance/glance-$svc-dist.conf keystone_authtoken admin_tenant_name %SERVICE_TENANT_NAME%
+ openstack-config --set %{buildroot}%{_datadir}/glance/glance-$svc-dist.conf keystone_authtoken admin_user %SERVICE_USER%
+ openstack-config --set %{buildroot}%{_datadir}/glance/glance-$svc-dist.conf keystone_authtoken admin_password %SERVICE_PASSWORD%
+ openstack-config --set %{buildroot}%{_datadir}/glance/glance-$svc-dist.conf keystone_authtoken auth_host 127.0.0.1
+ openstack-config --set %{buildroot}%{_datadir}/glance/glance-$svc-dist.conf keystone_authtoken auth_port 35357
+ openstack-config --set %{buildroot}%{_datadir}/glance/glance-$svc-dist.conf keystone_authtoken auth_protocol http
+done
+openstack-config --set %{buildroot}%{_datadir}/glance/glance-scrubber-dist.conf DEFAULT scrubber_datadir %{_localstatedir}/lib/glance/scrubber
+openstack-config --set %{buildroot}%{_datadir}/glance/glance-scrubber-dist.conf DEFAULT log_file %{_localstatedir}/log/glance/scrubber.log
+
# Initscripts
install -p -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/openstack-glance-api.service
install -p -D -m 644 %{SOURCE2} %{buildroot}%{_unitdir}/openstack-glance-registry.service
More information about the scm-commits
mailing list