+ All Categories
Home > Technology > Puppet - Instant Data Center

Puppet - Instant Data Center

Date post: 15-Jul-2015
Category:
Upload: bryan-belanger
View: 167 times
Download: 0 times
Share this document with a friend
Popular Tags:
17
Instant Data Center A Data Center on your Laptop Bryan Belanger [email protected]
Transcript
Page 1: Puppet  - Instant Data Center

Instant Data

CenterA Data Center on your Laptop

Bryan Belanger [email protected]

Page 2: Puppet  - Instant Data Center
Page 3: Puppet  - Instant Data Center

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

Page 4: Puppet  - Instant Data Center

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

Page 5: Puppet  - Instant Data Center

The Basic Blocks

http://git-scm.com

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

http://virtualbox.org

Page 6: Puppet  - Instant Data Center

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

Page 7: Puppet  - Instant Data Center

Other Considerations

• You’ll need an i5 or better processor

• You need a minimum of 8 GB

• 16 GB is recommended

Page 8: Puppet  - Instant Data Center

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

Page 9: Puppet  - Instant Data Center

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

Page 10: Puppet  - Instant Data Center

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

Page 11: Puppet  - Instant Data Center

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

Page 12: Puppet  - Instant Data Center

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

Page 13: Puppet  - Instant Data Center

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: [email protected]

• PW: puppetlabs

Page 14: Puppet  - Instant Data Center

See The Following Project

and Detailed Setup

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

Page 15: Puppet  - Instant Data Center

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

Page 16: Puppet  - Instant Data Center

site.pp

• Install r10k

• Export the hosts — Import External Ones

• Install Hiera

• Kick the Agent

Page 17: Puppet  - Instant Data Center

Special Thanks

Full Frontal Ingenuity


Recommended