puppet - instant data center

Post on 15-Jul-2015

168 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Instant Data

CenterA Data Center on your Laptop

Bryan Belanger bbelanger@azcender.com

Why Developing in Your Data

Center is a Bad Idea

• Virtual Machines / Nodes tend to be expensive

• You’ll break your nodes… lots

• You can break your Puppet Master

Do It All on your Local Box

• Easy way to test and run your Puppet architecture

• No overhead in maintaining dev nodes

• Tear down and rebuild nodes quickly and easily

• If you break the Puppet Master who cares

The Basic Blocks

http://git-scm.com

http://ruby-lang.orghttp://vagrantup.com

http://virtualbox.org

Other Requirements

• vagrant-oscar:

vagrant plugin install oscar

• vagrant-vbguest:

vagrant plugin install vagrant-vbguest

• librarian-puppet gem:

gem install librarian-puppet

• nokogiri gem:

gem install --install-dir ~/.vagrant.d/gems nokogiri -v '1.6.4.1'

• vagrant-centos7_fix:

vagrant plugin install vagrant-centos7_fix

• puppet gem:

gem install puppet

Other Considerations

• You’ll need an i5 or better processor

• You need a minimum of 8 GB

• 16 GB is recommended

Using the Oscar Plugin

• boxes.yaml

• Hash of boxes and their location

• pe_build.yaml

• Specifies location and version of

Puppet Enterprise

• roles.yaml

• Virtual machine configuration

details

• vms.yaml

• Ties boxes and configuration

together

boxes.yaml Finds Vagrant

Boxes# Boxes

# Updated: 2014-12-03 --- PT

boxes:

'fs_centos-65-x64-vbox4320-nocm':

‘http://file.azcender.com/boxes/fs_centos-65-x64-vbox4320-nocm.box'

'fs_centos-7-x64-vbox4320-nocm':

‘http://file.azcender.com/boxes/fs_centos-7-x64-vbox4320-nocm.box'

‘fs_ubuntu-server-14041-x64-vbox4320-nocm':

‘http://file.azcender.com/boxes/fs_ubuntu-server-14041-x64-vbox4320-nocm.box'

'fs_win-2012r2-standard-amd64-vbox4316-nocm':

'http://file.azcender.com/boxes/fs_win-2012r2-standard-amd64-vbox4316-nocm.box'

Every Box has a Name

Every Box has

a Location

pe_build.yaml Downloads

Puppet Enterprise---

pe_build:

version: 3.3.2

download_root: "http://s3.amazonaws.com/pe-builds/released/:version"

Puppet Enterprise

Version

roles.yaml Configures a Node

---

roles:

pe-puppet-master:

vbguest:

auto_update: true

provider:

type: virtualbox

customize:

- [modifyvm, !ruby/sym id, '--memory', 4096, '--cpus', 4]

private_networks:

- {ip: '0.0.0.0', auto_network: true}

forwarded_ports:

- {guest: 443, host: 8443}

provisioners:

- {type: hosts}

- {type: pe_bootstrap, role: !ruby/sym master}

- {type: shell, inline: 'ln -s -f /opt/puppet/bin/puppet /usr/bin/puppet'}

- {type: puppet, manifests_path: puppet/manifests, manifest_file: site.pp,

module_path: puppet/modules,

options: '--verbose --debug --hiera_config /vagrant/puppet/hiera.yaml'}

- {type: shell, inline: '/usr/local/bin/puppet agent -t'}

Every Role has a Name

Puppet command

configures the

master

Shell script kicks the

agent

vms.yaml Glues Boxes and

Roles Together---

vms:

- name: master

box: fs_centos-7-x64-vbox4320-nocm

roles:

- pe-puppet-master

- name: centos0

box: fs_centos-7-x64-vbox4320-nocm

roles:

- pe-puppet-agent-linux

- name: centos1

box: fs_centos-7-x64-vbox4320-nocm

roles:

- pe-puppet-agent-linux

- name: windows0

box: fs_win-2012r2-standard-amd64-vbox4316-nocm

roles:

- pe-puppet-agent-windows

Every VM has a Name

Every VM Needs a Box

Every VM Needs a Role

Quick Start

1. Install Vagrant, VirtualBox, git and Ruby

2. Clone the puppet-r10k project

• git clone https://github.com/azcender/puppet-r10k.git

3. Make sure you install your modules

• cd puppet

• librarian-puppet install

4. Change to project directory

• cd puppet-r10k

5. Start the Vagrant master

• vagrant up master

6. Once complete start a Puppet node

• vagrant up centos0

7. Visit your new Puppet console

• https://localhost:8443

• User: admin@puppetlabs.com

• PW: puppetlabs

See The Following Project

and Detailed Setup

https://github.com/azcender/puppet-r10k.git

What’s Happening

Oscar Downlads

Puppet

Oscar Installs the

Puppet Master Using

an Answer File

The Default site.pp is

Applied to the Master

An Agent Node is

Started

The Agent Node

Issues a CURL

Command to Install

Puppet from the

Paster

Master Install

Agent Install

site.pp

• Install r10k

• Export the hosts — Import External Ones

• Install Hiera

• Kick the Agent

Special Thanks

Full Frontal Ingenuity

top related