Vagrant based provisioning to quickly get a firewall router virtual machine
Switch branches/tags
Nothing to show
Clone or download
flavio-fernandes Fix provision issue related to a stale and abandoned puppet module
So old it is broken: puppet module install puppetlabs/vcsrepo

Also moved to a newer base Centos box: bento/centos-6.7

Those purpleidea puppet modules were written in 2.x days and probably
also worked on 3.x but unlikely for 4.x without patches!

Issue looks like this:
https://gist.github.com/37e5329b5529947606ea4d5d68ed38f1

==> router-node: Running Puppet with base1.pp...
==> router-node: Error loading fact /etc/puppet/modules/stdlib/lib/facter/service_provider.rb: /etc/puppet/modules/stdlib/lib/facter/service_provider.rb:15: syntax error, unexpected ':', expecting ')'
==> router-node: ...ype(:service).newservice(name: 'dummy')[:provider].to_s
==> router-node:                               ^
==> router-node: /etc/puppet/modules/stdlib/lib/facter/service_provider.rb:15: syntax error, unexpected ')', expecting kEND
==> router-node: ...ice).newservice(name: 'dummy')[:provider].to_s
==> router-node:                               ^
==> router-node: Error loading fact /etc/puppet/modules/stdlib/lib/facter/pe_version.rb: /etc/puppet/modules/stdlib/lib/facter/pe_version.rb:34: syntax error, unexpected ':', expecting kEND
==> router-node:   confine is_pe: true
Latest commit c06f2b3 Dec 2, 2017

README.md

ROUTER-NODE

This repo provides a Vagrantfile with provisioning that one can use to quickly get simple vm that routes from a private network using nat.

  |------ NAT Network -------|
                 |
                 | Dynamic ip
                 | 
        -----------------
        | This Router VM |
        -----------------
           |   |   | Static ip ${node_ex_ip}, [DHCPd], [DNSd]
           |   |   |
           |   |   |
  |------ Internal Network3 -------|
  vm.network "private_network", type: "dhcp", virtualbox__intnet: "mylocalnet3"
               |   |
  |------ Internal Network2 -------|
  vm.network "private_network", type: "dhcp", virtualbox__intnet: "mylocalnet2"
                   |
  |------ Internal Network --------|
  Connect vms to this net, so they can talk to each
  other and share a dynamic link via nat. To do that, use
  vm.network "private_network", type: "dhcp", virtualbox__intnet: "mylocalnet"

##Pre-requisites:

Vagrant

Vagrant Reload Provisioner

As part of the provisioning, the vm is expected to be rebooted. In order to accomplish that, we use the vagrant's reload plugin. Install this by issuing the following command:

$ vagrant plugin install vagrant-reload

Configuration knobs

If you need to tweak the default values, these are the files that you will need to look at:

  • Vagrantfile

    • node_ex_ip: this is the static ip address assigned to the router interface in the internal network
    • node.vm.network: this is the internal only network that your clients should use in order to reach the router's interface
  • puppet/hieradata/* : The json files in this directory contain the values used for dhcpd and dns services.

  • Standard Centos 6 distro of dhcp/bind/iptables: with a few online searches you can figure all of them out. :)