mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00
Merge pull request #346 from vorlock/master
Added tagging for the created images +
This commit is contained in:
commit
d99f345fa9
7 changed files with 124 additions and 46 deletions
|
@ -110,7 +110,7 @@ class Manifest(object):
|
||||||
self.system = self.data['system']
|
self.system = self.data['system']
|
||||||
from bootstrapvz.common.releases import get_release
|
from bootstrapvz.common.releases import get_release
|
||||||
self.release = get_release(self.system['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.packages = self.data['packages'] if 'packages' in self.data else {}
|
||||||
self.plugins = self.data['plugins'] if 'plugins' 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):
|
def resolve_tasks(taskset, manifest):
|
||||||
|
"""
|
||||||
|
Function setting up tasks to run for this provider
|
||||||
|
"""
|
||||||
from bootstrapvz.common.releases import wheezy, jessie, stable
|
from bootstrapvz.common.releases import wheezy, jessie, stable
|
||||||
|
|
||||||
taskset.update(task_groups.get_standard_groups(manifest))
|
taskset.update(task_groups.get_standard_groups(manifest))
|
||||||
|
|
|
@ -3,6 +3,9 @@ $schema: http://json-schema.org/draft-04/schema#
|
||||||
title: EC2 manifest
|
title: EC2 manifest
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
tags:
|
||||||
|
type: object
|
||||||
|
minProperties: 1
|
||||||
provider:
|
provider:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
|
|
@ -125,3 +125,9 @@ class RegisterAMI(Task):
|
||||||
registration_params['sriov_net_support'] = 'simple'
|
registration_params['sriov_net_support'] = 'simple'
|
||||||
|
|
||||||
info._ec2['image'] = info._ec2['connection'].register_image(**registration_params)
|
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)
|
||||||
|
|
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