Skip to content

Commit

Permalink
Make source URL configurable (#668)
Browse files Browse the repository at this point in the history
* Add source_url attribute to be able to fetch source from local proxy repo
* Remove dead links 

---------
Signed-off-by: Bikramjit Singh <[email protected]>
Co-authored-by: Bikramjit Singh <[email protected]>
  • Loading branch information
bikramj authored May 1, 2024
1 parent d2454d9 commit 1867826
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ Example: `default['nagios']['conf']['cfg_dir'] = [ '/etc/nagios/conf.d' , '/usr/

- `node['nagios']['server']['version']` - version of the server source to download
- `node['nagios']['server']['checksum']` - checksum of the source files
- `node['nagios']['server']['source_url']` - nagios core source url
- `node['nagios']['server']['patch_url']` - url to download patches from if installing from source
- `node['nagios']['server']['patches']` - array of patch filenames to apply if installing from source
- `node['nagios']['url']` - URL to host Nagios from - defaults to nil and instead uses FQDN
Expand Down Expand Up @@ -157,7 +158,7 @@ Example: `default['nagios']['conf']['cfg_dir'] = [ '/etc/nagios/conf.d' , '/usr/
- `node['nagios']['server']['web_server']` - web server to use. supports Apache or Nginx, default "apache"
- `node['nagios']['server']['nginx_dispatch']` - nginx dispatch method. supports cgi or php, default "cgi"
- `node['nagios']['server']['stop_apache']` - stop apache service if using nginx, default false
- `node['nagios']['server']['redirect_root']` - if using Apache, should [http://server/](http://server/) redirect to [http://server/nagios3](http://server/nagios3) automatically, default false
- `node['nagios']['server']['redirect_root']` - if using Apache, should `http://server/` redirect to `http://server/nagios3` automatically, default false
- `node['nagios']['server']['normalize_hostname']` - If set to true, normalize all hostnames in hosts.cfg to lowercase. Defaults to false.

These are nagios cgi.config options.
Expand Down
1 change: 1 addition & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
# for server from source installation
default['nagios']['server']['version'] = '4.4.6'
default['nagios']['server']['checksum'] = 'ab0d5a52caf01e6f4dcd84252c4eb5df5a24f90bb7f951f03875eef54f5ab0f4'
default['nagios']['server']['source_url'] = "https://assets.nagios.com/downloads/nagioscore/releases/nagios-#{node['nagios']['server']['version']}.tar.gz"
default['nagios']['server']['patches'] = []
default['nagios']['server']['patch_url'] = nil
default['nagios']['server']['dependencies'] = nagios_server_dependencies
Expand Down
4 changes: 0 additions & 4 deletions libraries/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,6 @@ def nagios_install_method
end
end

def nagios_source_url
"https://assets.nagios.com/downloads/nagioscore/releases/nagios-#{node['nagios']['server']['version']}.tar.gz"
end

def nagios_pagerduty_packages
case node['platform_family']
when 'rhel'
Expand Down
2 changes: 1 addition & 1 deletion recipes/server_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

remote_file 'nagios source file' do
path ::File.join(Chef::Config[:file_cache_path], "nagios-#{nagios_version}.tar.gz")
source nagios_source_url
source node['nagios']['server']['source_url']
checksum node['nagios']['server']['checksum']
notifies :run, 'execute[compile-nagios]', :immediately
end
Expand Down

0 comments on commit 1867826

Please sign in to comment.