Giter VIP home page Giter VIP logo

pe-razor-vagrant-stack's Introduction

How to Use This Stack

  1. Install VirtualBox
  • I've successfully used 4.2.22, 4.3.8, 4.3.12, 4.3.18, 6.0.8
  1. Install VirtualBox Extension Pack
  • This is necessary to be able to PXE boot a VM without a iso file or using the default Intel network adapter
  • I had sucess on VBox 4.2.22 using the PCnet-FAST III (Am79C973) adapter without the extension pack but others reported issues to me
  1. Install Vagrant
  • Version 1.8+ is required (2.2.4 also works).
  1. vagrant plugin install oscar
  2. vagrant up
  • Optional: vagrant snapshot save
  1. You can ssh into any of the boxes with vagrant ssh <box_name>
  1. Create VMs in virtual box to PXE boot
  • Import the VM definition I created and placed in example_pxe_boot_vm
  1. Start your new box and it will PXE boot and receive an image from the dhcp server.
  • From there it will be handed off to the razor server.
  • Razor will not provision the box until you setup a policy to do so
  • Expect the box to load a microkernel and just sit there wating for razor to instruct it.
  1. The razor client is installed on the razor.server. You can use the client to create a policy.
  2. If you would like to connect to the puppet enterprise console you can connect from your machine at https://192.168.51.22.
  • The username is admin and the password is puppetlabs
  1. If you would like to connect to the Razor Server, including its API, you can connect from your machine at e.g. https://192.168.51.12:8151/api.

Creating a VM for PXE booting with Razor

If for some reason you don't want to use the VM definition in example_pxe_boot_vm then here are some notes of issues you might run into and how to avoid them.

  • Create a VM with at least 2048MB of RAM.
    • I tried 256MB and it froze during the PXE boot process
  • Under system: Add Network to be enabled in the Boot Order.
    • It must be first in the Boot Order list for reboot and reinstall to work properly.
  • Under system -> extended features: disable "Enable I/O APIC
    • I'm not sure why but if you don't the disable this you will get an error after razor tells the server with OS to install and reboots the server you will get an error like "FATAL: INT18: BOOT FAILURE"
  • Under Network:
    • Attach it to Internal Network called Razor_Network. This is the network the other 3 boxes are on
    • If you run into issues with the download of the microkernel freezing during the download:
      • Make sure you've installed the virtualbox extension pack
      • You can also try changing to a different network adapter

Networking Notes

If you run into any DNS issues then there's a few things to know. The puppet.master, razor.server, and dhcp.server all have static ip addresses assigned from the vagrant configuration. They resolve each other via /etc/hosts. However, any new boxes you create to PXE boot will automatically get an ip from the dhcp.server and will resolve the razor.server via DNS that is setup on the dhcp.server.

Wondering how the PXE booted box is able to connect to the internet? The DHCP server is also acting like a router and forwarding ipv4 traffic to the internet from the PXE booted boxes.

Stack Boot Time

Total Stack Boot Time (timed on my laptop with SSD)

  1. puppet.master 10 mins
  2. razor.server 15 mins
  3. dhcp.server 7 mins

Development Workflow

If you'd like to test out various tasks, hooks, brokers, or lib code, place a development version of razor-server in the home directory of this repo. When the Vagrant instance spins up, any of those four directories (tasks, hooks, brokers, or lib) will be symlinked into the live Razor instance. Any changes made in that directory will be reflected in the Razor instance immediately. Note however that the lib directory will require a service restart of pe-razor-server.

pe-razor-vagrant-stack's People

Contributors

lucywyman avatar npwalker avatar smcclellan avatar speedofdark avatar suckatrash avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pe-razor-vagrant-stack's Issues

Changing the undionly.kpxe and bootstrap.ipxe

Hi Nick,

I made my own undionly.kpxe with my menu.ipxe embedded. Do I have to reconfigure the classes
to reflect those changes ? Howto proceed ?

Kind regards,
Bas

Configuring Classes

Some classes can be assigned with no configuration, but many classes can (or must) be configured to change their behavior. This gives a class the flexibility to meet different needs for different nodes and different infrastructures.

