andsens / build-debian-cloud

This project has been superseeded by andsens/bootstrap-vz and is no longer maintained - Script to create Debian Squeeze & Wheezy Amazon Machine Images (AMIs) and Google Compute Engine images
Other
116 stars 43 forks source link

Permit cloud-init to be configured for its metadata sources using debcon... #125

Closed JamesBromberger closed 10 years ago

JamesBromberger commented 10 years ago

This should permit the user to specify a metadata_source in the cloud_init plugin, so they can optimise to just the current environment.

andsens commented 10 years ago

Hm, I'm thinking the task could figure that out by itself depending on the provider setting in the manifest?

JamesBromberger commented 10 years ago

On 18/12/2013 1:31 AM, Anders Ingemann wrote:

Hm, I'm thinking the task could figure that out by itself depending on the provider setting in the manifest?

— Reply to this email directly or view it on GitHub https://github.com/andsens/build-debian-cloud/pull/125#issuecomment-30771802.

It could be that the user want to force it to do local config and ignore EC2's meta data server, while running on EC2 regardless.??

/Mobile:/ +61 422 166 708, /Email:/ james_AT_rcpt.to

andsens commented 10 years ago

It could be that the user want to force it to do local config and ignore EC2's meta data server, while running on EC2 regardless.??

Ah, ok. An override then? metadata_source_override? It's just that this is a potential source for malconfiguration, which can be avoided.

JamesBromberger commented 10 years ago

On 18/12/2013 1:36 AM, Anders Ingemann wrote:

It could be that the user want to force it to do local config and
ignore
EC2's meta data server, while running on EC2 regardless.??

Ah, ok. An override then? |metadata_source_override|? It's just that this is a potential source for malconfiguration, which can be avoided.

So from within a plugin, how can one determine the provider?

/Mobile:/ +61 422 166 708, /Email:/ james_AT_rcpt.to

andsens commented 10 years ago

info.manifest.provider

andsens commented 10 years ago

Nice job on the changes, though you should check the code with PEP8, there are some small discrepancies: find . -name '*.py' | /usr/bin/grep -v minify_json | xargs pep8 --ignore=E101,E221,E241,E501,W191 Also: The rest of the code uses tabs for indentation, the plugin should do the same.

p.s.: Sorry for the late answer, somehow github doesn't deem code updates to a pull request notification worthy :-/

andsens commented 10 years ago

Also. The DisableModules and SetMetadataSource only do stuff if something is specified in the manifest. This check should be done when adding the tasks (like so), otherwise the log will say that some tasks have run which in fact have not done anything, this can complicate the debugging process.

andsens commented 10 years ago

Yay, looks great! *merged.