mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00
Factor DHCPCD installation out into separate task
This commit is contained in:
parent
a5e2a34ecc
commit
9a58277619
3 changed files with 21 additions and 16 deletions
|
@ -65,7 +65,6 @@ def resolve_tasks(taskset, manifest):
|
||||||
|
|
||||||
boot.BlackListModules,
|
boot.BlackListModules,
|
||||||
boot.DisableGetTTYs,
|
boot.DisableGetTTYs,
|
||||||
tasks.network.EnableDHCPCDDNS,
|
|
||||||
initd.AddExpandRoot,
|
initd.AddExpandRoot,
|
||||||
initd.RemoveHWClock,
|
initd.RemoveHWClock,
|
||||||
initd.InstallInitScripts,
|
initd.InstallInitScripts,
|
||||||
|
@ -73,6 +72,12 @@ def resolve_tasks(taskset, manifest):
|
||||||
tasks.ami.RegisterAMI,
|
tasks.ami.RegisterAMI,
|
||||||
])
|
])
|
||||||
|
|
||||||
|
from bootstrapvz.common.releases import wheezy
|
||||||
|
if manifest.release <= wheezy:
|
||||||
|
# The default DHCP client `isc-dhcp' doesn't work properly on wheezy and earlier
|
||||||
|
taskset.add(tasks.network.InstallDHCPCD)
|
||||||
|
taskset.add(tasks.network.EnableDHCPCDDNS)
|
||||||
|
|
||||||
if manifest.provider.get('install_init_scripts', True):
|
if manifest.provider.get('install_init_scripts', True):
|
||||||
taskset.add(tasks.initd.AddEC2InitScripts)
|
taskset.add(tasks.initd.AddEC2InitScripts)
|
||||||
|
|
||||||
|
|
|
@ -4,19 +4,27 @@ from bootstrapvz.common.tasks import kernel
|
||||||
import os.path
|
import os.path
|
||||||
|
|
||||||
|
|
||||||
|
class InstallDHCPCD(Task):
|
||||||
|
description = 'Replacing isc-dhcp with dhcpcd'
|
||||||
|
phase = phases.preparation
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def run(cls, info):
|
||||||
|
# isc-dhcp-client before jessie doesn't work properly with ec2
|
||||||
|
info.packages.add('dhcpcd')
|
||||||
|
info.exclude_packages.add('isc-dhcp-client')
|
||||||
|
info.exclude_packages.add('isc-dhcp-common')
|
||||||
|
|
||||||
|
|
||||||
class EnableDHCPCDDNS(Task):
|
class EnableDHCPCDDNS(Task):
|
||||||
description = 'Configuring the DHCP client to set the nameservers'
|
description = 'Configuring the DHCP client to set the nameservers'
|
||||||
phase = phases.system_modification
|
phase = phases.system_modification
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def run(cls, info):
|
def run(cls, info):
|
||||||
# The dhcp client that ships with debian sets the DNS servers per default.
|
from bootstrapvz.common.tools import sed_i
|
||||||
# For dhcpcd in Wheezy and earlier we need to configure it to do that.
|
dhcpcd = os.path.join(info.root, 'etc/default/dhcpcd')
|
||||||
from bootstrapvz.common.releases import wheezy
|
sed_i(dhcpcd, '^#*SET_DNS=.*', 'SET_DNS=\'yes\'')
|
||||||
if info.manifest.release <= wheezy:
|
|
||||||
from bootstrapvz.common.tools import sed_i
|
|
||||||
dhcpcd = os.path.join(info.root, 'etc/default/dhcpcd')
|
|
||||||
sed_i(dhcpcd, '^#*SET_DNS=.*', 'SET_DNS=\'yes\'')
|
|
||||||
|
|
||||||
|
|
||||||
class AddBuildEssentialPackage(Task):
|
class AddBuildEssentialPackage(Task):
|
||||||
|
|
|
@ -9,14 +9,6 @@ class DefaultPackages(Task):
|
||||||
@classmethod
|
@classmethod
|
||||||
def run(cls, info):
|
def run(cls, info):
|
||||||
info.packages.add('file') # Needed for the init scripts
|
info.packages.add('file') # Needed for the init scripts
|
||||||
|
|
||||||
# isc-dhcp-client before jessie doesn't work properly with ec2
|
|
||||||
from bootstrapvz.common.releases import jessie
|
|
||||||
if info.manifest.release < jessie:
|
|
||||||
info.packages.add('dhcpcd')
|
|
||||||
info.exclude_packages.add('isc-dhcp-client')
|
|
||||||
info.exclude_packages.add('isc-dhcp-common')
|
|
||||||
|
|
||||||
import os.path
|
import os.path
|
||||||
kernel_packages_path = os.path.join(os.path.dirname(__file__), 'packages-kernels.yml')
|
kernel_packages_path = os.path.join(os.path.dirname(__file__), 'packages-kernels.yml')
|
||||||
from bootstrapvz.common.tools import config_get
|
from bootstrapvz.common.tools import config_get
|
||||||
|
|
Loading…
Add table
Reference in a new issue