diff --git a/manifests/ec2-ebs-debian-official-i386-pvm.manifest.json b/manifests/ec2-ebs-debian-official-i386-pvm.manifest.json new file mode 100644 index 0000000..72f03db --- /dev/null +++ b/manifests/ec2-ebs-debian-official-i386-pvm.manifest.json @@ -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" + } + } +} diff --git a/manifests/ec2-ebs-debian-official.manifest.json b/manifests/ec2-ebs-debian-official.manifest.json index 6292fe5..730c801 100644 --- a/manifests/ec2-ebs-debian-official.manifest.json +++ b/manifests/ec2-ebs-debian-official.manifest.json @@ -25,15 +25,26 @@ "partitions": { "type": "none", "root": { - "size": 1024, + "size": 8192, "filesystem": "ext4" } } }, "plugins": { - "admin_user": { + "backports": { "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" } } } diff --git a/plugins/sed/__init__.py b/plugins/sed/__init__.py index e020769..c754084 100644 --- a/plugins/sed/__init__.py +++ b/plugins/sed/__init__.py @@ -2,8 +2,7 @@ def tasks(tasklist, manifest): import tasks - tasklist.add(tasks.DoSeds()) - + tasklist.add(tasks.DoSeds) def validate_manifest(data, schema_validate): from os import path diff --git a/plugins/sed/tasks.py b/plugins/sed/tasks.py index b197121..49f1d4b 100644 --- a/plugins/sed/tasks.py +++ b/plugins/sed/tasks.py @@ -12,8 +12,4 @@ class DoSeds(Task): def run(self, info): 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']) diff --git a/plugins/sed/temp b/plugins/sed/temp deleted file mode 100644 index 0f9f99a..0000000 --- a/plugins/sed/temp +++ /dev/null @@ -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"] -}