mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 09:50:37 +00:00
Added AMI tagging for AWS provider +
* minor syntax fixes * added official Stretch manifest
This commit is contained in:
parent
b63f19ec73
commit
5267d95360
7 changed files with 124 additions and 46 deletions
|
@ -47,10 +47,10 @@ properties:
|
|||
enum: [i386]
|
||||
bootloader:
|
||||
enum:
|
||||
- pvgrub
|
||||
- grub
|
||||
- extlinux
|
||||
- none
|
||||
- pvgrub
|
||||
- grub
|
||||
- extlinux
|
||||
- none
|
||||
charmap: {type: string}
|
||||
hostname:
|
||||
type: string
|
||||
|
@ -59,12 +59,12 @@ properties:
|
|||
release: {type: string}
|
||||
timezone: {type: string}
|
||||
required:
|
||||
- release
|
||||
- architecture
|
||||
- bootloader
|
||||
- timezone
|
||||
- locale
|
||||
- charmap
|
||||
- release
|
||||
- architecture
|
||||
- bootloader
|
||||
- timezone
|
||||
- locale
|
||||
- charmap
|
||||
additionalProperties: false
|
||||
packages:
|
||||
type: object
|
||||
|
@ -77,8 +77,8 @@ properties:
|
|||
type: array
|
||||
items:
|
||||
anyOf:
|
||||
- pattern: ^[^/]+(/[^/]+)?$
|
||||
- $ref: '#/definitions/absolute_path'
|
||||
- pattern: ^[^/]+(/[^/]+)?$
|
||||
- $ref: '#/definitions/absolute_path'
|
||||
minItems: 1
|
||||
install_standard: {type: boolean}
|
||||
mirror:
|
||||
|
@ -137,8 +137,8 @@ properties:
|
|||
partitions:
|
||||
type: object
|
||||
oneOf:
|
||||
- $ref: '#/definitions/no_partitions'
|
||||
- $ref: '#/definitions/partition_table'
|
||||
- $ref: '#/definitions/no_partitions'
|
||||
- $ref: '#/definitions/partition_table'
|
||||
required: [partitions]
|
||||
additionalProperties: false
|
||||
definitions:
|
||||
|
|
|
@ -110,7 +110,7 @@ class Manifest(object):
|
|||
self.system = self.data['system']
|
||||
from bootstrapvz.common.releases import get_release
|
||||
self.release = get_release(self.system['release'])
|
||||
# The packages and plugins section is not required
|
||||
# The packages and plugins sections are not required
|
||||
self.packages = self.data['packages'] if 'packages' in self.data else {}
|
||||
self.plugins = self.data['plugins'] if 'plugins' in self.data else {}
|
||||
|
||||
|
|
|
@ -49,6 +49,9 @@ def validate_manifest(data, validator, error):
|
|||
|
||||
|
||||
def resolve_tasks(taskset, manifest):
|
||||
"""
|
||||
Function setting up tasks to run for this provider
|
||||
"""
|
||||
from bootstrapvz.common.releases import wheezy, jessie, stable
|
||||
|
||||
taskset.update(task_groups.get_standard_groups(manifest))
|
||||
|
|
|
@ -3,6 +3,9 @@ $schema: http://json-schema.org/draft-04/schema#
|
|||
title: EC2 manifest
|
||||
type: object
|
||||
properties:
|
||||
tags:
|
||||
type: object
|
||||
minProperties: 1
|
||||
provider:
|
||||
type: object
|
||||
properties:
|
||||
|
@ -14,12 +17,12 @@ properties:
|
|||
secret-key: {type: string}
|
||||
virtualization:
|
||||
enum:
|
||||
- pvm
|
||||
- hvm
|
||||
- pvm
|
||||
- hvm
|
||||
enhanced_networking:
|
||||
enum:
|
||||
- none
|
||||
- simple
|
||||
- none
|
||||
- simple
|
||||
required: [description, virtualization]
|
||||
system:
|
||||
type: object
|
||||
|
@ -27,22 +30,22 @@ properties:
|
|||
bootloader:
|
||||
type: string
|
||||
enum:
|
||||
- pvgrub
|
||||
- grub
|
||||
- extlinux
|
||||
- pvgrub
|
||||
- grub
|
||||
- extlinux
|
||||
volume:
|
||||
type: object
|
||||
properties:
|
||||
backing:
|
||||
enum:
|
||||
- ebs
|
||||
- s3
|
||||
- ebs
|
||||
- s3
|
||||
partitions:
|
||||
type: object
|
||||
properties:
|
||||
type:
|
||||
enum:
|
||||
- none
|
||||
- msdos
|
||||
- gpt
|
||||
- none
|
||||
- msdos
|
||||
- gpt
|
||||
required: [backing]
|
||||
|
|
|
@ -125,3 +125,9 @@ class RegisterAMI(Task):
|
|||
registration_params['sriov_net_support'] = 'simple'
|
||||
|
||||
info._ec2['image'] = info._ec2['connection'].register_image(**registration_params)
|
||||
|
||||
# Setting up tags on the AMI
|
||||
if 'tags' in info.manifest.data:
|
||||
raw_tags = info.manifest.data['tags']
|
||||
tags = {k: v.format(**info.manifest_vars) for k, v in raw_tags.items()}
|
||||
info._ec2['connection'].create_tags(info._ec2['image'], tags)
|
||||
|
|
|
@ -27,31 +27,31 @@ volume:
|
|||
packages:
|
||||
mirror: http://cloudfront.debian.net/debian
|
||||
components:
|
||||
- main
|
||||
- contrib
|
||||
- non-free
|
||||
- main
|
||||
- contrib
|
||||
- non-free
|
||||
preferences:
|
||||
backport-cloud-init-cloud-utils:
|
||||
- package: cloud-init cloud-utils
|
||||
pin: release n=jessie-backports
|
||||
pin-priority: 500
|
||||
- package: cloud-init cloud-utils
|
||||
pin: release n=jessie-backports
|
||||
pin-priority: 500
|
||||
install:
|
||||
- awscli
|
||||
- python-boto
|
||||
- python3-boto
|
||||
- apt-transport-https
|
||||
- lvm2
|
||||
- ncurses-term
|
||||
- parted
|
||||
- cloud-init
|
||||
- cloud-utils
|
||||
- gdisk
|
||||
- systemd
|
||||
- systemd-sysv
|
||||
- awscli
|
||||
- python-boto
|
||||
- python3-boto
|
||||
- apt-transport-https
|
||||
- lvm2
|
||||
- ncurses-term
|
||||
- parted
|
||||
- cloud-init
|
||||
- cloud-utils
|
||||
- gdisk
|
||||
- systemd
|
||||
- systemd-sysv
|
||||
plugins:
|
||||
cloud_init:
|
||||
metadata_sources: Ec2
|
||||
username: admin
|
||||
enable_modules:
|
||||
cloud_init_modules:
|
||||
- { module: growpart, position: 4}
|
||||
- {module: growpart, position: 4}
|
||||
|
|
66
manifests/official/ec2/ebs-stretch-amd64-hvm.yml
Normal file
66
manifests/official/ec2/ebs-stretch-amd64-hvm.yml
Normal file
|
@ -0,0 +1,66 @@
|
|||
---
|
||||
name: debian-{system.release}-{system.architecture}-{provider.virtualization}-{%Y}-{%m}-{%d}-{%H}{%M}-ebs
|
||||
tags:
|
||||
Name: "Stretch 9.0 alpha"
|
||||
Debian: "9.0~{%Y}{%m}{%d}"
|
||||
provider:
|
||||
name: ec2
|
||||
virtualization: hvm
|
||||
enhanced_networking: simple
|
||||
# credentials:
|
||||
# access-key: AFAKEACCESSKEYFORAWS
|
||||
# secret-key: thes3cr3tkeyf0ryourawsaccount/FS4d8Qdva
|
||||
description: Debian {system.release} {system.architecture}
|
||||
bootstrapper:
|
||||
workspace: /target
|
||||
system:
|
||||
release: stretch
|
||||
architecture: amd64
|
||||
bootloader: grub
|
||||
charmap: UTF-8
|
||||
locale: en_US
|
||||
timezone: UTC
|
||||
volume:
|
||||
backing: ebs
|
||||
partitions:
|
||||
type: gpt
|
||||
root:
|
||||
filesystem: ext4
|
||||
size: 8GiB
|
||||
packages:
|
||||
mirror: http://cloudfront.debian.net/debian
|
||||
components:
|
||||
- main
|
||||
- contrib
|
||||
- non-free
|
||||
install:
|
||||
- awscli
|
||||
- python-boto
|
||||
- python3-boto
|
||||
- apt-transport-https
|
||||
- lvm2
|
||||
- ncurses-term
|
||||
- parted
|
||||
- cloud-init
|
||||
- cloud-utils
|
||||
- gdisk
|
||||
- systemd
|
||||
- systemd-sysv
|
||||
plugins:
|
||||
cloud_init:
|
||||
metadata_sources: Ec2
|
||||
username: admin
|
||||
enable_modules:
|
||||
cloud_init_modules:
|
||||
- {module: growpart, position: 4}
|
||||
# ec2_launch:
|
||||
# security_group_ids:
|
||||
# # this have to be a NONE VPC SG
|
||||
# - sg-398a704f
|
||||
# instance_type: m3.medium
|
||||
# ssh_key: my_ssh_key
|
||||
# print_public_ip: "/tmp/stretch-ami-test-ip"
|
||||
# tags:
|
||||
# Name: "testing-ami-{system.release}"
|
||||
# Debian: "9.0~{%Y}{%m}{%d}{%H}{%M}"
|
||||
# deregister_ami: false
|
Loading…
Add table
Reference in a new issue