Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated default.rb to run only on Debian #16

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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'