diff --git a/bootstrapvz/remote/README.rst b/bootstrapvz/remote/README.rst index 69335c7..e592eaa 100644 --- a/bootstrapvz/remote/README.rst +++ b/bootstrapvz/remote/README.rst @@ -165,7 +165,26 @@ at ``/root/guest_additions.iso`` on server 1, while server 2 has it at * ``guest_additions`` specifies the path to the VirtualBox guest additions ISO on the remote machine. * ``apt_proxy`` sets the configuration for the `apt_proxy plugin <../plugins/apt_proxy>`. -* ``ec2-credentials`` contains all the settings you know from EC2 manifests, - note that when running `integration tests <../../tests/integration>`__, - these credentials are also used when running instances. +* ``ec2-credentials`` contains all the settings you know from EC2 manifests. * ``s3-region`` overrides the s3 bucket region when bootstrapping S3 backed images. + + +Run settings +~~~~~~~~~~~~~~ +The run settings hold information about how to start a bootstrapped image. +This is useful only when running integration tests. + +.. code:: yaml + + local: + type: local + can_bootstrap: + - ec2-s3 + release: jessie + run_settings: + ec2-credentials: + access-key: AFAKEACCESSKEYFORAWS + secret-key: thes3cr3tkeyf0ryourawsaccount/FS4d8Qdva + +* ``ec2-credentials`` contains the access key and secret key used to boot + an EC2 AMI. diff --git a/bootstrapvz/remote/build_servers/build-servers-schema.yml b/bootstrapvz/remote/build_servers/build-servers-schema.yml index 077ee50..588687b 100644 --- a/bootstrapvz/remote/build_servers/build-servers-schema.yml +++ b/bootstrapvz/remote/build_servers/build-servers-schema.yml @@ -50,6 +50,16 @@ definitions: port: {type: integer} persistent: {type: boolean} required: [address, port] + run_settings: + type: object + properties: + ec2-credentials: + required: [access-key, secret-key] + type: object + properties: + access-key: {type: string} + secret-key: {type: string} + additional_properties: false ssh: type: object diff --git a/bootstrapvz/remote/build_servers/build_server.py b/bootstrapvz/remote/build_servers/build_server.py index 0cdf6a3..3e635a8 100644 --- a/bootstrapvz/remote/build_servers/build_server.py +++ b/bootstrapvz/remote/build_servers/build_server.py @@ -6,6 +6,7 @@ class BuildServer(object): self.name = name self.settings = settings self.build_settings = settings.get('build_settings', {}) + self.run_settings = settings.get('run_settings', {}) self.can_bootstrap = settings['can_bootstrap'] self.release = settings.get('release', None) diff --git a/tests/integration/providers/ec2/__init__.py b/tests/integration/providers/ec2/__init__.py index 39c044f..43b528f 100644 --- a/tests/integration/providers/ec2/__init__.py +++ b/tests/integration/providers/ec2/__init__.py @@ -29,8 +29,8 @@ def prepare_bootstrap(manifest, build_server): @contextmanager def boot_image(manifest, build_server, bootstrap_info, instance_type=None): - credentials = {'access-key': build_server.build_settings['ec2-credentials']['access-key'], - 'secret-key': build_server.build_settings['ec2-credentials']['secret-key']} + credentials = {'access-key': build_server.run_settings['ec2-credentials']['access-key'], + 'secret-key': build_server.run_settings['ec2-credentials']['secret-key']} from boto.ec2 import connect_to_region as ec2_connect ec2_connection = ec2_connect(bootstrap_info._ec2['region'], aws_access_key_id=credentials['access-key'],