Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Commit

Permalink
Allow the addition of a "bastion" network to the admin node
Browse files Browse the repository at this point in the history
If the network proposal contains a configuration of a bastion network as
e.g. documented in
https://github.com/crowbar/crowbar/wiki/Editing-the-network-json
automatically allocate an IP for the admin node in that network during
installation. This is helpful if you need to run the installation via ssh but
cannot use the admin network for that.
  • Loading branch information
rhafer committed Jul 2, 2013
1 parent ce01020 commit 9d01c83
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion crowbar_framework/app/models/deployer_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ def transition(inst, name, state)

@logger.debug("Deployer transition: Done Allocate admin address for #{name} boot file:#{boot_ip_hex}")

# If we are the admin node, we may need to add a vlan bmc address.
if node.admin?
# If we are the admin node, we may need to add a vlan bmc address.
# Add the vlan bmc if the bmc network and the admin network are not the same.
# not great to do it this way, but hey.
admin_net = ProposalObject.find_data_bag_item "crowbar/admin_network"
Expand All @@ -124,6 +124,18 @@ def transition(inst, name, state)
@logger.error("Failed to allocate bmc_vlan address for: #{node.name}: #{result[0]}") if result[0] != 200
@logger.debug("Deployer transition: Done Allocate bmc_vlan address for #{name}")
end

# Allocate the bastion network ip for the admin node if a bastion
# network is defined in the network proposal
bastion_net = ProposalObject.find_data_bag_item "crowbar/bastion_network"
unless bastion_net.nil?
result = ns.allocate_ip("default", "bastion", range, name)
if result[0] != 200
@logger.error("Failed to allocate bastion address for: #{node.name}: #{result[0]}")
else
@logger.debug("Allocated bastion address: #{result[1]["address"]} for the admin node.")
end
end
end

# Let it fly to the provisioner. Reload to get the address.
Expand Down

0 comments on commit 9d01c83

Please sign in to comment.