GithubHelp home page GithubHelp logo

pvanisacker / foreman-vagrant Goto Github PK

View Code? Open in Web Editor NEW

This project forked from garystafford/foreman-vagrant

0.0 1.0 0.0 267 KB

Automate the creation and configuration of a Foreman server VM and multiple Puppet Agent VMs

License: Apache License 2.0

Shell 89.49% Puppet 10.51%

foreman-vagrant's Introduction

Foreman-Puppet-Vagrant Multiple-VM Creation and Configuration

Automatically provision multiple VMs with Vagrant and VirtualBox. Automatically install, configure, and test Foreman and Puppet Agents on those VMs.

JSON Configuration File

The Vagrantfile retrieves multiple VM configurations from a separate nodes.json JSON file. All VM configuration is contained in that JSON file. You can add additional VMs to the JSON file, following the existing pattern. The Vagrantfile will loop through all nodes (VMs) in the nodes.json file and create the VMs. You can easily swap configuration files for alternate environments since the Vagrantfile is designed to be generic and portable.

Host entries plugin

The Vagrantfile uses the vagrant-hostmanager plugin and makes sure that all entries are consistent between guests and also the host itself. The plugin must be installed with vagrant plugin install vagrant-hostmanager.

Instructions

Suggest provisioning Foreman VM first, before agents. It will takes several minutes to create.

vagrant up theforeman.example.com

Important, when the provisioning is complete, note the results displayed once Foreman is installed! They provide the admin login password and URL for the Foreman console.

==> theforeman.example.com:   Success!
==> theforeman.example.com:   * Foreman is running at https://theforeman.example.com
==> theforeman.example.com:       Initial credentials are admin / 7x2fpZBWgVEHvzTw
==> theforeman.example.com:   * Foreman Proxy is running at https://theforeman.example.com:8443
==> theforeman.example.com:   * Puppetmaster is running at port 8140
==> theforeman.example.com:   The full log is at /var/log/foreman-installer/foreman-installer.log

Log into the Foreman web-browser based console. Change the admin account password, and/or set-up your own admin account(s).

Next, build two puppet agent VMs.

vagrant up
# Shift+Ctrl+T # new tab on host
vagrant ssh agent01.example.com # ssh into agent node
# initiate certificate signing request (CSR)
sudo puppet agent --test --waitforcert=60

Forwarding Ports

Used by Vagrant and VirtualBox. To create additional forwarding ports, add them to the 'ports' array. For example:

"ports": [
       {
         ":host": 1234,
         ":guest": 2234,
         ":id": "port-1"
       },
       {
         ":host": 5678,
         ":guest": 6789,
         ":id": "port-2"
       }
     ]

Errors

Error: Unknown configuration section 'hostmanager'. => **Solution: **Install the vagrant-hostmanager plugin with vagrant plugin install vagrant-hostmanager

Useful Multi-VM Commands

The use of the specific name is optional in most cases.

  • vagrant up <machine>
  • vagrant reload <machine>
  • vagrant destroy -f <machine> && vagrant up <machine>
  • vagrant status <machine>
  • vagrant ssh <machine>
  • vagrant global-status

Useful Logs for Debugging Project Issues

Some logs require sudo access

  • sudo tail -50 /var/log/syslog
  • sudo tail -50 /var/log/puppet/masterhttp.log
  • sudo tail -50 /var/log/foreman/production.log
  • sudo tail -50 /var/log/foreman-installer/foreman-installer.log
  • sudo tail -50 /var/log/foreman-proxy/proxy.log
  • tail -50 ~/VirtualBox\ VMs/<group>/<machine>/Logs/VBox.log

foreman-vagrant's People

Contributors

garystafford avatar maier-atix-de avatar

Watchers

Pieter Van Isacker avatar

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.