There are two main ways to configure classes in Puppet: using class parameters and/or top-scope variables. Each module’s author dictates which method to use; see the documentation of the classes you are using for local details.

default user password for the console?

Hi,

first thanks for this setup! I'm considering using Razor for bare-metal provisioning and having vagrant conf to try it out is very helpful.

Could you provide more details on default credentials for the boxes and PE console?

Thanks,
Igor

[Error]: Failed to apply catalog: Could not connect to the Node Manager service

I am getting below error when i try to bring up the puppet-master, could you pls let me know how to fix this?

2016-10-20 17:59:22,454 - [Notice]: /Stage[main]/Puppet_enterprise::Console_services/Service[pe-console-services]/ensure: ensure changed 'stopped' to 'running'
2016-10-20 17:59:22,883 - [Error]: Failed to apply catalog: Could not connect to the Node Manager service at https://puppet-master..fios-router.home:4433/classifier-api: #<SocketError: getaddrinfo: Name or service not known>

  • /opt/puppetlabs/puppet/bin/puppet enterprise configure --detailed-exitcodes --modulepath /opt/puppetlabs/server/data/enterprise/modules
  • returned: 1
    2016-10-20 17:59:25,820 Running command: /opt/puppetlabs/puppet/bin/puppet agent --enable

Stderr from the command:

2016-10-20 17:59:25,806 [ERROR]: !! There were problems during the application of the installation catalog. !!
2016-10-20 17:59:25,811 [ERROR]: !! Review the logs at /var/log/puppetlabs/installer/2016-10-20T17.52.26+0000.install.log and resolve any issues you can find. !!
2016-10-20 17:59:25,814 [ERROR]: !! After fixing any errors, re-run the installer to complete the installation or upgrade. !!

Below is the log of console-services.log https://gist.github.com/goutham27/76e56a4d008088836cc6c6e4b53fb379

I tried running by increasing memory to 4096 but no luck

Unable to 'vagrant up' the envrionment

I have tried with
Win 7
Virtualbox 4.3.10
vagrant_1.5.2
vagrant_1.4.3

Seems to be an issue with the answers file that gets passed during pe_bootstrap

The log from the attempted vagrant up

N:\VM\pe-razor-vagrant-stack-master>vagrant up
Bringing machine 'puppet-master' up with 'virtualbox' provider...
Bringing machine 'razor-server' up with 'virtualbox' provider...
Bringing machine 'dhcp-server' up with 'virtualbox' provider...
[puppet-master] Box 'centos-64-x64-vbox4210-nocm' was not found. Fetching box fr
om specified URL for
the provider 'virtualbox'. Note that if the URL does not have
a box for this provider, you should interrupt Vagrant now and add
the box yourself. Otherwise Vagrant will attempt to download the
full box prior to discovering this error.
Downloading box from URL: http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x
64-vbox4210-nocm.box
Extracting box...ate: 6490k/s, Estimated time remaining: --:--:--)
Successfully added box 'centos-64-x64-vbox4210-nocm' with provider 'virtualbox'!

[puppet-master] Importing base box 'centos-64-x64-vbox4210-nocm'...
[puppet-master] Matching MAC address for NAT networking...
[puppet-master] Setting the name of the VM...
[puppet-master] Clearing any previously set forwarded ports...
[puppet-master] Clearing any previously set network interfaces...
[puppet-master] Preparing network interfaces based on configuration...
[puppet-master] Forwarding ports...
[puppet-master] -- 22 => 2222 (adapter 1)
[puppet-master] Running 'pre-boot' VM customizations...
[puppet-master] Booting VM...
[puppet-master] Waiting for machine to boot. This may take a few minutes...
DL is deprecated, please use Fiddle
[puppet-master] Machine booted and ready!
[puppet-master] The guest additions on this VM do not match the installed versio
n of
VirtualBox! In most cases this is fine, but in rare cases it can
prevent things such as shared folders from working properly. If you see
shared folder errors, please make sure the guest additions within the
virtual machine match the version of VirtualBox you have installed on
your host and reload your VM.

