Sha256: 5318e91aa321a51529b5d7b19097e562482448aa8afcb37b0d6ca41782607a6c
Contents?: true
Size: 1.46 KB
Versions: 1
Compression:
Stored size: 1.46 KB
Contents
FactoryBot.define do factory :setup_provisioner, :class => ForemanSetup::Provisioner do host do association :host, :with_puppet_orchestration, :domain => FactoryBot.create(:domain) end smart_proxy { association :smart_proxy, :url => "https://#{host.name}:8443" } # After step1, interface selection trait :step1 do provision_interface 'eth0' after(:create) do |prov, evaluator| fact = FactoryBot.create(:fact_name, :name => "ipaddress_#{prov.provision_interface}") FactoryBot.create(:fact_value, :fact_name => fact, :host => prov.host, :value => '192.168.1.20') fact = FactoryBot.create(:fact_name, :name => "network_#{prov.provision_interface}") FactoryBot.create(:fact_value, :fact_name => fact, :host => prov.host, :value => '192.168.1.0') fact = FactoryBot.create(:fact_name, :name => "netmask_#{prov.provision_interface}") FactoryBot.create(:fact_value, :fact_name => fact, :host => prov.host, :value => '255.255.255.0') fact = FactoryBot.create(:fact_name, :name => 'interfaces') FactoryBot.create(:fact_value, :fact_name => fact, :host => prov.host, :value => 'lo,eth0,eth1') end end # After step2_update, update with nested subnet data trait :step2 do step1 hostgroup domain association :subnet, :factory => :subnet_ipv4 after(:create) do |prov, evaluator| prov.subnet.domains << prov.domain end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
foreman_setup-6.0.0 | test/factories/provisioners.rb |