mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-10-07 17:40:30 +00:00
Merge pull request #344 from vorlock/master
Finishing touches for Stretch
This commit is contained in:
commit
4fbfd795a9
4 changed files with 19 additions and 7 deletions
|
@ -12,6 +12,7 @@ class InstallInitScripts(Task):
|
|||
@classmethod
|
||||
def run(cls, info):
|
||||
import stat
|
||||
from bootstrapvz.common.releases import jessie
|
||||
rwxr_xr_x = (stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR |
|
||||
stat.S_IRGRP | stat.S_IXGRP |
|
||||
stat.S_IROTH | stat.S_IXOTH)
|
||||
|
@ -20,10 +21,16 @@ class InstallInitScripts(Task):
|
|||
dst = os.path.join(info.root, 'etc/init.d', name)
|
||||
copy(src, dst)
|
||||
os.chmod(dst, rwxr_xr_x)
|
||||
log_check_call(['chroot', info.root, 'insserv', '--default', name])
|
||||
if info.manifest.release > jessie:
|
||||
log_check_call(['chroot', info.root, 'systemctl', 'enable', name])
|
||||
else:
|
||||
log_check_call(['chroot', info.root, 'insserv', '--default', name])
|
||||
|
||||
for name in info.initd['disable']:
|
||||
log_check_call(['chroot', info.root, 'insserv', '--remove', name])
|
||||
if info.manifest.release > jessie:
|
||||
log_check_call(['chroot', info.root, 'systemctl', 'mask', name])
|
||||
else:
|
||||
log_check_call(['chroot', info.root, 'insserv', '--remove', name])
|
||||
|
||||
|
||||
class AddExpandRoot(Task):
|
||||
|
|
|
@ -101,6 +101,7 @@ class ShredHostkeys(Task):
|
|||
def run(cls, info):
|
||||
ssh_hostkeys = ['ssh_host_dsa_key',
|
||||
'ssh_host_rsa_key']
|
||||
|
||||
from bootstrapvz.common.releases import wheezy
|
||||
if info.manifest.release >= wheezy:
|
||||
ssh_hostkeys.append('ssh_host_ecdsa_key')
|
||||
|
@ -109,4 +110,5 @@ class ShredHostkeys(Task):
|
|||
public = [path + '.pub' for path in private]
|
||||
|
||||
from ..tools import log_check_call
|
||||
log_check_call(['shred', '--remove'] + private + public)
|
||||
log_check_call(['shred', '--remove'] + [key for key in private + public
|
||||
if os.path.isfile(key)])
|
||||
|
|
|
@ -10,8 +10,10 @@ properties:
|
|||
type: string
|
||||
enum:
|
||||
- wheezy
|
||||
- stable
|
||||
- oldstable
|
||||
- jessie
|
||||
- stable
|
||||
- stretch
|
||||
- testing
|
||||
- sid
|
||||
- unstable
|
||||
|
@ -38,7 +40,7 @@ properties:
|
|||
type: array
|
||||
properties:
|
||||
module: {type: string}
|
||||
position: { type: number}
|
||||
position: {type: number}
|
||||
additionalProperties: false
|
||||
required: [username]
|
||||
additionalProperties: false
|
||||
|
|
|
@ -49,7 +49,7 @@ def validate_manifest(data, validator, error):
|
|||
|
||||
|
||||
def resolve_tasks(taskset, manifest):
|
||||
from bootstrapvz.common.releases import wheezy, jessie
|
||||
from bootstrapvz.common.releases import wheezy, jessie, stable
|
||||
|
||||
taskset.update(task_groups.get_standard_groups(manifest))
|
||||
taskset.update(task_groups.ssh_group)
|
||||
|
@ -80,12 +80,13 @@ def resolve_tasks(taskset, manifest):
|
|||
taskset.add(tasks.network.EnableDHCPCDDNS)
|
||||
|
||||
if manifest.release >= jessie:
|
||||
taskset.add(apt.AddBackports)
|
||||
taskset.add(tasks.tuning.SetCloudInitMountOptions)
|
||||
taskset.add(tasks.packages.AddWorkaroundGrowpart)
|
||||
taskset.add(initd.AdjustGrowpartWorkaround)
|
||||
if manifest.system['bootloader'] == 'grub':
|
||||
taskset.add(grub.EnableSystemd)
|
||||
if manifest.release <= stable:
|
||||
taskset.add(apt.AddBackports)
|
||||
|
||||
if manifest.provider.get('install_init_scripts', True):
|
||||
taskset.add(tasks.initd.AddEC2InitScripts)
|
||||
|
|
Loading…
Add table
Reference in a new issue