Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,29 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
case node['platform_family']
when "debian"

include_recipe 'resolvconf::install'
include_recipe 'resolvconf::install'


# TODO: This fix needs to be removed once Ubuntu 10.04 support runs out (Q1 2015)
if value_for_platform('ubuntu' => { '10.04' => true }, 'default' => false)
# Fix buggy behaviour of resolvconf in Ubuntu 10.04 (Debian bug #642222)
line = %q(\[ -f "$BASEFILE" \] \&\& RSLVCNFFILES="$BASEFILE)
sfix = %q(\[ -f "$BASEFILE" \] \&\& RSLVCNFFILES="$RSLVCNFFILES\n$BASEFILE")
bash 'fix_resolvconf_libc' do
code <<-EOH
cat /etc/resolvconf/update.d/libc | sed '/#{line}/{N;s/.*/#{sfix}/}' > /tmp/resolvconf_libc_642222.fix
cat /tmp/resolvconf_libc_642222.fix > /etc/resolvconf/update.d/libc
rm /tmp/resolvconf_libc_642222.fix
EOH
only_if "grep -q '#{line}' /etc/resolvconf/update.d/libc"
end
end

resolvconf 'default'
end

resolvconf 'default'