Skip to content
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

#169 easily override instance name #170

Closed
wants to merge 2 commits into from

Conversation

xmik
Copy link
Contributor

@xmik xmik commented May 21, 2015

Took @fnichol idea from #144 and now by default vm instance name and hostname is:
"kt-{kitchen_root_directory}-{instance_name}". It can be overridden in .kitchen.yml by setting "instance_name" option.

I tested it on Windows 7 and Debian 7.8. The hostname on Windows is shortened to 15 chars.

Any corrections are welcomed.

xmik added 2 commits May 21, 2015 15:26
Default vm instance name and hostname is now:
"kt-<kitchen_root_directory>-<instance_name>".
It can be overriden in .kitchen.yml by setting "instance_name" option.
When in .kitchen.yml:
* vm_hostname is set to false, then use previous default behavior: not
setting hostname (not using 'c.vm.define' in generated Vagrantfile)
* vm_name is set to some string, leads to setting hostname and machine
name in cloud dashboard
* vm_name is not set and vm_hostname is not set to false, then the
hostname and machine name in cloud dashboard is
"kt-<kitchen_root_directory>-<instance_name>"

Changed instance_name to vm_name, to avoid taking it for Test Kitchen
instance.name.
@xmik
Copy link
Contributor Author

xmik commented Jun 20, 2015

This is inconsistent with customize section.

Example: ssh cookbook, vagrant-openstack-provider Vagrant plugin, .kitchen.yml:

- name: debian-vagrant
  driver:
    name: vagrant
  driver_config:
    box:    'debian-7.5-chef-11.16.4'
    customize:
      server_name: 'kt-ssh-debian-vagrant'
suites:
  - name: server
    run_list:  ['recipe[ssh::server]']

It will create OpenStack machine named kt-ssh-debian-vagrant. Assuming the ssh cookbook is located in cookbook-ssh directory, Kitchen will try to log into machine named: kt-cookbook-ssh-server-debian-vagrant. (Result is Permission Denied and eventually: Timeout.)

@xmik
Copy link
Contributor Author

xmik commented Sep 29, 2015

This is not good enough, I'm not using neither testing it more, so I'll close it.

@xmik xmik closed this Sep 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant