-
Notifications
You must be signed in to change notification settings - Fork 584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add lifecycle hooks to various phases (including provisioners) #329
Comments
I think I've got a +1 for "support multiple provisioners to run in sequence" I'd like to be able to provision a machine by first applying the chef_zero provisioner and then applying the shell provisioner to it. I'd also like to be able to slurp back artifacts after the converge is done. The goal is to replicate what we used to be able to do with Vagrant in the omnibus-chef project. We need to be able to chain provisioners, because we want to leverage the omnibus cookbook to configure the server, but since we're building chef we need to Maybe we could write a 'test' using busser that actually did the build, but that feels wrong as well, the test phase should be running rspec against the built artifact. |
If you can chain provisioners this also solves the "arbitrary commands before provisioning" problem in #311 since you can just do the reverse of what I want to do and run your shell provisioner first to setup your CA certs or install wget/curl, and then you run your chef provisioner. |
👍 This is a must for our team |
What about post-test? |
yeah i'd like to pull artifacts back down to a directory in a post-test. being able to run a command to push and deploy post-test is another obvious use case. chaining multiple different post-test plugins would also probably be a thing as well but might be a stretch at first. |
hooks would be very useful. for example what i would like is to be able to cleanup after doing a converge or verify. (ie remove chef and the repository but leave the server configured). Currently we only have the option to destroy the server |
More evidence for need of this feature: |
I have a rather specific corner case for this feature. I have a number of cookbooks that have AWS-specific things in them. One thing that they commonly do is update resource tags via the aws_resource_tag 'elasticsearch cluster tag' do
resource_id node['ec2']['instance_id']
tags 'ElasticsearchCluster' => node.chef_environment
end My issue arises because I use test-kitchen with the kitchen-ec2 driver in our CI environment to do integration testing, and the instances get created in a VPC. For VPC instances, ohai does not detect that they're running on EC2 automatically, and so a hint file needs to be created before Chef runs at Normally this is simply done with the bootstrapping script for our base AMI, but our cookbooks use the Canonical AMIs so that they can be tested more generically so there's no hint present to tell Ohai to populate the Ideally, it would be nice if test-kitchen supported multiple provisioners so that I could run a simple shell provisioner before the chef-zero provisioner that touches the hint file for Ohai. (Obviously there's a number of ways I could approach this, one of which would be to add functionality to kitchen-ec2 instead to touch the hint file right after starting the instance if the |
+1 I have the exact same issue as above. Do we have any idea when this might be done? Or does anyone have a good work around for this vpc hint issue, other than modifying the image? |
bump any further updates to this one? |
@fnichol @tyler-ball buuuuuump |
+1 for multi-provisioning |
bump |
1 similar comment
bump |
+1 |
2 similar comments
+1 |
+1 |
+1 this would be very useful |
+1 on behalf of a commercial user I work with. (Thanks, @cheeseplus, for tagging for future release) |
+1 for |
A hack would be to call |
+1 I would really like this! |
The company I work for at the moment does SSL inception on the VPN connection. This way the installation of the puppet agent fails. If I copy the self signed CA pem file into the VM at "/etc/pki/ca-trust/source/anchors/vpn-ca.pem" and run "update-ca-trust", the SSL connection is valid and the puppet agent installation is successful. However, at the moment it's not possible to specify multiple Kitchen provisioners (test-kitchen/test-kitchen#329). An alternative is to use the custom_install_command, but right now this command is executed AFTER the puppet agent installation step, so I can't use it unless it's executed earlier. Is this a correct solution or do you have an alternative?
+1 |
2 similar comments
+1 |
+1 |
+1, for an implementation that would allow a run-multiple-provisioners-in-sequence scenario. Cheers! |
+1 |
1 similar comment
+1 |
+1, would love to run both a Terraform and Ansible provisioner in sequence. Found a workaround (trigger ansible within terraform), but it doesn't feel like the right way to do it at all. |
+1 |
6 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
I've locked this since the stream of +1s are not adding anything; we understand that people would like this feature but right now it is not planned or specced. If someone wants to take a crack at designing and implementing it we'd be very happy to help and mentor them! |
Fixed by #1428 |
Example #257
@fnichol is going to tack on some more information/whiteboard picture 😄.
The text was updated successfully, but these errors were encountered: