Skip to content

Commit

Permalink
First cut fix for issue #29 - config for eth1
Browse files Browse the repository at this point in the history
  • Loading branch information
crawley committed Jul 9, 2014
1 parent 2a765da commit 398d2f2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
16 changes: 13 additions & 3 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,19 @@
include_recipe 'setup::set_hostname'
end

# Workaround for issue #13 ... until I can get the offending recipe fixed.
if platform_family?('rhel', 'debian') then
include_recipe 'locale'
if platform_family?('rhel', 'fedora') then
# Various NeCTAR images don't drop a config file for eth1 into
# /etc/sysconfig/network-scripts/. If your virtual has an eth1 NIC, and
# you install certain versions of NetworkManager (e.g. as part of an X11
# installation), it gets really confused and routes traffic to the wrong
# interface ... which effectively kills networking.
template '/etc/sysconfig/network-script/ifcfg-eth1' do
source 'ifcfg-xxx.erb'
variables ({ :device => 'eth1',
:private => true
})
action :create_if_missing
end
end

if node['setup']['accounts'] &&
Expand Down
16 changes: 16 additions & 0 deletions templates/default/ifcfg-xxx.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Generated by Chef (setup::default)
IPV6INIT=no
BOOTPROTO=dhcp
DEVICE=<%= @device %>
TYPE=Ethernet
<% if @private then %>
DEFROUTE=no
PEERDNS=no
PEERROUTES=no
<% else %>
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
<% end %>
IPV4_FAILURE_FATAL=no
NAME="System <%= @device %>"

0 comments on commit 398d2f2

Please sign in to comment.