From dd1b69268a19072d410b7f389b13bbcdce4aaf79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81lvarez?= <128592227+malvads@users.noreply.github.com> Date: Mon, 10 Jun 2024 14:44:37 +0100 Subject: [PATCH] Update config.rb --- resources/providers/config.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/resources/providers/config.rb b/resources/providers/config.rb index 67da22d..c7904c2 100644 --- a/resources/providers/config.rb +++ b/resources/providers/config.rb @@ -89,6 +89,31 @@ end end +action :add_s3 do # Only for configure solo + begin + s3_port = new_resource.s3_port + + template '/etc/nginx/conf.d/s3.conf' do + source 's3.conf.erb' + owner user + group user + mode '0644' + cookbook 'nginx' + variables(s3_port: s3_port) + notifies :restart, 'service[nginx]' + end + + service 'nginx' do + service_name 'nginx' + ignore_failure true + supports status: true, reload: true, restart: true, enable: true + action [:nothing] + end + rescue => e + Chef::Log.error(e.message) + end +end + action :add_erchef do begin erchef_port = new_resource.erchef_port