Closed erinn closed 6 years ago
Hello!
I don't know how kitchen works, but I think your suggestion can be implemented, with the only condition that the hostname should be present in the Vagrantfile
through the config.vm.hostname
option. Other strategies, like getting the hostname directly from the vm, are not feasible since triggers can run even when the vm is powered off.
Let me know if it sounds good to you! :smiley:
Because of the way kitchen works, all vm names are 'default' thus if I want to run a vagrant trigger on say a rhel-7 system versus a rhel-6 system, I can't (well I could but it would be hackish). However, kitchen builds the hostname of the systems in a way that can be predicted, thus a foo/rhel-7 system brought up with kitchen will have a hostname of .*foo-rhel-7 which I can in fact match against.
Any chance, in addition to matching a regexp for :vm one could be written for say :hostname? I don't have any ruby skills at the moment or I would implement, but it doesn't look like it should be too hard to do that.
Thanks, -Erinn