Skip to content

Commit

Permalink
Update all Vagrant VM host-only private network IP ranges.
Browse files Browse the repository at this point in the history
  • Loading branch information
geerlingguy committed Nov 27, 2022
1 parent 441f8b1 commit 814d4e9
Show file tree
Hide file tree
Showing 51 changed files with 102 additions and 102 deletions.
14 changes: 7 additions & 7 deletions deployments-balancer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ This project builds a simple application architecture with a load balancer which

The infrastructure is fairly simple, with the following structure:

-----------------------
| HAProxy (192.168.4.2) |
-----------------------
------------------------
| HAProxy (192.168.56.2) |
------------------------
|
_______________________________
| |
---------------------- ----------------------
| Apache (192.168.4.3) | | Apache (192.168.4.4) |
---------------------- ----------------------
----------------------- -----------------------
| Apache (192.168.56.3) | | Apache (192.168.56.4) |
----------------------- -----------------------

## Building the VMs

Expand All @@ -22,7 +22,7 @@ The infrastructure is fairly simple, with the following structure:
4. Run `ansible-galaxy install -r requirements.yml` in this directory to get the required Ansible roles.
5. Run `vagrant up` to build the VMs and configure the infrastructure.

When Vagrant is finished provisioning the VMs with Ansible, you should be able to visit `http://192.168.4.2/`, and you'll see the default Ubuntu Apache 2 'installation complete' page (loaded from one of the two backend web servers through HAProxy).
When Vagrant is finished provisioning the VMs with Ansible, you should be able to visit `http://192.168.56.2/`, and you'll see the default Ubuntu Apache 2 'installation complete' page (loaded from one of the two backend web servers through HAProxy).

## Performing a zero-downtime deployment

Expand Down
6 changes: 3 additions & 3 deletions deployments-balancer/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ Vagrant.configure("2") do |config|

# Define three VMs with static private IP addresses.
boxes = [
{ :name => "bal1", :ip => "192.168.4.2" },
{ :name => "app1", :ip => "192.168.4.3" },
{ :name => "app2", :ip => "192.168.4.4" }
{ :name => "bal1", :ip => "192.168.56.2" },
{ :name => "app1", :ip => "192.168.56.3" },
{ :name => "app2", :ip => "192.168.56.4" }
]

# Provision each of the VMs.
Expand Down
6 changes: 3 additions & 3 deletions deployments-balancer/inventory
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[balancer]
192.168.4.2
192.168.56.2

[app]
192.168.4.3
192.168.4.4
192.168.56.3
192.168.56.4

[deployments:children]
balancer
Expand Down
8 changes: 4 additions & 4 deletions deployments-balancer/playbooks/provision.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@

vars:
haproxy_backend_servers:
- name: 192.168.4.3
address: 192.168.4.3:80
- name: 192.168.4.4
address: 192.168.4.4:80
- name: 192.168.56.3
address: 192.168.56.3:80
- name: 192.168.56.4
address: 192.168.56.4:80