Guest Additions Version: 4.2.10
VirtualBox Version: 4.3
[puppet-master] Configuring and enabling network interfaces...
[puppet-master] Mounting shared folders...
[puppet-master] -- /vagrant
[puppet-master] -- /tmp/puppet
[puppet-master] Running provisioner: shell...
[puppet-master] Running: inline script
iptables: Flushing firewall rules: [ OK ]
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Unloading modules: [ OK ]
[puppet-master] Running provisioner: shell...
[puppet-master] Running: inline script
[puppet-master] Running provisioner: hosts...
[puppet-master] Running provisioner: pe_bootstrap...

[puppet-master] ================================================================

Puppet Enterprise v3.2.0 installer

Puppet Enterprise documentation can be found at http://docs.puppetlabs.com/pe/3.
2/
[puppet-master]

[puppet-master] ----------------------------------------------------------------

STEP 1: READ ANSWERS FROM FILE

Reading answers from file: /vagrant/.pe_build/answers/puppet-master.txt

[puppet-master]

STEP 2: SELECT AND CONFIGURE ROLES
[puppet-master] This installer lets you select and install the various roles
required in a Puppet Enterprise deployment: puppet master,
console, database, cloud provisioner, and puppet agent.
[puppet-master]

NOTE: when specifying hostnames during installation, use the fully-qualified dom
ain name (foo.example.com) rather than a shortened name (foo).
[puppet-master]
-> puppet master

The puppet master serves configurations to a group of puppet
agent nodes. This role also provides MCollective's message queue
and client interface. It should be installed on a robust,
dedicated server.
[puppet-master] ?? Install puppet master? [y/N]
[puppet-master] y
[puppet-master] !! ERROR: Answer must be either "y", "n" or for "n"
[puppet-master]
[puppet-master] ?? Install puppet master? [y/N]
[puppet-master]
[puppet-master] /vagrant/.pe_build/puppet-enterprise-3.2.0-el-6-x86_64/utilities
: line 540: t_ask__answered: parameter null or not set
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

/vagrant/.pe_build/puppet-enterprise-3.2.0-el-6-x86_64/puppet-enterprise-install
er -a /vagrant/.pe_build/answers/puppet-master.txt

Stdout from the command:

Puppet Enterprise v3.2.0 installer

Puppet Enterprise documentation can be found at http://docs.puppetlabs.com/pe/3.
2/


STEP 1: READ ANSWERS FROM FILE

Reading answers from file: /vagrant/.pe_build/answers/puppet-master.txt


STEP 2: SELECT AND CONFIGURE ROLES

This installer lets you select and install the various roles
required in a Puppet Enterprise deployment: puppet master,
console, database, cloud provisioner, and puppet agent.

NOTE: when specifying hostnames during installation, use the fully-qualified dom
ain name (foo.example.com) rather than a shortened name (foo).

-> puppet master

The puppet master serves configurations to a group of puppet
agent nodes. This role also provides MCollective's message queue
and client interface. It should be installed on a robust,
dedicated server.

?? Install puppet master? [y/N] y
?? Install puppet master? [y/N]

Stderr from the command:

!! ERROR: Answer must be either "y", "n" or for "n"
/vagrant/.pe_build/puppet-enterprise-3.2.0-el-6-x86_64/utilities: line 540: t_as
k__answered: parameter null or not set

==================END LOGFILE====================

Please contact me with anything I can do to help resolve this/test the new version.

Unable to download..but in the browser irt works ?

this is a part of the output from vagrant on windows:
Please let me know howto proceed.

Fetching: https://s3.amazonaws.com/pe-builds/released/3.2.2/puppet-enterprise-3.
2.2-el-6-x86_64.tar.gz
An error occurred while trying to download the given resource (https://s3.amazon
aws.com/pe-builds/released/3.2.2/puppet-enterprise-3.2.2-el-6-x86_64.tar.gz),
and the transfer could not complete. The error message generated was "Permission
denied - (C:/Users/Bas/AppData/Local/Temp/open-uri20141220-8536-fmo384, C:/User
s/Bas/.vagrant.d/pe_builds/puppet-enterprise-3.2.2-el-6-x86_64.tar.gz)".

unable to get local issuer certificate

Hi All,

On my Centos box i got the following error.
Please let me know how to proceed.

An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

SSL certificate problem: unable to get local issuer certificate
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn't adequate, you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.