Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rayo listening interface should be an attribute #11

Open
bklang opened this issue Feb 11, 2014 · 2 comments
Open

Rayo listening interface should be an attribute #11

bklang opened this issue Feb 11, 2014 · 2 comments

Comments

@bklang
Copy link
Contributor

bklang commented Feb 11, 2014

No description provided.

@benlangfeld
Copy link
Owner

So right now, the only FS config file this cookbook manages is vars.xml, and this is simply to set the IP/domain of the instance. Managing rayo.conf.xml sets a precedent that this cookbook will manage config for many FreeSWITCH modules, which I think I'd like to avoid, preferring instead to leave replacing config to downstream cookbooks.

What I think might be a sufficient compromise, is providing a simple way to do this config replacement. Right now, a standard template resource is required:

template "#{node['freeswitch']['confpath']}/autoload_configs/rayo.conf.xml" do
  owner node['freeswitch']['user']
  group node['freeswitch']['group']
  source 'rayo.conf.xml.erb'
  mode 0644
  notifies :restart, "service[#{node['freeswitch']['service']}]"
end

This leaves the user to figure out a bunch of things they really shouldn't need to. This cookbook could provide a resource like this instead:

freeswitch_config 'autoload_configs/rayo.conf.xml' do
  source 'rayo.conf.xml.erb'
end

Would that be satisfactory?

@bklang
Copy link
Contributor Author

bklang commented Feb 12, 2014

This seems reasonable to me.

The use of vars.xml makes sense to map to Chef attributes. I completely agree that we should not attempt to map every last config option, or anything close to that, to Chef attributes. Instead, consumers of this cookbook should provide their own templates. However, if there are one or two very common settings for rayo.conf.xml that prevent the need to provide an entire template, maybe we could add those to vars.xml? A Rayo username/password seems to fall into this category, but not the domain, which I think we sensibly default to the domain provided by vars.xml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants