\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Mary F. Smith (boogie)} \pdfinfo{ /Title (create-a-vagrantfile.pdf) /Creator (Cheatography) /Author (Mary F. Smith (boogie)) /Subject (Create a Vagrantfile Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{106DA3} \definecolor{LightBackground}{HTML}{F0F5F9} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Create a Vagrantfile Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Mary F. Smith (boogie)} via \textcolor{DarkBackground}{\uline{cheatography.com/86236/cs/36474/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Mary F. Smith (boogie) \\ \uline{cheatography.com/boogie} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Not Yet Published.\\ Updated 24th January, 2023.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{2} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Creating the Vagrantfile}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{\{\{ac\}\}{\bf{{[}-{}-{}- indicate Indent Spaces{]}}}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{\# -{\emph{- mode: ruby -}}-} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{\# vi: set ft=ruby :} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{Vagrant.configure("2") do |config|} \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{-{}-{}- config.vm.box = "hashicorp/bionic64"} \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{-{}-{}- config.vm.provider "virtualbox"} \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{-{}-{}-{}-{}-{}-{}-vb.memory = 2048 {[}optional{]}} \tn % Row Count 7 (+ 1) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{-{}-{}-{}-{}-{}-{}-vb.cpus = 1 {[}optional{]}} \tn % Row Count 8 (+ 1) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{-{}-{}- config.vm.provision :shell, path: "bootstrap.sh"} \tn % Row Count 10 (+ 2) % Row 9 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{end} \tn % Row Count 11 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Optional Commands to Add Into Vagrantfile}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{-{}-{}-\# \seqsplit{config.vm.box\_check\_update} = false} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} -{}-{}-\# config.vm.network "forwarded\_port", guest: 80, host: 8080 & \# NOTE: This will enable public access to the opened port \tn % Row Count 5 (+ 4) % Row 2 \SetRowColor{LightBackground} -{}-{}-\# config.vm.network "forwarded\_port", guest: 80, host: 8080, host\_ip: "127.0.0.1" & \# via 127.0.0.1 to disable public access \tn % Row Count 10 (+ 5) % Row 3 \SetRowColor{white} \mymulticolumn{2}{x{8.4cm}}{-{}-{}-\# config.vm.network "private\_network", ip: "192.168.33.10"} \tn % Row Count 12 (+ 2) % Row 4 \SetRowColor{LightBackground} -{}-{}-\# config.vm.network "public\_network" & {\bf{more info needed}} \tn % Row Count 14 (+ 2) % Row 5 \SetRowColor{white} -{}-{}-\# \seqsplit{config.vm.synced\_folder} "../data", "/vagrant\_data" & \# Synced Folder \tn % Row Count 17 (+ 3) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{\{\{ac\}\} {\bf{OR}}} \tn % Row Count 18 (+ 1) % Row 7 \SetRowColor{white} \mymulticolumn{2}{x{8.4cm}}{-{}-{}-\#config.vm.synced\_folder "/host/path", "/guest/path"} \tn % Row Count 20 (+ 2) % Row 8 \SetRowColor{LightBackground} {\bf{-{}-{}-\#config.vm.synced\_folder '.', '/vagrant', disabled: true}} & \#Disables Folder Sharing \tn % Row Count 24 (+ 4) % Row 9 \SetRowColor{white} -{}-{}-\#config.vm.hostname = \seqsplit{"myhost.ostechnix.example"} & \# Hostname \tn % Row Count 27 (+ 3) % Row 10 \SetRowColor{LightBackground} -{}-{}-{}-{}-{}-{}-\#vb.gui = true & \# Display the VirtualBox GUI when booting the machine \tn % Row Count 30 (+ 3) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Optional Commands to Add Into Vagrantfile (cont)}} \tn % Row 11 \SetRowColor{LightBackground} -{}-{}-{}-{}-{}-{}-\#vb.memory = "1024" & \# Customize the amount of memory on the VM: \tn % Row Count 3 (+ 3) % Row 12 \SetRowColor{white} -{}-{}-{}-{}-{}-{}-\#vb.gui = true & \# Headless vs. Non-Headless \tn % Row Count 5 (+ 2) % Row 13 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{\#\# cp ./files/my.cnf /etc/mysql/conf.d/} \tn % Row Count 6 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{p{0.8 cm} p{0.8 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Provisioning within a VM}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{-{}-{}- config.vm.provision "shell", inline: \textless{}\textless{}-SHELL} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{8.4cm}}{-{}-{}-{}-{}-{}-{}-apt-get update} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{-{}-{}-{}-{}-{}-{}-apt-get install -y apache2} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{2}{x{8.4cm}}{-{}-{}-{}-{}-{}-{}-service apache2 start} \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{-{}-{}-{}-- SHELL} \tn % Row Count 5 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Provisioning}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{\#!/bin/bash} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{apt-get update} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{apt-get install -y} \tn % Row Count 3 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Option \#1 Multiple Machines Utilizing a Loop}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{} \tn % Row Count 0 (+ 0) \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Vagrant.configure("2") do |config| \newline \newline (2..4).each do |i| \newline config.vm.define "vm-\#\{i\}" do |web| \newline web.vm.box = "ubuntu/trusty64" \newline web.vm.network "private\_network", ip: "192.168.33.\#\{i\}", auto\_config: false \newline web.vm.provision "shell", inline: "echo hello \#\{i\}" \newline web.vm.synced\_folder "code/", "/app/code" \newline end \newline end \newline end} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{p{0.8 cm} p{0.8 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Option \#2.0 Multi-Machine w/ Private Network}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{} \tn % Row Count 0 (+ 0) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{\# -{\emph{- mode: ruby -}}- \newline \# vi: set ft=ruby : \newline \newline \# Every Vagrant development environment requires a box. You can search for \newline \# boxes at \seqsplit{https://atlas.hashicorp.com/search.} \newline BOX\_IMAGE = "bento/ubuntu-16.04" \newline NODE\_COUNT = 3 \newline \newline \newline Vagrant.configure("2") do |config| \newline -{}-{}-{}-config.vm.define "Ansible" do |subconfig| \newline -{}-{}-{}-{}-{}-{}-subconfig.vm.box = "ansible/tower" \newline -{}-{}-{}-{}-{}-{}-subconfig.vm.hostname="ansible" \newline -{}-{}-{}-{}-{}-{}-subconfig.vm.network :private\_network, ip:"10.10.2.5" \newline -{}-{}-{}-end} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{p{0.8 cm} p{0.8 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{{\bf{Option 2.1 -{}- Continued From Above -{}-}}}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{} \tn % Row Count 0 (+ 0) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{-{}-config.vm.define "node-01" do |subconfig| \newline -{}-{}-{}-{}-{}-subconfig.vm.box = "generic/debian10" \newline -{}-{}-{}-{}-{}-subconfig.vm.hostname="node-01" \newline -{}-{}-{}-{}-{}-subconfig.vm.network :private\_network, ip:"10.10.2.11" \newline -{}-end \newline \newline -{}-config.vm.define "node2" do |subconfig| \newline -{}-{}-{}--subconfig.vm.box = "generic/debian10" \newline -{}-{}-{}--subconfig.vm.hostname="node-02" \newline -{}-{}-{}--subconfig.vm.network :private\_network, ip:"10.10.2.12" \newline -{}-end \newline end} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{p{0.8 cm} p{0.8 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{{\bf{Option \#2.2 -{}- Continued From Above -{}-}}}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{} \tn % Row Count 0 (+ 0) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{\# Install avahi on all machines \newline -{}-config.vm.provision "shell", inline: \textless{}\textless{}-SHELL \newline apt-get install -y avahi-daemon libnss-mdns \newline SHELL \newline end} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Networking}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{\{\{ac\}\}{\bf{{[}-{}-{}-{}-- indicate Indent Spaces{]}}}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{{\bf{Port Forwarding}}} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{-{}-{}-\#config.vm.network "forwarded\_port", guest: 80, host: 8080} \tn % Row Count 4 (+ 2) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{end} \tn % Row Count 5 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{-{}-{}-\#config.vm.network "forwarded\_port", guest: 80, host: 8080, auto\_correct: true} \tn % Row Count 7 (+ 2) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{-{}-{}-\#config.vm.usable\_port\_range = (2200..2250)} \tn % Row Count 8 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{{\bf{Change Network Protocol}}} \tn % Row Count 9 (+ 1) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{-{}-{}-\#config.vm.network "forwarded\_port", guest: 80, host: 8080, auto\_correct: true protocol: "udp"} \tn % Row Count 11 (+ 2) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{{\bf{Set-up Private Network}}} \tn % Row Count 12 (+ 1) % Row 9 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{-{}-{}-\#config.vm.network "private\_network", ip: "192.168.121.60"} \tn % Row Count 14 (+ 2) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{-{}-{}-\#config.vm.network "private\_network", type: "dhcp"} \tn % Row Count 16 (+ 2) % Row 11 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{-{}-{}-\#config.vm.network "public\_network"} \tn % Row Count 17 (+ 1) % Row 12 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{-{}-{}-\#config.vm.network "public\_network", ip: "192.168.121.61"} \tn % Row Count 19 (+ 2) % Row 13 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{{\bf{Setup Private Named Network}}} \tn % Row Count 20 (+ 1) % Row 14 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{-{}-{}-\#config.vm.network 'private\_network', name: 'example', type: 'dhcp'} \tn % Row Count 22 (+ 2) % Row 15 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{-{}-{}-\#config.vm.network 'private\_network', name: 'example', ip: '111.222.111.222'} \tn % Row Count 24 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Bridged Network}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{-{}-{}-\#config.vm.network "bridged"} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{**1 VM w/ Multitple Networks} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{-{}-{}-\#config.vm.forwarded\_port 80, 8080} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{-{}-{}-\#config.vm.network "hostonly", "192.168.33.10"} \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{-{}-{}-\#config.vm.network "bridged"} \tn % Row Count 5 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{1 VM w/ Multiple Network Options}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{{\bf{1 VM w/ Multiple Network Options}}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{-{}-{}-\#config.vm.hostname = \seqsplit{"myhost.ostechnix.example"}} \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{-{}-{}-\#config.vm.network "forwarded\_port", guest: 80, host: 8080, auto\_correct: true} \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{-{}-{}-\#config.vm.network "private\_network", ip: "192.168.121.60"} \tn % Row Count 7 (+ 2) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{{\bf{1 VM w/ Multiple IP Address}}} \tn % Row Count 8 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{-{}-{}-\#config.vm.network "private\_network", ip: "192.168.121.60"} \tn % Row Count 10 (+ 2) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{-{}-{}-\#config.vm.network "private\_network", ip: "192.168.121.61"} \tn % Row Count 12 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{One VM | CentOs | 512 RAM | 1 CPU | Private IP}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{} \tn % Row Count 0 (+ 0) \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Vagrant.configure("2") do |config| \newline \newline config.vm.box = "bento/centos-7.2" \newline \newline config.vm.provider :virtualbox do |vb| \newline vb.memory = 512 \newline vb.cpus = 1 \newline end \newline \newline config.vm.define "srv-1" do |config| \newline config.vm.provision :shell, :inline =\textgreater{} "ip addr | grep \textbackslash{}"inet\textbackslash{}" | awk '\{print \$2\}'" \newline config.vm.network "private\_network", ip: "192.168.50.11", virtualbox\_\_intnet: "true" \newline end \newline end} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Provisioning with Ansible}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Vagrant.configure("2") do |config|} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{-{}- ...} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{-{}-{}- config.vm.provision "ansible" do |ansible|} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{-{}-{}-{}-- ansible.playbook = "vagrant.yml"} \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{-{}-{}-end} \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{end} \tn % Row Count 6 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{p{0.8 cm} p{0.8 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{-{}-Continuation from Above-{}-}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{} \tn % Row Count 0 (+ 0) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{config.vm.define "db" do |db| \newline db.vm.box = "ubuntu/trusty64" \newline db.vm.network "private\_network", ip: "192.168.33.30" \newline db.vm.synced\_folder "data/", "/db/data" \newline db.vm.provider "virtualbox" do |vb| \newline vb.memory = 2048 \newline vb.cpus = 1 \newline end \newline end \newline end} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{p{0.8 cm} p{0.8 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Multiple VMs within One Vagrantfile}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{} \tn % Row Count 0 (+ 0) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{Vagrant.configure("2") do |config| \newline config.vm.provision "shell", inline: "echo Hello" \newline \newline config.vm.define "web" do |web| \newline web.vm.box = "ubuntu/trusty64" \newline web.vm.network "private\_network", ip: "192.168.33.20" \newline web.vm.synced\_folder "code/", "/app/code" \newline web.vm.provider "virtualbox" do |vb| \newline vb.memory = 1048 \newline vb.cpus = 1 \newline end \newline end} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{p{0.8 cm} p{0.8 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Thank You -}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{} \tn % Row Count 0 (+ 0) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{`{\bf{Thank you \seqsplit{https://subscription.packtpub}.com/book/virtualization-\&-cloud/9781786464910/1/ch01lvl1sec20/simulating-dynamic-multiple-host-networking}}` \newline \newline `{\bf{Thank you}} \seqsplit{https://devopscube.com/vagrant-tutorial-beginners/`} \newline \newline `{\bf{Thank you}} \seqsplit{https://ostechnix.com/how-to-configure-networking-in-vagrant/`}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}