Skip to content

Instantly share code, notes, and snippets.

@nagas
Last active December 16, 2015 08:09
Show Gist options
  • Save nagas/5404211 to your computer and use it in GitHub Desktop.
Save nagas/5404211 to your computer and use it in GitHub Desktop.
[vagrant@develka1 cluster0]$ vagrant status
Current machine states:
puppet-master running (virtualbox)
puppet-client0 running (virtualbox)
This environment represents multiple VMs. The VMs are all listed
above with their current state. For more information about a specific
VM, run `vagrant status NAME`.
[vagrant@develka1 cluster0]$ vagrant ssh puppet-master -c 'cat /etc/hosts'
127.0.0.1 localhost localhost.localdomain
192.168.45.2 puppet-master.local
192.168.45.3 puppet-client0.local
[vagrant@develka1 cluster0]$ vagrant ssh puppet-client0 -c 'cat /etc/hosts'
127.0.0.1 localhost localhost.localdomain
192.168.45.2 puppet-master.local
192.168.45.3 puppet-client0.local
[vagrant@develka1 cluster0]$ grep aliases -B2 Vagrantfile
config.vm.define "puppet-master".to_sym do |node|
node.hostmanager.aliases = %W(puppet-master-alias puppet-master-alias.localdomain)
--
INSTANCES.times do |i|
config.vm.define "puppet-client#{i}".to_sym do |node|
node.hostmanager.aliases = %W(puppet-client#{i}-alias puppet-client#{i}-alias.localdomain)
[vagrant@develka1 cluster0]$ vagrant hostmanager
[puppet-master] Updating /etc/hosts file
[puppet-client0] Updating /etc/hosts file
[vagrant@develka1 cluster0]$ vagrant ssh puppet-master -c 'cat /etc/hosts'
127.0.0.1 localhost localhost.localdomain
192.168.45.2 puppet-master.local puppet-master-alias puppet-master-alias.localdomain
192.168.45.3 puppet-client0.local puppet-client0-alias puppet-client0-alias.localdomain
[vagrant@develka1 cluster0]$ vagrant ssh puppet-client0 -c 'cat /etc/hosts'
127.0.0.1 localhost localhost.localdomain
192.168.45.2 puppet-master.local puppet-master-alias puppet-master-alias.localdomain
192.168.45.3 puppet-client0.local puppet-client0-alias puppet-client0-alias.localdomain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment