@red hat ihar hrachyshka configuration files in rdo · configuration files in rdo do's,...
TRANSCRIPT
![Page 1: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/1.jpg)
Configuration files in RDOdo's, dont's, myths, gotchas, and rfc
Ihar Hrachyshka@Red Hat
![Page 2: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/2.jpg)
Basics: INI files
● Known since 80s, but no formal standard● Lots of libraries and tools to use● Everyone is special
![Page 3: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/3.jpg)
Basics: INI files: /etc/my.cnf
[mysqld]datadir=/var/lib/mysqlsocket=/var/lib/mysql/mysql.sock
[mysqld_safe]log-error=/var/log/mariadb/mariadb.logpid-file=/var/run/mariadb/mariadb.pid
!includedir /etc/my.cnf.d
![Page 4: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/4.jpg)
oslo.config: intro
● reads INI files (*.ini, *.conf, *.<anything>)● used by all OpenStack services● provides global ConfigOpts object
![Page 5: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/5.jpg)
oslo.config: intro: neutron/agent/dhcp_agent.py
from oslo_config import cfg
def main(): register_options(cfg.CONF) common_config.init(sys.argv[1:]) config.setup_logging() server = neutron_service.Service.create(...) service.launch(cfg.CONF, server).wait()
![Page 6: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/6.jpg)
oslo.config: intro: neutron/agent/dhcp_agent.py
from oslo_config import cfg
def main(): register_options(cfg.CONF) common_config.init(sys.argv[1:]) config.setup_logging() server = neutron_service.Service.create(...) service.launch(cfg.CONF, server).wait()
![Page 7: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/7.jpg)
oslo.config: intro: neutron/agent/dhcp_agent.py
from oslo_config import cfg
def main(): register_options(cfg.CONF) common_config.init(sys.argv[1:]) config.setup_logging() server = neutron_service.Service.create(...) service.launch(cfg.CONF, server).wait()
![Page 8: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/8.jpg)
oslo.config: intro: neutron/agent/dhcp_agent.py
from oslo_config import cfg
def main(): register_options(cfg.CONF) common_config.init(sys.argv[1:]) config.setup_logging() server = neutron_service.Service.create(...) service.launch(cfg.CONF, server).wait()
![Page 9: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/9.jpg)
oslo.config: intro: neutron/common/config.py
def init(args, **kwargs): cfg.CONF(args=args, project='neutron', version=<...>, **kwargs) n_rpc.init(cfg.CONF)
![Page 10: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/10.jpg)
oslo.config: intro: neutron/common/config.py
def init(args, **kwargs): cfg.CONF(args=args, project='neutron', version=<...>, **kwargs) n_rpc.init(cfg.CONF)
![Page 11: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/11.jpg)
oslo.config: intro: neutron/common/config.py
def init(args, **kwargs): cfg.CONF(args=args, project='neutron', version=<...>, **kwargs) n_rpc.init(cfg.CONF)
![Page 12: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/12.jpg)
oslo.config: intro: neutron/common/config.py
def init(args, **kwargs): cfg.CONF(args=args, project='neutron', version=<...>, **kwargs) n_rpc.init(cfg.CONF)
![Page 13: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/13.jpg)
oslo.config: sys.argv
● --config-file and --config-dir● multiple options allowed● order is guaranteed: last beats first
![Page 14: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/14.jpg)
oslo.config: sys.argv
$service \
--config-dir /usr/share/$service \
--config-dir /etc/$service \
--config-file /opt/etc/$service.conf \
--config-dir /opt/etc/$service
![Page 15: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/15.jpg)
oslo.config: autodiscoveryclass ConfigOpts(collections.Mapping):
def _pre_setup(self, project, prog, version, usage, default_config_files): <...> if default_config_files is None: default_config_files = find_config_files(project, prog) <...>
![Page 16: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/16.jpg)
oslo.config: autodiscoverydef find_config_files(project=None, prog=None, extension='.conf'): <...> cfg_dirs = _get_config_dirs(project) <...> config_files.append(_search_dirs(cfg_dirs, prog, extension))
![Page 17: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/17.jpg)
oslo.config: autodiscoverydef _get_config_dirs(project=None):
cfg_dirs = [ _fixpath(os.path.join('~', '.' + project)) if project else None, _fixpath('~'), os.path.join('/etc', project) if project else None, '/etc' ] return list(moves.filter(bool, cfg_dirs))
![Page 18: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/18.jpg)
oslo.config: autodiscovery: RHEL-OSPSubject: [PATCH] add /usr/share/$project/*-dist.conf to the default config set--- a/oslo_config/cfg.py+++ b/oslo_config/cfg.py config_files = [] if project:+ config_files.append(_search_dirs(['/usr/share/%s/' % project],+ project, '-dist%s' % extension))+ config_files.append(_search_dirs(['/usr/share/%s/' % project],+ prog, '-dist%s' % extension)) config_files.append(_search_dirs(cfg_dirs, project, extension)) config_files.append(_search_dirs(cfg_dirs, prog, extension))
![Page 19: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/19.jpg)
oslo.config: autodiscovery: $service-dist.conf
● distribution specific defaults● RDO specific● diverge from upstream defaults
![Page 20: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/20.jpg)
oslo.config: autodiscovery: neutron-dist.conf[DEFAULT]verbose = Truelock_path = $state_path/locknotification_driver = neutron.openstack.common.notifier.rpc_notifierallow_overlapping_ips = Trueuse_stderr = Falseapi_paste_config = /usr/share/neutron/api-paste.ini
[agent]root_helper = sudo neutron-rootwrap /etc/neutron/rootwrap.confroot_helper_daemon = sudo neutron-rootwrap-daemon /etc/neutron/rootwrap.conf
![Page 21: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/21.jpg)
...speaking of defaults● upstream defaults● distribution (package) defaults● ‘your deployment tool of choice’ defaults
![Page 22: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/22.jpg)
oslo.config: not just a .ini parsing library
● rich type library● deprecation management● config files generator
![Page 23: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/23.jpg)
oslo.config: types
● BoolOpt, StrOpt● MultiStrOpt● PortOpt, IPOpt● <your-type-of-interest>
![Page 24: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/24.jpg)
oslo.config: types: MultiStrOpt
[service_providers]
service_provider=LOADBALANCER:Haproxy:...
service_provider=VPN:Libreswan:...
![Page 25: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/25.jpg)
oslo.config: deprecation management cfg.StrOpt(‘user-name’, help='...', deprecated_name=’username’, deprecated_group='keystone_authtoken'),
2016-01-20 18:10:21.688 WARNING oslo_config.cfg [req-116e5f9e-1994-4f98-b914-86853a874730 None None] Option "username" from group "keystone_authtoken" is deprecated. Use option "user-name" from group "keystone_authtoken".
![Page 26: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/26.jpg)
oslo.config: config files generator
● historically, files were stored under git● generator allows for single source of truth● nova, neutron, glance, … switched
![Page 27: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/27.jpg)
oslo.config: config files generator (per file)[DEFAULT]output_file = etc/dhcp_agent.ini.samplewrap_width = 79
namespace = neutron.base.agentnamespace = neutron.dhcp.agentnamespace = oslo.log
![Page 28: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/28.jpg)
oslo.config: config files generator (setup.cfg)oslo.config.opts = neutron = neutron.opts:list_opts neutron.agent = neutron.opts:list_agent_opts neutron.base.agent = neutron.opts:list_base_agent_opts neutron.db = neutron.opts:list_db_opts neutron.dhcp.agent = neutron.opts:list_dhcp_agent_opts...
![Page 29: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/29.jpg)
oslo.config: config files generator (contents)def list_dhcp_agent_opts(): return [ ('DEFAULT', itertools.chain( neutron.agent.dhcp.config.DHCP_AGENT_OPTS, neutron.agent.dhcp.config.DHCP_OPTS, neutron.agent.dhcp.config.DNSMASQ_OPTS) ) ]
![Page 30: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/30.jpg)
oslo.config: future● configuration databases● autodoc for configuration options● config option reloading (in cooperation with
oslo.service)
![Page 31: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/31.jpg)
myths“packaged config files are somehow special”
![Page 32: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/32.jpg)
myths“packaged config files are somehow special”
“config files should have $service names”
![Page 33: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/33.jpg)
myths“packaged config files are somehow special”
“config files should have $service names”
“a single config file is always enough”
![Page 34: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/34.jpg)
multiple config files: use caseExecStart=/usr/bin/neutron-server \ --config-file /usr/share/neutron/neutron-dist.conf \ --config-dir /usr/share/neutron/server \ --config-file /etc/neutron/neutron.conf \ --config-file /etc/neutron/plugin.ini \ --config-dir /etc/neutron/conf.d/common \ --config-dir /etc/neutron/conf.d/neutron-server \ --log-file /var/log/neutron/server.log
![Page 35: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/35.jpg)
multiple config files: use caseExecStart=/usr/bin/neutron-server \ --config-file /usr/share/neutron/neutron-dist.conf \ --config-dir /usr/share/neutron/server \ --config-file /etc/neutron/neutron.conf \ --config-file /etc/neutron/plugin.ini \ --config-dir /etc/neutron/conf.d/common \ --config-dir /etc/neutron/conf.d/neutron-server \ --log-file /var/log/neutron/server.log
![Page 36: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/36.jpg)
multiple config files: use caseExecStart=/usr/bin/neutron-server \ --config-file /usr/share/neutron/neutron-dist.conf \ --config-dir /usr/share/neutron/server \ --config-file /etc/neutron/neutron.conf \ --config-file /etc/neutron/plugin.ini \ --config-dir /etc/neutron/conf.d/common \ --config-dir /etc/neutron/conf.d/neutron-server \ --log-file /var/log/neutron/server.log
![Page 37: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/37.jpg)
multiple config files: use caseExecStart=/usr/bin/neutron-server \ --config-file /usr/share/neutron/neutron-dist.conf \ --config-dir /usr/share/neutron/server \ --config-file /etc/neutron/neutron.conf \ --config-file /etc/neutron/plugin.ini \ --config-dir /etc/neutron/conf.d/common \ --config-dir /etc/neutron/conf.d/neutron-server \ --log-file /var/log/neutron/server.log
![Page 38: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/38.jpg)
multiple config files: use caseExecStart=/usr/bin/neutron-server \ --config-file /usr/share/neutron/neutron-dist.conf \ --config-dir /usr/share/neutron/server \ --config-file /etc/neutron/neutron.conf \ --config-file /etc/neutron/plugin.ini \ --config-dir /etc/neutron/conf.d/common \ --config-dir /etc/neutron/conf.d/neutron-server \ --log-file /var/log/neutron/server.log
![Page 39: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/39.jpg)
multiple config files: use caseExecStart=/usr/bin/neutron-server \ --config-file /usr/share/neutron/neutron-dist.conf \ --config-dir /usr/share/neutron/server \ --config-file /etc/neutron/neutron.conf \ --config-file /etc/neutron/plugin.ini \ --config-dir /etc/neutron/conf.d/common \ --config-dir /etc/neutron/conf.d/neutron-server \ --log-file /var/log/neutron/server.log
![Page 40: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/40.jpg)
gotchas: don’t reimplement oslo.config, ever● Neutron did it before for service_providers● loaded the option from ‘special’ files● Magic!
![Page 41: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/41.jpg)
gotchas: don’t reimplement oslo.config, everWhy not?● hard for developers● adds complexity to operations● there is simply no good reason
![Page 42: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/42.jpg)
gotchas: testing: autodiscoveryclass BaseTestCase(DietTestCase): @staticmethod def config_parse(conf=None, args=None): if args is None: args = [] args += ['--config-file', etcdir('neutron.conf')] if conf is None: config.init(args=args) else: conf(args)
![Page 43: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/43.jpg)
gotchas: testing: autodiscoveryROOTDIR = os.path.dirname(__file__)ETCDIR = os.path.join(ROOTDIR, 'etc')
def etcdir(*p): return os.path.join(ETCDIR, *p)^ returns file path from neutron/tests/etc
![Page 44: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/44.jpg)
gotchas: testing: autodiscovery[testenv:pep8]basepython = python2.7deps = {[testenv]deps}commands=... neutron-db-manage --config-file neutron/tests/etc/neutron.conf check_migration
![Page 45: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/45.jpg)
gotchas: testing: autodiscoveryneutron/tests/base.py: self.useFixture(fixtures.MonkeyPatch( 'oslo_config.cfg.find_config_files', lambda project=None, prog=None, extension=None: []))
![Page 46: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/46.jpg)
gotchas: testing: autodiscovery
oslo_config.fixture.Config.set_config_files
![Page 47: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/47.jpg)
conf.d: rationaleIn Neutron:
● plugin.ini● *aas repo split, 3rd parties● we don't have a predefined list of files to load
![Page 48: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/48.jpg)
conf.d: solution
● per-service and common conf.d dirs● document and maintain the order
![Page 49: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/49.jpg)
conf.d: solutionExecStart=/usr/bin/neutron-server \ --config-file /usr/share/neutron/neutron-dist.conf \ --config-dir /usr/share/neutron/server \ --config-file /etc/neutron/neutron.conf \ --config-file /etc/neutron/plugin.ini \ --config-dir /etc/neutron/conf.d/common \ --config-dir /etc/neutron/conf.d/neutron-server \ --log-file /var/log/neutron/server.log
![Page 50: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/50.jpg)
conf.d: solution# conffile=/etc/neutron/conf.d/neutron-server/debug.conf# echo “[DEFAULT]\ndebug=True” >> $conffile# systemctl restart neutron-server
...now collect logs and…
# rm $conffile# systemctl restart neutron-server
![Page 51: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/51.jpg)
conf.d: benefits
● Undefined list of config files to load● Not managed as .rpmsave/.rpmnew● Easier to grasp local specific settings
![Page 52: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/52.jpg)
conf.d: drawbacks
● It’s only RDO● It’s only Neutron and Octavia
![Page 53: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/53.jpg)
conf.d: adoption
● <your project>● ansible books, puppet modules?● RHEL-OSP: 3rd party integration
![Page 54: @Red Hat Ihar Hrachyshka Configuration files in RDO · Configuration files in RDO do's, dont's, myths, gotchas, and rfc Ihar Hrachyshka @Red Hat](https://reader030.vdocuments.us/reader030/viewer/2022041019/5ecd6f2f2ad4b900b93a31cb/html5/thumbnails/54.jpg)
Questions?