From 814d4e948c46cca6751119728a589764597c4259 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Sun, 27 Nov 2022 13:33:47 -0600 Subject: [PATCH] Update all Vagrant VM host-only private network IP ranges. --- deployments-balancer/README.md | 14 +++++++------- deployments-balancer/Vagrantfile | 6 +++--- deployments-balancer/inventory | 6 +++--- deployments-balancer/playbooks/provision.yml | 8 ++++---- deployments-rolling/README.md | 2 +- deployments-rolling/Vagrantfile | 8 ++++---- deployments-rolling/inventory | 8 ++++---- deployments/README.md | 2 +- deployments/Vagrantfile | 2 +- deployments/playbooks/inventory-ansible | 2 +- docker-flask/README.md | 2 +- docker-flask/Vagrantfile | 2 +- drupal/README.md | 2 +- drupal/Vagrantfile | 2 +- dynamic-inventory/custom/README.md | 2 +- dynamic-inventory/custom/Vagrantfile | 4 ++-- dynamic-inventory/custom/inventory.php | 6 +++--- dynamic-inventory/custom/inventory.py | 6 +++--- elk/README.md | 4 ++-- elk/Vagrantfile | 4 ++-- elk/provisioning/elk/inventory | 2 +- elk/provisioning/web/inventory | 2 +- elk/provisioning/web/main.yml | 2 +- galaxy-role-servers/README.md | 2 +- galaxy-role-servers/Vagrantfile | 2 +- gluster/Vagrantfile | 4 ++-- gluster/inventory | 4 ++-- https-nginx-proxy/README.md | 2 +- https-nginx-proxy/Vagrantfile | 2 +- https-self-signed/README.md | 2 +- https-self-signed/Vagrantfile | 2 +- includes/README.md | 2 +- includes/Vagrantfile | 2 +- jenkins/README.md | 2 +- jenkins/Vagrantfile | 2 +- kubernetes/README.md | 2 +- kubernetes/Vagrantfile | 6 +++--- kubernetes/inventory | 6 +++--- kubernetes/vars/main.yml | 2 +- lamp-infrastructure/README.md | 10 +++++----- lamp-infrastructure/Vagrantfile | 12 ++++++------ lamp-infrastructure/inventories/vagrant/inventory | 14 +++++++------- nodejs-role/README.md | 2 +- nodejs-role/Vagrantfile | 2 +- nodejs/README.md | 2 +- nodejs/Vagrantfile | 2 +- orchestration/Vagrantfile | 6 +++--- orchestration/hosts.ini | 6 +++--- orchestration/scripts/db.sh | 2 +- solr/README.md | 2 +- solr/Vagrantfile | 2 +- 51 files changed, 102 insertions(+), 102 deletions(-) diff --git a/deployments-balancer/README.md b/deployments-balancer/README.md index 578c3aa4..5b1d01c9 100644 --- a/deployments-balancer/README.md +++ b/deployments-balancer/README.md @@ -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 @@ -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 diff --git a/deployments-balancer/Vagrantfile b/deployments-balancer/Vagrantfile index c7680ec7..dcbe0bf7 100644 --- a/deployments-balancer/Vagrantfile +++ b/deployments-balancer/Vagrantfile @@ -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. diff --git a/deployments-balancer/inventory b/deployments-balancer/inventory index 2b54a113..a7b7b578 100644 --- a/deployments-balancer/inventory +++ b/deployments-balancer/inventory @@ -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 diff --git a/deployments-balancer/playbooks/provision.yml b/deployments-balancer/playbooks/provision.yml index 1204bd21..2eb2c394 100644 --- a/deployments-balancer/playbooks/provision.yml +++ b/deployments-balancer/playbooks/provision.yml @@ -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 diff --git a/deployments-rolling/README.md b/deployments-rolling/README.md index 3bde3bfc..fb5f9b9a 100644 --- a/deployments-rolling/README.md +++ b/deployments-rolling/README.md @@ -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! diff --git a/deployments-rolling/Vagrantfile b/deployments-rolling/Vagrantfile index f839b43a..7579ba27 100644 --- a/deployments-rolling/Vagrantfile +++ b/deployments-rolling/Vagrantfile @@ -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. diff --git a/deployments-rolling/inventory b/deployments-rolling/inventory index ce01a401..c12e0039 100644 --- a/deployments-rolling/inventory +++ b/deployments-rolling/inventory @@ -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 diff --git a/deployments/README.md b/deployments/README.md index de85a29c..26e76c1b 100644 --- a/deployments/README.md +++ b/deployments/README.md @@ -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 diff --git a/deployments/Vagrantfile b/deployments/Vagrantfile index 534bdf5d..c3636b65 100644 --- a/deployments/Vagrantfile +++ b/deployments/Vagrantfile @@ -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" diff --git a/deployments/playbooks/inventory-ansible b/deployments/playbooks/inventory-ansible index fb6fa6c1..3748af87 100644 --- a/deployments/playbooks/inventory-ansible +++ b/deployments/playbooks/inventory-ansible @@ -1,5 +1,5 @@ [rails] -192.168.33.7 +192.168.56.7 [rails:vars] ansible_user=vagrant diff --git a/docker-flask/README.md b/docker-flask/README.md index 722773b5..15b361c1 100644 --- a/docker-flask/README.md +++ b/docker-flask/README.md @@ -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. diff --git a/docker-flask/Vagrantfile b/docker-flask/Vagrantfile index af7dcdde..2ee437fd 100644 --- a/docker-flask/Vagrantfile +++ b/docker-flask/Vagrantfile @@ -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" diff --git a/drupal/README.md b/drupal/README.md index 4edf0151..ec992c38 100644 --- a/drupal/README.md +++ b/drupal/README.md @@ -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 diff --git a/drupal/Vagrantfile b/drupal/Vagrantfile index fcedef8e..36b295e6 100644 --- a/drupal/Vagrantfile +++ b/drupal/Vagrantfile @@ -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 diff --git a/dynamic-inventory/custom/README.md b/dynamic-inventory/custom/README.md index c5232138..e72d4139 100644 --- a/dynamic-inventory/custom/README.md +++ b/dynamic-inventory/custom/README.md @@ -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: diff --git a/dynamic-inventory/custom/Vagrantfile b/dynamic-inventory/custom/Vagrantfile index c58ccd8f..2f2a4cf0 100644 --- a/dynamic-inventory/custom/Vagrantfile +++ b/dynamic-inventory/custom/Vagrantfile @@ -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 diff --git a/dynamic-inventory/custom/inventory.php b/dynamic-inventory/custom/inventory.php index 03237ea9..20e17d6b 100755 --- a/dynamic-inventory/custom/inventory.php +++ b/dynamic-inventory/custom/inventory.php @@ -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', @@ -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', ], ], diff --git a/dynamic-inventory/custom/inventory.py b/dynamic-inventory/custom/inventory.py index 7ec38b22..1257124d 100755 --- a/dynamic-inventory/custom/inventory.py +++ b/dynamic-inventory/custom/inventory.py @@ -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': @@ -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' } } diff --git a/elk/README.md b/elk/README.md index edc32863..09248c30 100644 --- a/elk/README.md +++ b/elk/README.md @@ -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`). diff --git a/elk/Vagrantfile b/elk/Vagrantfile index 41f5c67e..0955d5c0 100644 --- a/elk/Vagrantfile +++ b/elk/Vagrantfile @@ -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" @@ -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 diff --git a/elk/provisioning/elk/inventory b/elk/provisioning/elk/inventory index b9c56dfe..d740f922 100644 --- a/elk/provisioning/elk/inventory +++ b/elk/provisioning/elk/inventory @@ -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 diff --git a/elk/provisioning/web/inventory b/elk/provisioning/web/inventory index 72686c7c..d255ffd4 100644 --- a/elk/provisioning/web/inventory +++ b/elk/provisioning/web/inventory @@ -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 diff --git a/elk/provisioning/web/main.yml b/elk/provisioning/web/main.yml index eac09a2a..07b884e1 100644 --- a/elk/provisioning/web/main.yml +++ b/elk/provisioning/web/main.yml @@ -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 diff --git a/galaxy-role-servers/README.md b/galaxy-role-servers/README.md index 5905c9d5..fbf5c1bb 100644 --- a/galaxy-role-servers/README.md +++ b/galaxy-role-servers/README.md @@ -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/). diff --git a/galaxy-role-servers/Vagrantfile b/galaxy-role-servers/Vagrantfile index cdca2e8c..40d1986f 100644 --- a/galaxy-role-servers/Vagrantfile +++ b/galaxy-role-servers/Vagrantfile @@ -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 diff --git a/gluster/Vagrantfile b/gluster/Vagrantfile index 3fb778d2..ee42fc60 100644 --- a/gluster/Vagrantfile +++ b/gluster/Vagrantfile @@ -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. diff --git a/gluster/inventory b/gluster/inventory index dae8cbde..2f9fc022 100644 --- a/gluster/inventory +++ b/gluster/inventory @@ -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 diff --git a/https-nginx-proxy/README.md b/https-nginx-proxy/README.md index e25a2ea1..cdfc57e5 100644 --- a/https-nginx-proxy/README.md +++ b/https-nginx-proxy/README.md @@ -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 diff --git a/https-nginx-proxy/Vagrantfile b/https-nginx-proxy/Vagrantfile index 091b1682..148fa476 100644 --- a/https-nginx-proxy/Vagrantfile +++ b/https-nginx-proxy/Vagrantfile @@ -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| diff --git a/https-self-signed/README.md b/https-self-signed/README.md index a046e2a7..daef70f8 100644 --- a/https-self-signed/README.md +++ b/https-self-signed/README.md @@ -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 diff --git a/https-self-signed/Vagrantfile b/https-self-signed/Vagrantfile index 370bcd30..3f00a4d5 100644 --- a/https-self-signed/Vagrantfile +++ b/https-self-signed/Vagrantfile @@ -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| diff --git a/includes/README.md b/includes/README.md index 5fd4e5aa..f84a8be0 100644 --- a/includes/README.md +++ b/includes/README.md @@ -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 diff --git a/includes/Vagrantfile b/includes/Vagrantfile index b0e54384..d8e28738 100644 --- a/includes/Vagrantfile +++ b/includes/Vagrantfile @@ -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 diff --git a/jenkins/README.md b/jenkins/README.md index 80b39913..a6c1f09e 100644 --- a/jenkins/README.md +++ b/jenkins/README.md @@ -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 diff --git a/jenkins/Vagrantfile b/jenkins/Vagrantfile index b9882e8b..d4fb513f 100644 --- a/jenkins/Vagrantfile +++ b/jenkins/Vagrantfile @@ -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| diff --git a/kubernetes/README.md b/kubernetes/README.md index beaca696..56abf9fb 100644 --- a/kubernetes/README.md +++ b/kubernetes/README.md @@ -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.84.3 cluster.k8s.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.3 cluster.k8s.test` so you can connect to the VM. ### 4 - Deploy applications to the Kubernetes cluster diff --git a/kubernetes/Vagrantfile b/kubernetes/Vagrantfile index bafa3d0d..0120b0c3 100644 --- a/kubernetes/Vagrantfile +++ b/kubernetes/Vagrantfile @@ -16,9 +16,9 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # Define three VMs with static private IP addresses. boxes = [ - { :name => "master", :ip => "192.168.84.2" }, - { :name => "node1", :ip => "192.168.84.3" }, - { :name => "node2", :ip => "192.168.84.4" }, + { :name => "master", :ip => "192.168.56.2" }, + { :name => "node1", :ip => "192.168.56.3" }, + { :name => "node2", :ip => "192.168.56.4" }, ] # Provision each of the VMs. diff --git a/kubernetes/inventory b/kubernetes/inventory index 23739737..a1ffeec9 100644 --- a/kubernetes/inventory +++ b/kubernetes/inventory @@ -1,9 +1,9 @@ [k8s-master] -master ansible_host=192.168.84.2 kubernetes_role=master +master ansible_host=192.168.56.2 kubernetes_role=master [k8s-nodes] -node1 ansible_host=192.168.84.3 kubernetes_role=node -node2 ansible_host=192.168.84.4 kubernetes_role=node +node1 ansible_host=192.168.56.3 kubernetes_role=node +node2 ansible_host=192.168.56.4 kubernetes_role=node [k8s:children] k8s-master diff --git a/kubernetes/vars/main.yml b/kubernetes/vars/main.yml index 3369a8c9..9648a138 100644 --- a/kubernetes/vars/main.yml +++ b/kubernetes/vars/main.yml @@ -18,6 +18,6 @@ kubernetes_packages: - name: kubernetes-cni state: present -kubernetes_apiserver_advertise_address: "192.168.84.2" +kubernetes_apiserver_advertise_address: "192.168.56.2" kubernetes_flannel_manifest_file: "~/kube-flannel-vagrant.yml" kubernetes_kubelet_extra_args: '--node-ip={{ ansible_host }}' diff --git a/lamp-infrastructure/README.md b/lamp-infrastructure/README.md index 55cd72a5..e87bda72 100644 --- a/lamp-infrastructure/README.md +++ b/lamp-infrastructure/README.md @@ -6,22 +6,22 @@ The architecture for the example web application will be: -------------------------- | varnish.test (Varnish) | - | 192.168.2.2 | + | 192.168.56.2 | -------------------------- / \ ---------------------- ---------------------- | www1.test (Apache) | | www2.test (Apache) | - | 192.168.2.3 | | 192.168.2.4 | + | 192.168.56.3 | | 192.168.56.4 | ---------------------- ---------------------- \ / ------------------------------ | memcached.test (Memcached) | - | 192.168.2.7 | + | 192.168.56.7 | ------------------------------ / \ ----------------------------- ---------------------------- | db1.test (MySQL - Master) | | db2.test (MySQL - Slave) | - | 192.168.2.5 | | 192.168.2.6 | + | 192.168.56.5 | | 192.168.56.6 | ----------------------------- ---------------------------- *IP addresses and hostnames in this diagram are modeled after local VirtualBox/Vagrant-based VMs.* @@ -47,7 +47,7 @@ To build the VMs and configure them using Ansible, follow these steps (both from This guide assumes you already have Vagrant, VirtualBox, and Ansible installed locally. -After everything is booted and configured, visit http://varnish.test/ (if you configured the domain in your hosts file with the line `192.168.2.2 varnish.test`) in a browser, and refresh a few times to see that Varnish, Apache, PHP, Memcached, and MySQL are all working properly! +After everything is booted and configured, visit http://varnish.test/ (if you configured the domain in your hosts file with the line `192.168.56.2 varnish.test`) in a browser, and refresh a few times to see that Varnish, Apache, PHP, Memcached, and MySQL are all working properly! ## Build and configure the servers (DigitalOcean) diff --git a/lamp-infrastructure/Vagrantfile b/lamp-infrastructure/Vagrantfile index 9bd629fe..1383a0b2 100644 --- a/lamp-infrastructure/Vagrantfile +++ b/lamp-infrastructure/Vagrantfile @@ -19,13 +19,13 @@ Vagrant.configure("2") do |config| # Varnish. config.vm.define "varnish" do |varnish| varnish.vm.hostname = "varnish.test" - varnish.vm.network :private_network, ip: "192.168.2.2" + varnish.vm.network :private_network, ip: "192.168.56.2" end # Apache. config.vm.define "www1" do |www1| www1.vm.hostname = "www1.test" - www1.vm.network :private_network, ip: "192.168.2.3" + www1.vm.network :private_network, ip: "192.168.56.3" www1.vm.provision "shell", inline: "sudo yum update -y" @@ -38,7 +38,7 @@ Vagrant.configure("2") do |config| # Apache. config.vm.define "www2" do |www2| www2.vm.hostname = "www2.test" - www2.vm.network :private_network, ip: "192.168.2.4" + www2.vm.network :private_network, ip: "192.168.56.4" www2.vm.provision "shell", inline: "sudo yum update -y" @@ -51,19 +51,19 @@ Vagrant.configure("2") do |config| # MySQL. config.vm.define "db1" do |db1| db1.vm.hostname = "db1.test" - db1.vm.network :private_network, ip: "192.168.2.5" + db1.vm.network :private_network, ip: "192.168.56.5" end # MySQL. config.vm.define "db2" do |db2| db2.vm.hostname = "db2.test" - db2.vm.network :private_network, ip: "192.168.2.6" + db2.vm.network :private_network, ip: "192.168.56.6" end # Memcached. config.vm.define "memcached" do |memcached| memcached.vm.hostname = "memcached.test" - memcached.vm.network :private_network, ip: "192.168.2.7" + memcached.vm.network :private_network, ip: "192.168.56.7" # Run Ansible provisioner once for all VMs at the end. memcached.vm.provision "ansible" do |ansible| diff --git a/lamp-infrastructure/inventories/vagrant/inventory b/lamp-infrastructure/inventories/vagrant/inventory index 32acd461..c5fc7a6f 100644 --- a/lamp-infrastructure/inventories/vagrant/inventory +++ b/lamp-infrastructure/inventories/vagrant/inventory @@ -1,16 +1,16 @@ [lamp_varnish] -192.168.2.2 +192.168.56.2 [lamp_www] -192.168.2.3 -192.168.2.4 +192.168.56.3 +192.168.56.4 [a4d.lamp.db.1] -192.168.2.5 +192.168.56.5 [lamp_db] -192.168.2.5 mysql_replication_role=master -192.168.2.6 mysql_replication_role=slave +192.168.56.5 mysql_replication_role=master +192.168.56.6 mysql_replication_role=slave [lamp_memcached] -192.168.2.7 +192.168.56.7 diff --git a/nodejs-role/README.md b/nodejs-role/README.md index 49c04cc7..c53d122a 100644 --- a/nodejs-role/README.md +++ b/nodejs-role/README.md @@ -6,7 +6,7 @@ The primary difference in this example (as explained in [Ansible for DevOps](htt After running `vagrant up`, perform the following steps to access the app via a hostname: - 1. [Edit your hosts file](http://docs.rackspace.com/support/how-to/modify-your-hosts-file/), adding the line `192.168.55.56 nodejs-role.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.56 nodejs-role.test` so you can connect to the VM. 2. Open your browser and access [http://nodejs-role.test/](http://nodejs-role.test/). ## About the Author diff --git a/nodejs-role/Vagrantfile b/nodejs-role/Vagrantfile index 700492fb..19c1cd25 100644 --- a/nodejs-role/Vagrantfile +++ b/nodejs-role/Vagrantfile @@ -5,7 +5,7 @@ VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.box = "geerlingguy/rockylinux8" - config.vm.network :private_network, ip: "192.168.55.56" + config.vm.network :private_network, ip: "192.168.56.56" config.ssh.insert_key = false config.vm.synced_folder ".", "/vagrant", disabled: true diff --git a/nodejs/README.md b/nodejs/README.md index c84652b7..e2869abe 100644 --- a/nodejs/README.md +++ b/nodejs/README.md @@ -30,7 +30,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.55.55 nodejs.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.55 nodejs.test` so you can connect to the VM. 2. Open your browser and access [http://nodejs.test/](http://nodejs.test/). ## Notes diff --git a/nodejs/Vagrantfile b/nodejs/Vagrantfile index b6984e8e..4a9d3392 100644 --- a/nodejs/Vagrantfile +++ b/nodejs/Vagrantfile @@ -6,7 +6,7 @@ VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.box = "geerlingguy/rockylinux8" config.vm.hostname = "nodejs.test" - config.vm.network :private_network, ip: "192.168.55.55" + config.vm.network :private_network, ip: "192.168.56.55" config.ssh.insert_key = false config.vm.synced_folder ".", "/vagrant", disabled: true diff --git a/orchestration/Vagrantfile b/orchestration/Vagrantfile index 82581658..db8fc28a 100644 --- a/orchestration/Vagrantfile +++ b/orchestration/Vagrantfile @@ -16,18 +16,18 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # Application server 1. config.vm.define "app1" do |app| app.vm.hostname = "orc-app1.test" - app.vm.network :private_network, ip: "192.168.60.4" + app.vm.network :private_network, ip: "192.168.56.4" end # Application server 2. config.vm.define "app2" do |app| app.vm.hostname = "orc-app2.test" - app.vm.network :private_network, ip: "192.168.60.5" + app.vm.network :private_network, ip: "192.168.56.5" end # Database server. config.vm.define "db" do |db| db.vm.hostname = "orc-db.test" - db.vm.network :private_network, ip: "192.168.60.6" + db.vm.network :private_network, ip: "192.168.56.6" end end diff --git a/orchestration/hosts.ini b/orchestration/hosts.ini index 03b5f149..b836c499 100644 --- a/orchestration/hosts.ini +++ b/orchestration/hosts.ini @@ -1,11 +1,11 @@ # Application servers [app] -192.168.60.4 -192.168.60.5 +192.168.56.4 +192.168.56.5 # Database server [db] -192.168.60.6 +192.168.56.6 # Group 'multi' with all servers [multi:children] diff --git a/orchestration/scripts/db.sh b/orchestration/scripts/db.sh index 1d86eb2a..9508cac4 100755 --- a/orchestration/scripts/db.sh +++ b/orchestration/scripts/db.sh @@ -11,7 +11,7 @@ ansible db -b -m service -a "name=mariadb state=started enabled=yes" ansible db -b -m dnf -a "name=firewalld state=present" ansible db -b -m service -a "name=firewalld state=started enabled=yes" ansible db -b -m firewalld -a "zone=database state=present permanent=yes" -ansible db -b -m firewalld -a "source=192.168.60.0/24 zone=database state=enabled permanent=yes" +ansible db -b -m firewalld -a "source=192.168.56.0/24 zone=database state=enabled permanent=yes" ansible db -b -m firewalld -a "port=3306/tcp zone=database state=enabled permanent=yes" # Configure DB user for Django. diff --git a/solr/README.md b/solr/README.md index 1e10581d..e196d52a 100644 --- a/solr/README.md +++ b/solr/README.md @@ -29,7 +29,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.66.66 solr.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.66 solr.test` so you can connect to the VM. 2. Open your browser and access [http://solr.test:8983/solr/](http://solr.test:8983/solr). ## Notes diff --git a/solr/Vagrantfile b/solr/Vagrantfile index d01fe05f..0374e72b 100644 --- a/solr/Vagrantfile +++ b/solr/Vagrantfile @@ -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.66.66" + config.vm.network :private_network, ip: "192.168.56.66" config.vm.hostname = "solr.test" config.ssh.insert_key = false