roles:
- geerlingguy.haproxy
Expand Down
2 changes: 1 addition & 1 deletion deployments-rolling/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This project builds a [Node.js](https://nodejs.org/)-based API app inside a VM.
Once the VM is built, you can test the API by running the following command (copy and paste verbatim, without the leading `$`), which requests the `/hello/:name` endpoint on each server:

$ for i in {2..5}; \
do curl -w "\n" "http://192.168.3.$i:8080/hello/john"; \
do curl -w "\n" "http://192.168.56.$i:8080/hello/john"; \
done

If the above command outputs `"hello john"` on four lines, everything worked correctly!
Expand Down
8 changes: 4 additions & 4 deletions deployments-rolling/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ Vagrant.configure("2") do |config|

# Define four VMs with static private IP addresses.
boxes = [
{ :name => "nodejs1", :ip => "192.168.3.2" },
{ :name => "nodejs2", :ip => "192.168.3.3" },
{ :name => "nodejs3", :ip => "192.168.3.4" },
{ :name => "nodejs4", :ip => "192.168.3.5" }
{ :name => "nodejs1", :ip => "192.168.56.2" },
{ :name => "nodejs2", :ip => "192.168.56.3" },
{ :name => "nodejs3", :ip => "192.168.56.4" },
{ :name => "nodejs4", :ip => "192.168.56.5" }
]

# Provision each of the VMs.
Expand Down
8 changes: 4 additions & 4 deletions deployments-rolling/inventory
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[nodejs-api]
192.168.3.2
192.168.3.3
192.168.3.4
192.168.3.5
192.168.56.2
192.168.56.3
192.168.56.4
192.168.56.5

[nodejs-api:vars]
ansible_user=vagrant
Expand Down
2 changes: 1 addition & 1 deletion deployments/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This project builds a [Ruby on Rails](http://rubyonrails.org/)-based app inside
4. Run `ansible-galaxy install -r requirements.yml` in this directory to get the required Ansible roles.
5. Run `vagrant up` to build the VM and deploy the version of the app specified in `playbooks/vars.yml`.

Once the VM is built, you can visit `http://192.168.33.7/` (or whatever domain name you point to that IP address in your local hosts file) to view the demo app.
Once the VM is built, you can visit `http://192.168.56.7/` (or whatever domain name you point to that IP address in your local hosts file) to view the demo app.

## Deploying application updates

Expand Down
2 changes: 1 addition & 1 deletion deployments/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Vagrant.configure(2) do |config|
end

config.vm.hostname = "rails-demo"
config.vm.network :private_network, ip: "192.168.33.7"
config.vm.network :private_network, ip: "192.168.56.7"

config.vm.provision "ansible" do |ansible|
ansible.playbook = "playbooks/main.yml"
Expand Down
2 changes: 1 addition & 1 deletion deployments/playbooks/inventory-ansible
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[rails]
192.168.33.7
192.168.56.7

[rails:vars]
ansible_user=vagrant
Expand Down
2 changes: 1 addition & 1 deletion docker-flask/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Once the new VM is up and running (after `vagrant up` is complete and you're bac

You need to modify your host machine's hosts file (Mac/Linux: `/etc/hosts`; Windows: `%systemroot%\system32\drivers\etc\hosts`), adding the line below:

192.168.33.39 docker-flask.test
192.168.56.39 docker-flask.test

After that is configured, you could visit http://docker-flask.test/ in a browser, and you'll see the test page, confirming the Flask container can communicate with the MySQL container.

Expand Down
2 changes: 1 addition & 1 deletion docker-flask/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "geerlingguy/ubuntu2004"
config.vm.network :private_network, ip: "192.168.33.39"
config.vm.network :private_network, ip: "192.168.56.39"
config.ssh.insert_key = false

config.vm.hostname = "docker-flask.test"
Expand Down
2 changes: 1 addition & 1 deletion drupal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Note: *If there are any errors during the course of running `vagrant up`, and it

### 3 - Configure your host machine to access the VM.

1. [Edit your hosts file](http://docs.rackspace.com/support/how-to/modify-your-hosts-file/), adding the line `192.168.88.8 drupal.test` so you can connect to the VM.
1. [Edit your hosts file](http://docs.rackspace.com/support/how-to/modify-your-hosts-file/), adding the line `192.168.56.8 drupal.test` so you can connect to the VM.
2. Open your browser and access [http://drupal.test/](http://drupal.test/).

## Notes
Expand Down
2 changes: 1 addition & 1 deletion drupal/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "geerlingguy/ubuntu2004"
config.vm.network :private_network, ip: "192.168.88.8"
config.vm.network :private_network, ip: "192.168.56.8"
config.vm.hostname = "drupal.test"
config.ssh.insert_key = false

Expand Down
2 changes: 1 addition & 1 deletion dynamic-inventory/custom/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Each of the scripts has comments for all the different parts of the code which g

## Testing these scripts

A Vagrantfile is provided, so you can build a couple local VMs to test with the inventory scripts. Make sure you have Vagrant and VirtualBox installed, and run `vagrant up` inside this folder to build the two VMs, with the IP addresses `192.168.28.71` and `192.168.28.72`.
A Vagrantfile is provided, so you can build a couple local VMs to test with the inventory scripts. Make sure you have Vagrant and VirtualBox installed, and run `vagrant up` inside this folder to build the two VMs, with the IP addresses `192.168.56.71` and `192.168.56.72`.

Then run the following command to test the inventory file with Ansible:

Expand Down
4 changes: 2 additions & 2 deletions dynamic-inventory/custom/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define "inventory1" do |inventory|
inventory.vm.hostname = "inventory1.test"
inventory.vm.box = "geerlingguy/ubuntu2004"
inventory.vm.network :private_network, ip: "192.168.28.71"
inventory.vm.network :private_network, ip: "192.168.56.71"
end

# Application server 2.
config.vm.define "inventory2" do |inventory|
inventory.vm.hostname = "inventory2.test"
inventory.vm.box = "geerlingguy/ubuntu2004"
inventory.vm.network :private_network, ip: "192.168.28.72"
inventory.vm.network :private_network, ip: "192.168.56.72"
end
end
6 changes: 3 additions & 3 deletions dynamic-inventory/custom/inventory.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
function example_inventory() {
return [
'group' => [
'hosts' => ['192.168.28.71', '192.168.28.72'],
'hosts' => ['192.168.56.71', '192.168.56.72'],
'vars' => [
'ansible_user' => 'vagrant',
'ansible_ssh_private_key_file' => '~/.vagrant.d/insecure_private_key',
Expand All @@ -25,10 +25,10 @@ function example_inventory() {
],
'_meta' => [
'hostvars' => [
'192.168.28.71' => [
'192.168.56.71' => [
'host_specific_var' => 'foo',
],
'192.168.28.72' => [
'192.168.56.72' => [
'host_specific_var' => 'bar',
],
],
Expand Down
6 changes: 3 additions & 3 deletions dynamic-inventory/custom/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(self):
def example_inventory(self):
return {
'group': {
'hosts': ['192.168.28.71', '192.168.28.72'],
'hosts': ['192.168.56.71', '192.168.56.72'],
'vars': {
'ansible_user': 'vagrant',
'ansible_ssh_private_key_file':
Expand All @@ -44,10 +44,10 @@ def example_inventory(self):
},
'_meta': {
'hostvars': {
'192.168.28.71': {
'192.168.56.71': {
'host_specific_var': 'foo'
},
'192.168.28.72': {
'192.168.56.72': {
'host_specific_var': 'bar'
}
}
Expand Down
4 changes: 2 additions & 2 deletions elk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Once the VMs are up and running (after `vagrant up` is complete and you're back

You need to modify your host machine's hosts file (Mac/Linux: `/etc/hosts`; Windows: `%systemroot%\system32\drivers\etc\hosts`), adding the lines below:

192.168.9.90 logs.test
192.168.9.91 web.test
192.168.56.90 logs.test
192.168.56.91 web.test

(Where `logs.test`/`web.test` is the hostname you have configured in the `Vagrantfile`).

Expand Down
4 changes: 2 additions & 2 deletions elk/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# ELK server.
config.vm.define "logs" do |logs|
logs.vm.hostname = "logs.test"
logs.vm.network :private_network, ip: "192.168.9.90"
logs.vm.network :private_network, ip: "192.168.56.90"

logs.vm.provision :ansible do |ansible|
ansible.playbook = "provisioning/elk/main.yml"
Expand All @@ -30,7 +30,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Web server.
config.vm.define "web" do |web|
web.vm.hostname = "web.test"
web.vm.network :private_network, ip: "192.168.9.91"
web.vm.network :private_network, ip: "192.168.56.91"

web.vm.provider :virtualbox do |v|
v.memory = 512
Expand Down
2 changes: 1 addition & 1 deletion elk/provisioning/elk/inventory
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[logs]
logs.test ansible_ssh_host=192.168.9.90 ansible_ssh_port=22
logs.test ansible_ssh_host=192.168.56.90 ansible_ssh_port=22
2 changes: 1 addition & 1 deletion elk/provisioning/web/inventory
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[web]
web.test ansible_ssh_host=192.168.9.91 ansible_ssh_port=22
web.test ansible_ssh_host=192.168.56.91 ansible_ssh_port=22
2 changes: 1 addition & 1 deletion elk/provisioning/web/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
lineinfile:
dest: /etc/hosts
regexp: '.*logs\.test$'
line: "192.168.9.90 logs.test"
line: "192.168.56.90 logs.test"
state: present
2 changes: 1 addition & 1 deletion galaxy-role-servers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This folder contains two quick demo playbooks which build a LAMP and Apache Solr

After running `vagrant up`, you can access the installed LAMP site or Solr Admin dashboard following these instructions:

1. [Edit your hosts file](http://docs.rackspace.com/support/how-to/modify-your-hosts-file/), adding the line `192.168.18.8 galaxy-role-servers.test` so you can connect to the VM.
1. [Edit your hosts file](http://docs.rackspace.com/support/how-to/modify-your-hosts-file/), adding the line `192.168.56.8 galaxy-role-servers.test` so you can connect to the VM.
2. Open your browser and access the following:
a. LAMP server: [http://galaxy-role-servers.test/](http://galaxy-role-servers.test/).
b. Solr Admin dashboard: [http://galaxy-role-servers.test:8983/](http://galaxy-role-servers.test:8983/).
Expand Down
2 changes: 1 addition & 1 deletion galaxy-role-servers/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "geerlingguy/ubuntu2004"
config.vm.network :private_network, ip: "192.168.18.8"
config.vm.network :private_network, ip: "192.168.56.8"
config.vm.hostname = "galaxy-role-servers.test"
config.ssh.insert_key = false

Expand Down
4 changes: 2 additions & 2 deletions gluster/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Vagrant.configure("2") do |config|

# Define two VMs with static private IP addresses.
boxes = [
{ :name => "gluster1", :ip => "192.168.29.2" },
{ :name => "gluster2", :ip => "192.168.29.3" }
{ :name => "gluster1", :ip => "192.168.56.2" },
{ :name => "gluster2", :ip => "192.168.56.3" }
]

# Provision each of the VMs.
Expand Down
4 changes: 2 additions & 2 deletions gluster/inventory
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[gluster]
192.168.29.2
192.168.29.3
192.168.56.2
192.168.56.3

[gluster:vars]
ansible_ssh_user=vagrant
Expand Down
2 changes: 1 addition & 1 deletion https-nginx-proxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Note: *If there are any errors during the course of running `vagrant up`, and it

### 3 - Configure your host machine to access the VM.

1. [Edit your hosts file](http://docs.rackspace.com/support/how-to/modify-your-hosts-file/), adding the line `192.168.46.84 https-proxy.test` so you can connect to the VM.
1. [Edit your hosts file](http://docs.rackspace.com/support/how-to/modify-your-hosts-file/), adding the line `192.168.56.84 https-proxy.test` so you can connect to the VM.
2. Open your browser and access [http://https.test](http://https.test), and you should be redirected to the `https://` version of the URL.

## Notes
Expand Down
2 changes: 1 addition & 1 deletion https-nginx-proxy/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "geerlingguy/debian10"
config.vm.hostname = "https-proxy.test"
config.vm.network :private_network, ip: "192.168.46.84"
config.vm.network :private_network, ip: "192.168.56.84"
config.ssh.insert_key = false

config.vm.provider :virtualbox do |v|
Expand Down
2 changes: 1 addition & 1 deletion https-self-signed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Note: *If there are any errors during the course of running `vagrant up`, and it

### 3 - Configure your host machine to access the VM.

1. [Edit your hosts file](http://docs.rackspace.com/support/how-to/modify-your-hosts-file/), adding the line `192.168.76.84 https.test` so you can connect to the VM.
1. [Edit your hosts file](http://docs.rackspace.com/support/how-to/modify-your-hosts-file/), adding the line `192.168.56.84 https.test` so you can connect to the VM.
2. Open your browser and access [https://https.test](https://https.test).

## Notes
Expand Down
2 changes: 1 addition & 1 deletion https-self-signed/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "geerlingguy/ubuntu2004"
config.vm.hostname = "https.test"
config.vm.network :private_network, ip: "192.168.76.84"
config.vm.network :private_network, ip: "192.168.56.84"
config.ssh.insert_key = false

config.vm.provider :virtualbox do |v|
Expand Down
2 changes: 1 addition & 1 deletion includes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This example playbook takes the `drupal` playbook example (included in the same

After running `vagrant up`, you can access the installed Drupal site following these instructions:

1. [Edit your hosts file](http://docs.rackspace.com/support/how-to/modify-your-hosts-file/), adding the line `192.168.88.89 drupal.test` so you can connect to the VM.
1. [Edit your hosts file](http://docs.rackspace.com/support/how-to/modify-your-hosts-file/), adding the line `192.168.56.89 drupal.test` so you can connect to the VM.
2. Open your browser and access [http://drupal.test/](http://drupal.test/).

## About the Author
Expand Down
2 changes: 1 addition & 1 deletion includes/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "geerlingguy/ubuntu2004"
config.vm.network :private_network, ip: "192.168.88.89"
config.vm.network :private_network, ip: "192.168.56.89"
config.vm.hostname = "drupal.test"
config.ssh.insert_key = false

Expand Down
2 changes: 1 addition & 1 deletion jenkins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Note: *If there are any errors during the course of running `vagrant up`, and it

### 3 - Configure your host machine to access the VM.

1. [Edit your hosts file](http://docs.rackspace.com/support/how-to/modify-your-hosts-file/), adding the line `192.168.76.76 jenkinsci.test` so you can connect to the VM.
1. [Edit your hosts file](http://docs.rackspace.com/support/how-to/modify-your-hosts-file/), adding the line `192.168.56.76 jenkinsci.test` so you can connect to the VM.
2. Open your browser and access [http://jenkinsci.test:8080](http://jenkinsci.test:8080).

## Notes
Expand Down
2 changes: 1 addition & 1 deletion jenkins/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "geerlingguy/ubuntu2004"
config.vm.hostname = "jenkinsci.test"
config.vm.network :private_network, ip: "192.168.76.76"
config.vm.network :private_network, ip: "192.168.56.76"
config.ssh.insert_key = false

config.vm.provider :virtualbox do |v|
Expand Down
Loading

0 comments on commit 814d4e9

Please sign in to comment.