sous-chefs/nginx

Extract useful methods to outside of action_class

Opened this issue · 0 comments

The nginx_site resource defines the method config_file inside action_class. This method would be very useful to be used like:

site = nginx_site 'service-discovery' do
  conf_dir ::File.join(config.nginx_dir, 'sites-available')
  cookbook 'dsi-consul-servers'
  template 'service-discovery.conf.erb'
  variables(
     ...
  )
  action :create
end

link site.config_file do    # HERE
  to "../sites-enabled/#{site.name}"
end

To allow this usage the method should be defined outside of action_class. I can make a PR if this is something that would be merged.