diff --git a/config.yaml b/config.yaml index c5101012..0a1a2243 100644 --- a/config.yaml +++ b/config.yaml @@ -80,6 +80,12 @@ options: actions e.g. the RBD driver requires requires this to support COW cloning of images. This option will default to v1 for backwards compatibility older glance services. + use-syslog: + type: boolean + default: False + description: | + By default, all services will log into their corresponding log files. + Setting this to True will force all services to log to the syslog. # HA configuration settings vip: type: string diff --git a/hooks/cinder_contexts.py b/hooks/cinder_contexts.py index b5c89b04..055621e8 100644 --- a/hooks/cinder_contexts.py +++ b/hooks/cinder_contexts.py @@ -42,6 +42,7 @@ class CephContext(OSContextGenerator): 'rbd_pool': service, 'rbd_user': service, 'host': service, + 'use_syslog': config('use-syslog') } diff --git a/revision b/revision index 6a4573e8..405e2afe 100644 --- a/revision +++ b/revision @@ -1 +1 @@ -133 +134 diff --git a/templates/cinder.conf b/templates/cinder.conf index c62f1b34..22cfa890 100644 --- a/templates/cinder.conf +++ b/templates/cinder.conf @@ -10,6 +10,7 @@ iscsi_helper = tgtadm volume_name_template = volume-%s volume_group = cinder-volumes verbose = True +use_syslog = {{ use_syslog }} auth_strategy = keystone state_path = /var/lib/cinder lock_path = /var/lock/cinder diff --git a/unit_tests/test_cinder_contexts.py b/unit_tests/test_cinder_contexts.py index b5a6ca7d..524564c8 100644 --- a/unit_tests/test_cinder_contexts.py +++ b/unit_tests/test_cinder_contexts.py @@ -43,12 +43,14 @@ class TestCinderContext(CharmTestCase): self.relation_ids.return_value = ['ceph:0'] service = 'mycinder' self.service_name.return_value = service + self.config.return_value = False self.assertEquals( contexts.CephContext()(), {'volume_driver': 'cinder.volume.driver.RBDDriver', 'rbd_pool': service, 'rbd_user': service, - 'host': service}) + 'host': service, + 'use_syslog': False}) def test_haproxy_configuration(self): self.determine_haproxy_port.return_value = 8080