kitchen-openstack icon indicating copy to clipboard operation
kitchen-openstack copied to clipboard

[Feature Request] Support HTTP URL for userdata

Open dpetzel opened this issue 9 years ago • 3 comments

In our environment we have some boilerplate userdata we need to inject into instances in order to prep them for TK testing. Right now we have userdata copied into a number of projects. It would very useful (and DRY) if we could configure the userdata to be fetched from an HTTP(s) endpoint. This would allow us to keep the userdata in a central place

dpetzel avatar Oct 12 '15 13:10 dpetzel

So it seems that user_data is an option in the https://github.com/fog/fog/blob/master/lib/fog/openstack/requests/compute/create_server.rb#L15. I have a running theory that we should be able to just hand off to that. I'm not sure how to make that happen but I'm pretty confident that is all we need to do.

jjasghar avatar Oct 12 '15 22:10 jjasghar

If it helps, here is how kitchen-ec2 is handling the user_data currently: https://github.com/test-kitchen/kitchen-ec2/blob/master/lib/kitchen/driver/aws/instance_generator.rb#L144

dpetzel avatar Oct 13 '15 00:10 dpetzel

That confirms I think what @jjasghar was saying. Looking at this line we are basically doing what ec2 is already doing. Only change would be to add an if/else where the else would say its not a file and just pass along the URL maybe.

Actually like this idea so then when teams are sharing scripts, they can be in a central repo.

carpnick avatar Nov 04 '15 05:11 carpnick