Merge pull request #110 from JamesBromberger/python

Fixes to get Debian official images running.
This commit is contained in:
Anders Ingemann 2013-11-10 00:01:01 -08:00
commit ad79cf8a09
5 changed files with 65 additions and 40 deletions

View file

@ -0,0 +1,50 @@
{
"provider": "ec2",
"virtualization": "pvm",
"credentials": {
// "access-key": null,
// "secret-key": null
},
"bootstrapper": {
"workspace": "/target"
},
"image": {
"name": "debian-{release}-{architecture}-{virtualization}-{%y}{%m}{%d}",
"description": "Debian {release} {architecture} AMI ({virtualization})"
},
"system": {
"release": "wheezy",
"architecture": "i386",
"timezone": "UTC",
"locale": "en_US",
"charmap": "UTF-8"
},
"volume": {
"backing": "ebs",
"partitions": {
"type": "none",
"root": {
"size": 8192,
"filesystem": "ext4"
}
}
},
"plugins": {
"backports": {
"enabled": true,
"packages": [ "cloud-init" ]
},
"user_packages": {
"enabled": true,
"repo": [ "sudo" ],
"local": []
},
"sed": {
"enabled": true,
"file": "etc/cloud/cloud.cfg",
"find": "^ name: debian$",
"replace": " name: admin\n sudo: ALL=(ALL) NOPASSWD:ALL\n shell: /bin/bash"
}
}
}

View file

@ -25,15 +25,26 @@
"partitions": { "partitions": {
"type": "none", "type": "none",
"root": { "root": {
"size": 1024, "size": 8192,
"filesystem": "ext4" "filesystem": "ext4"
} }
} }
}, },
"plugins": { "plugins": {
"admin_user": { "backports": {
"enabled": true, "enabled": true,
"username": "admin" "packages": [ "cloud-init" ]
},
"user_packages": {
"enabled": true,
"repo": [ "sudo" ],
"local": []
},
"sed": {
"enabled": true,
"file": "etc/cloud/cloud.cfg",
"find": "^ name: debian$",
"replace": " name: admin\n sudo: ALL=(ALL) NOPASSWD:ALL\n shell: /bin/bash"
} }
} }
} }

View file

@ -2,8 +2,7 @@
def tasks(tasklist, manifest): def tasks(tasklist, manifest):
import tasks import tasks
tasklist.add(tasks.DoSeds()) tasklist.add(tasks.DoSeds)
def validate_manifest(data, schema_validate): def validate_manifest(data, schema_validate):
from os import path from os import path

View file

@ -12,8 +12,4 @@ class DoSeds(Task):
def run(self, info): def run(self, info):
chroot_path = os.path.join(info.root, info.manifest.plugins['sed']['file']) chroot_path = os.path.join(info.root, info.manifest.plugins['sed']['file'])
print chroot_path
print info.manifest.plugins['sed']['file']
print info.manifest.plugins['sed']['find']
print info.manifest.plugins['sed']['replace']
sed_i(chroot_path, info.manifest.plugins['sed']['find'], info.manifest.plugins['sed']['replace']) sed_i(chroot_path, info.manifest.plugins['sed']['find'], info.manifest.plugins['sed']['replace'])

View file

@ -1,31 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Backports setup and package install",
"type": "object",
"properties": {
"plugins": {
"type": "object",
"properties": {
"sed": {
"type": "array",
"items": {
"type": "object",
"properties": {
"file": {
"type": "string"
},
"find": {
"type": "string"
},
"replace": {
"type": "string"
}
}
}
}
},
"required": ["sed"]
}
},
"required": ["plugins"]
}