nginx icon indicating copy to clipboard operation
nginx copied to clipboard

Extract useful methods to outside of action_class

Open Lasering opened this issue 2 years ago • 1 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.

Lasering avatar May 05 '23 09:05 Lasering

@Lasering we'll always take PRs for this. Sorry it's taken so long to respond.

damacus avatar Jan 07 '25 21:01 damacus