bootstrap-vz/providers/ec2/tasks/network.py

16 lines
491 B
Python
Raw Normal View History

2013-09-22 15:41:43 +02:00
from base import Task
from common import phases
import os.path
class EnableDHCPCDDNS(Task):
description = 'Configuring the DHCP client to set the nameservers'
phase = phases.system_modification
def run(self, info):
# The dhcp client that ships with debian sets the DNS servers per default.
# For dhcpcd we need to configure it to do that.
from common.tools import sed_i
dhcpcd = os.path.join(info.root, 'etc/default/dhcpcd')
sed_i(dhcpcd, '^#*SET_DNS=.*', 'SET_DNS=\'yes\'')