lib/cloudstrap/config.rb in cloudstrap-0.48.15.pre vs lib/cloudstrap/config.rb in cloudstrap-0.49.0.pre

- old
+ new

@@ -20,24 +20,34 @@ def cache_path lookup(:cache_path) { [workdir, '.cache'].join('/') } end Contract None => String + def network_bits + lookup(:network_bits) { '16' } + end + + Contract None => String + def subnet_bits + lookup(:subnet_bits) { '24' } + end + + Contract None => String def vpc_cidr_block - lookup(:vpc_cidr_block) { '10.0.0.0/16' } + lookup(:vpc_cidr_block) { "10.0.0.0/#{network_bits}" } end Contract None => String def public_cidr_block lookup(:public_cidr_block) do - vpc_cidr_block.gsub(/([[:digit:]]{1,3}\.?){2,2}\/[[:digit:]]{1,2}$/, '0.0/24') + vpc_cidr_block.gsub(/([[:digit:]]{1,3}\.?){2,2}\/[[:digit:]]{1,2}$/, "0.0/#{subnet_bits}") end end Contract None => String def private_cidr_block lookup(:private_cidr_block) do - vpc_cidr_block.gsub(/([[:digit:]]{1,3}\.?){2,2}\/[[:digit:]]{1,2}$/, '1.0/24') + vpc_cidr_block.gsub(/([[:digit:]]{1,3}\.?){2,2}\/[[:digit:]]{1,2}$/, "1.0/#{subnet_bits}") end end Contract None => String def ami_owner