With our current model we use the knife-vsphere plugin with a wrapper perl script that essentially for loops knife in conjunction with a csv file to mass deploy a list of VMs. I'm wondering if a workflow like this is possible with policyfiles?
Asked
Active
Viewed 237 times
-1
-
Where actually do you see the problem? How much have you tried winding your head around a concept to port your workflow to Policyfiles? – StephenKing Nov 14 '16 at 16:18
-
Porting the workflow is not a problem as the new workflow will be for a completely new environment. The only problem is that I am not sure how to provision in large quantities. Since this is a new environment there will be quite a lot of VMs to build out and we typically handle that with the perl script I mentioned above. I'm just wondering if this is handled somehow via chef provision or some other tool. – TyMac Nov 14 '16 at 17:39
-
Not sure why bootstrapping using Policyfiles should be so much different than without. – StephenKing Nov 14 '16 at 22:25
-
What I'm trying to get at is basically what this has to say about knife zero: https://knife-zero.github.io/tips/with_policyfile/ The --policy-name switch applies a policy with knifie zero. i'm wondering if there is a way to do this with knife-vsphere, ec2... etc. – TyMac Nov 15 '16 at 03:13
1 Answers
0
Policyfiles generally assume you are using Chef Server, there is minimal support in the workflow for using chef-solo. You can play with using the chef export -a
feature to generate policy archives and then transferring them via SFTP or hosting them on an internal web server somewhere. Overall "doable but not documented so you're on your own".

coderanger
- 52,400
- 4
- 52
- 75
-
I'm actually not trying to deploy with knife solo or zero. I was referencing that because it's the only knife command I can find that seems to work with policyfiles. I actually want to deploy to aws and vsphere. – TyMac Nov 18 '16 at 18:03
-
If you are using chef client you would use the normal knife bootstrap command or one of the knife cloud plugins which wrap it. – coderanger Nov 18 '16 at 18:41
-
What would that look like? For instance with knife ec2 where would a reference the policyfile instead of a role? – TyMac Nov 19 '16 at 16:26
-
1You would normally use `--policy-name` and `--policy-group`, just like with `knife bootstrap` (they use the same code). – coderanger Nov 19 '16 at 21:37
-
Does not seem to work with knife ec2 however: knife ec2 server create --policy-name 'motd_home' --policy-group f5520dfe79 -I ami-9aaa1cf2 -f t2.small -S chef -i chef.pem --ssh-user ubuntu --subnet subnet-8ecf97b2 FATAL: Cannot find subcommand for: 'ec2 server create --policy-name motd_home --policy-group f5520dfe79 -I ami-9aaa1cf2 -f t2.small -S chef -i chef.pem --ssh-user ubuntu --subnet subnet-8ecf97b2' Available ec2 subcommands: (for details, knife SUB-COMMAND --help) – TyMac Dec 15 '16 at 20:31