end
end
end
+
+ execute "wp-cli plugin activate #{new_resource.plugin}" do
+ command "/opt/wp-cli/wp --path=#{site_directory} plugin activate #{new_resource.plugin}"
+ user node[:wordpress][:user]
+ group node[:wordpress][:group]
+ only_if { ::File.exist?("#{site_directory}/wp-config.php") }
+ end
end
action :delete do
+ execute "wp-cli plugin deactivate #{new_resource.plugin}" do
+ command "/opt/wp-cli/wp --path=#{site_directory} plugin deactivate #{new_resource.plugin}"
+ user node[:wordpress][:user]
+ group node[:wordpress][:group]
+ only_if { ::File.exist?("#{site_directory}/wp-config.php") }
+ end
+
directory plugin_directory do
action :delete
recursive true
WP_FAIL2BAN
subscribes :run, "wordpress_plugin[wp-fail2ban]"
end
+
+ wordpress_plugin "wp-2fa" do
+ site new_resource.site
+ reload_apache false
+ end
+
+ wordpress_plugin "wp-last-login" do
+ site new_resource.site
+ reload_apache false
+ end
end
action :delete do
+ wordpress_plugin "wp-last-login" do
+ action :delete
+ site new_resource.site
+ reload_apache false
+ end
+
+ wordpress_plugin "wp-2fa" do
+ action :delete
+ site new_resource.site
+ reload_apache false
+ end
+
wordpress_plugin "wp-fail2ban" do
action :delete
site new_resource.site