Files
ubicloud/prog/setup_nftables.rb
Jeremy Evans e6b7e5e879 Change rubocop TargetRubyVersion to 3.4
Disable Style/RedundantLineContinuation, as it incorrectly removes
line continutations in rhizome/host/lib/vm_setup.rb that are not
redundant.

All code changes are for _1 => it in blocks.
2025-04-26 06:51:19 +09:00

13 lines
407 B
Ruby

# frozen_string_literal: true
class Prog::SetupNftables < Prog::Base
subject_is :sshable, :vm_host
label def start
additional_subnets = vm_host.assigned_subnets.select { |a| a.cidr.version == 4 && a.cidr.network.to_s != vm_host.sshable.host }
sshable.cmd("sudo host/bin/setup-nftables.rb #{additional_subnets.map { it.cidr.to_s }.to_json.shellescape}")
pop "nftables was setup"
end
end