Skip to content

Instantly share code, notes, and snippets.

@bibliotechy
Created July 7, 2020 15:33
Show Gist options
  • Save bibliotechy/e9bb9b76baf7e55511985c200a51a1f7 to your computer and use it in GitHub Desktop.
Save bibliotechy/e9bb9b76baf7e55511985c200a51a1f7 to your computer and use it in GitHub Desktop.
Bringing machine 'machine-01' up with 'virtualbox' provider...
Bringing machine 'machine-02' up with 'virtualbox' provider...
Bringing machine 'machine-03' up with 'virtualbox' provider...
==> machine-01: Box 'centos/7' could not be found. Attempting to find and install...
machine-01: Box Provider: virtualbox
machine-01: Box Version: >= 0
==> machine-01: Loading metadata for box 'centos/7'
machine-01: URL: https://vagrantcloud.com/centos/7
==> machine-01: Adding box 'centos/7' (v2004.01) for provider: virtualbox
machine-01: Downloading: https://vagrantcloud.com/centos/boxes/7/versions/2004.01/providers/virtualbox.box
Download redirected to host: cloud.centos.org
machine-01: Calculating and comparing box checksum...
==> machine-01: Successfully added box 'centos/7' (v2004.01) for 'virtualbox'!
==> machine-01: Importing base box 'centos/7'...
==> machine-01: Matching MAC address for NAT networking...
==> machine-01: Checking if box 'centos/7' version '2004.01' is up to date...
==> machine-01: Setting the name of the VM: ansible-playbook-solrcloud_machine-01_1594133394002_57303
==> machine-01: Clearing any previously set network interfaces...
==> machine-01: Preparing network interfaces based on configuration...
machine-01: Adapter 1: nat
==> machine-01: Forwarding ports...
machine-01: 22 (guest) => 2222 (host) (adapter 1)
==> machine-01: Booting VM...
==> machine-01: Waiting for machine to boot. This may take a few minutes...
machine-01: SSH address: 127.0.0.1:2222
machine-01: SSH username: vagrant
machine-01: SSH auth method: private key
machine-01:
machine-01: Vagrant insecure key detected. Vagrant will automatically replace
machine-01: this with a newly generated keypair for better security.
machine-01:
machine-01: Inserting generated public key within guest...
machine-01: Removing insecure key from the guest if it's present...
machine-01: Key inserted! Disconnecting and reconnecting using new SSH key...
==> machine-01: Machine booted and ready!
==> machine-01: Checking for guest additions in VM...
machine-01: No guest additions were detected on the base box for this VM! Guest
machine-01: additions are required for forwarded ports, shared folders, host only
machine-01: networking, and more. If SSH fails on this machine, please install
machine-01: the guest additions and repackage the box to continue.
machine-01:
machine-01: This is not an error message; everything may continue to work properly,
machine-01: in which case you may ignore this message.
==> machine-01: Setting hostname...
==> machine-01: Rsyncing folder: /Users/cbn/projects/ansible-playbook-solrcloud/ => /vagrant
==> machine-01: Running provisioner: shell...
machine-01: Running: inline script
machine-01: hello from node 3
==> machine-02: Box 'centos/7' could not be found. Attempting to find and install...
machine-02: Box Provider: virtualbox
machine-02: Box Version: >= 0
==> machine-02: Loading metadata for box 'centos/7'
machine-02: URL: https://vagrantcloud.com/centos/7
==> machine-02: Adding box 'centos/7' (v2004.01) for provider: virtualbox
==> machine-02: Importing base box 'centos/7'...
==> machine-02: Matching MAC address for NAT networking...
==> machine-02: Checking if box 'centos/7' version '2004.01' is up to date...
==> machine-02: Setting the name of the VM: ansible-playbook-solrcloud_machine-02_1594133422614_57495
==> machine-02: Fixed port collision for 22 => 2222. Now on port 2200.
==> machine-02: Clearing any previously set network interfaces...
==> machine-02: Preparing network interfaces based on configuration...
machine-02: Adapter 1: nat
==> machine-02: Forwarding ports...
machine-02: 22 (guest) => 2200 (host) (adapter 1)
==> machine-02: Booting VM...
==> machine-02: Waiting for machine to boot. This may take a few minutes...
machine-02: SSH address: 127.0.0.1:2200
machine-02: SSH username: vagrant
machine-02: SSH auth method: private key
machine-02:
machine-02: Vagrant insecure key detected. Vagrant will automatically replace
machine-02: this with a newly generated keypair for better security.
machine-02:
machine-02: Inserting generated public key within guest...
machine-02: Removing insecure key from the guest if it's present...
machine-02: Key inserted! Disconnecting and reconnecting using new SSH key...
==> machine-02: Machine booted and ready!
==> machine-02: Checking for guest additions in VM...
machine-02: No guest additions were detected on the base box for this VM! Guest
machine-02: additions are required for forwarded ports, shared folders, host only
machine-02: networking, and more. If SSH fails on this machine, please install
machine-02: the guest additions and repackage the box to continue.
machine-02:
machine-02: This is not an error message; everything may continue to work properly,
machine-02: in which case you may ignore this message.
==> machine-02: Setting hostname...
==> machine-02: Rsyncing folder: /Users/cbn/projects/ansible-playbook-solrcloud/ => /vagrant
==> machine-02: Running provisioner: shell...
machine-02: Running: inline script
machine-02: hello from node 3
==> machine-03: Box 'centos/7' could not be found. Attempting to find and install...
machine-03: Box Provider: virtualbox
machine-03: Box Version: >= 0
==> machine-03: Loading metadata for box 'centos/7'
machine-03: URL: https://vagrantcloud.com/centos/7
==> machine-03: Adding box 'centos/7' (v2004.01) for provider: virtualbox
==> machine-03: Importing base box 'centos/7'...
==> machine-03: Matching MAC address for NAT networking...
==> machine-03: Checking if box 'centos/7' version '2004.01' is up to date...
==> machine-03: Setting the name of the VM: ansible-playbook-solrcloud_machine-03_1594133451788_41011
==> machine-03: Fixed port collision for 22 => 2222. Now on port 2201.
==> machine-03: Clearing any previously set network interfaces...
==> machine-03: Preparing network interfaces based on configuration...
machine-03: Adapter 1: nat
==> machine-03: Forwarding ports...
machine-03: 22 (guest) => 2201 (host) (adapter 1)
==> machine-03: Booting VM...
==> machine-03: Waiting for machine to boot. This may take a few minutes...
machine-03: SSH address: 127.0.0.1:2201
machine-03: SSH username: vagrant
machine-03: SSH auth method: private key
machine-03:
machine-03: Vagrant insecure key detected. Vagrant will automatically replace
machine-03: this with a newly generated keypair for better security.
machine-03:
machine-03: Inserting generated public key within guest...
machine-03: Removing insecure key from the guest if it's present...
machine-03: Key inserted! Disconnecting and reconnecting using new SSH key...
==> machine-03: Machine booted and ready!
==> machine-03: Checking for guest additions in VM...
machine-03: No guest additions were detected on the base box for this VM! Guest
machine-03: additions are required for forwarded ports, shared folders, host only
machine-03: networking, and more. If SSH fails on this machine, please install
machine-03: the guest additions and repackage the box to continue.
machine-03:
machine-03: This is not an error message; everything may continue to work properly,
machine-03: in which case you may ignore this message.
==> machine-03: Setting hostname...
==> machine-03: Rsyncing folder: /Users/cbn/projects/ansible-playbook-solrcloud/ => /vagrant
==> machine-03: Running provisioner: shell...
machine-03: Running: inline script
machine-03: hello from node 3
Vagrant.configure(2) do |config|
N = 3
VAGRANT_VM_PROVIDER = "virtualbox"
ANSIBLE_RAW_SSH_ARGS = []
(1..N).each do |i|
ANSIBLE_RAW_SSH_ARGS << "-o IdentityFile=.vagrant/machines/machine-0#{i}/#{VAGRANT_VM_PROVIDER}/private_key"
config.vm.define "machine-0#{i}" do |machine|
machine.vm.box = "centos/7"
machine.vm.hostname = "machine-0#{i}"
if i == N
config.vm.provision :shell, inline: "echo hello from node #{i}"
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment