SlideShare a Scribd company logo
Building on
Puppet

http://www.rankpop.com/you-need-to-start-structuring-your-blog-posts-asap/
Building On Puppet and Puppet Forge
HTTP Load Balancer
from Pound to nginx
Server Density v2:

New version : new load balancer
nginx :
- WebSockets
- SPDY standard
keep :
- modules pulled from our Gihub repo by the
puppet master
- use of Puppet Console and Live Management
to trigger transient changes
Reinventing the wheel
(don't)

Writing our nginx module?
- add yet another one to the collection of
in-house developed modules
community reach?
- whether our problem had already been solved
- or a kick start where we could stand on
http://www.flickr.com/photos/conskeptical/
Going to the Forge
Going to the Forge
Integration
A) get the actual code into the master
puppet module install puppetlabs/nginx
(or)
git submodule add https://github.com/puppetlabs/puppetlabs­nginx.git 

B) run it on existing nodes
no parameterized classes on PE Console (2.8.x)
(or)
merge our site.pp (which is empty) and the console,
it being an ENC and all - (how-merging-works)
Integration
Our solution

class serverdensity­nginx
{
    class { 'nginx': }
    nginx::resource::upstream {
       'socky_rack':
          ensure => present,
          members => split( $lbTargetHostsSocky, ',' ),
    }
(...)
nginx 'on-the-fly' update

class serverdensity­nginx
{
    class { 'nginx': }
    nginx::resource::upstream {
       'socky_rack':
          ensure => present,
          members => split( $lbTargetHostsSocky, ',' ),
    }
(...)
nginx 'on-the-fly' update
nginx 'on-the-fly' update
nginx 'on-the-fly' update
nginx 'on-the-fly' update
Alternatives

Puppet Labs nginx module:
https://github.com/serverdensity/puppetlabs-nginx
forked James Fryman's module:
https://github.com/jfryman/puppet-nginx

pick the later? Puppet Labs last update - 30th June
2011.

https://github.com/serverdensity/puppetlabs-nginx
Extending Server Density
Server Density collects server data from an open
source agent deployed on each device
Create a device on Server Density UI
Copy the device ID (agent key)
The agent reads the device ID from a config file:
[Main]
sd_url: http://mydomain.serverdensity.com
agent_key: 8160b409de9d8a612ec8d964c5b26bf
(...)
Extending Server Density
Server Density v1:
Extending Server Density
Server Density v1:
'sd­agent': 
   ensure => installed,
file 
{ 
   'config.cfg':
      path    => '/etc/sd­agent/config.cfg',
      ensure  => file,
      require => Package['sd­agent'],
      content => template('sd­agent/config.erb'),
}
[Main]
sd_url: http://boxedice.serverdensity.com
agent_key: <%= sdAgentKey %>
(...)
Extending Server Density
Server Density v2:
Extending Server Density
Server Density v2 – in action:
Extending Server Density
Server Density v2 – in action:
Extending Server Density
Server Density v2 - implementation:
Manages the life cycle of Rackspace and Amazon
cloud instances
A custom fact will return the cloud instance agent key
or use Server Density API to create a device on the
fly and return the resulting agent key
https://github.com/serverdensity/puppet-serverdensity
Extending Server Density
Custom fact:
Facter.add(:agent_key, :timeout => 10) do
    if File::exist?('/etc/sd­agent­key')
        result = Facter::Util::Resolution.exec("cat /etc/sd­agent­key")
    elsif Facter.value('ec2_instance_id')
        uri = URI("http://ec2meta.serverdensity.com/latest/user­data")
        req = Net::HTTP::Get.new(uri.request_uri)
        res = Net::HTTP.start(uri.host, uri.port) {|http|
                http.request(req)
        }
        result = res.body.split(':').last if res.code == 200
    end
    setcode { result }
end
Extending Server Density
Custom function:
(...)
        agent_key = lookupvar("agent_key")
        # lookupvar returns undef if no value
        # test against nil just in case
        unless agent_key.nil? or agent_key == :undef
            notice ["Agent Key Provided via Facter: #{ agent_key }"]
            return agent_key
        End
(...) 
Extending Server Density
Custom function:
(...)
base_url = "https://api.serverdensity.io"
filter = {
  'type' => 'device',
  'hostname' => hostname,
}
filter_json = URI.escape(PSON.dump(filter))

uri = 
 URI("#{base_url}/inventory/devices?filter=#{filter_json}&token=#{token}")
req = Net::HTTP::Get.new(uri.request_uri)
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
res = https.start { |cx| cx.request(req) }
(...) 
Extending Server Density
Custom function:
(...)
device = PSON.parse(res.body)
if device['status'] == 2
notice ["Device not found, creating a new one"]
uri = URI("#{ base_url }devices/add?account=#{ sd_url }")
req = Net::HTTP::Post.new(uri.request_uri)
req.basic_auth sd_username, sd_password
params = {
  'name' => server_name,
  'hostName' => hostname,
  'notes' => 'Created automatically by puppet­serverdensity',
}
(...) 
Extending Server Density
Server Density v2:

Next: Publishing to the Forge
https://github.com/serverdensity/puppet-serverdensity
Pedro Pessoa
pessoa@serverdensity.com

http://serverdensity.com/puppetcamp/

More Related Content

PDF
Puppet Camp Ghent 2013
PDF
Lessons Learned: Using Concourse In Production
PPTX
MoldCamp - multidimentional testing workflow. CIBox.
PPTX
The Prowess of Prow
PDF
DrupalCon Los Angeles - Continuous Integration Toolbox
PDF
Why you can't ignore GitLab
PDF
CIbox - OpenSource solution for making your #devops better
PDF
Intro to Git for Drupal 7
Puppet Camp Ghent 2013
Lessons Learned: Using Concourse In Production
MoldCamp - multidimentional testing workflow. CIBox.
The Prowess of Prow
DrupalCon Los Angeles - Continuous Integration Toolbox
Why you can't ignore GitLab
CIbox - OpenSource solution for making your #devops better
Intro to Git for Drupal 7

What's hot (20)

PPTX
Continuos Integration @Knetminer
PDF
Continuous delivery with jenkins, docker and exoscale
PPTX
Migrating To GitHub
PDF
Ci For The Web 2.0 Guy Or Gal
PPTX
Composer JSON kills make files
PDF
Managing dependencies with gradle
PDF
Concourse - CI for the cloud
PPTX
7 Habits of Highly Effective Jenkins Users
PDF
Using Git with Drupal
PDF
Introduction to Concourse CI #渋谷Java
PDF
Auto-scaled Concourse CI on AWS w/o BOSH
PDF
Kamailio World 2018 - Workshop: kamailio-tests
PDF
Gdg cloud taipei ddt meetup #53 buildpack
PDF
There is no snapshot
PDF
Webkit/chromium contribution process
PDF
Gitlab and Lingvokot
PDF
OpenCms Days 2015 How do you develop for OpenCms?
PDF
Pragmatic software development in kdb+
PDF
Drupal 8 DevOps . Profile and SQL flows.
KEY
ActiveLAMP Process
Continuos Integration @Knetminer
Continuous delivery with jenkins, docker and exoscale
Migrating To GitHub
Ci For The Web 2.0 Guy Or Gal
Composer JSON kills make files
Managing dependencies with gradle
Concourse - CI for the cloud
7 Habits of Highly Effective Jenkins Users
Using Git with Drupal
Introduction to Concourse CI #渋谷Java
Auto-scaled Concourse CI on AWS w/o BOSH
Kamailio World 2018 - Workshop: kamailio-tests
Gdg cloud taipei ddt meetup #53 buildpack
There is no snapshot
Webkit/chromium contribution process
Gitlab and Lingvokot
OpenCms Days 2015 How do you develop for OpenCms?
Pragmatic software development in kdb+
Drupal 8 DevOps . Profile and SQL flows.
ActiveLAMP Process
Ad

Viewers also liked (20)

PDF
PuppetDB, Puppet Explorer and puppetdbquery
PDF
Docker and Puppet for Continuous Integration
PPTX
Windows Configuration Management: Managing Packages, Services, & Power Shell-...
PPTX
Installaling Puppet Master and Agent
PPTX
Provisioning environments. A simplistic approach
PDF
Puppetconf 2015 - Puppet Reporting with Elasticsearch Logstash and Kibana
PPTX
Package Management on Windows with Chocolatey
KEY
Puppet for dummies - ZendCon 2011 Edition
PDF
Icinga 2 and Puppet automate monitoring
PPTX
Intro to Puppet Enterprise
PDF
Using Docker with Puppet - PuppetConf 2014
PDF
Chasing AMI - Building Amazon machine images with Puppet, Packer and Jenkins
PDF
Managing Windows Systems with Puppet - PuppetConf 2013
PDF
Managing Puppet using MCollective
PDF
Rise of the Machines - Automate your Development
PDF
Jenkins Docker
ODP
Ic maven jenkins_sonar
PDF
Dockercon2015 bamboo
PDF
Red Hat Satellite 6 - Automation with Puppet
PDF
Game of Codes: the Battle for CI
PuppetDB, Puppet Explorer and puppetdbquery
Docker and Puppet for Continuous Integration
Windows Configuration Management: Managing Packages, Services, & Power Shell-...
Installaling Puppet Master and Agent
Provisioning environments. A simplistic approach
Puppetconf 2015 - Puppet Reporting with Elasticsearch Logstash and Kibana
Package Management on Windows with Chocolatey
Puppet for dummies - ZendCon 2011 Edition
Icinga 2 and Puppet automate monitoring
Intro to Puppet Enterprise
Using Docker with Puppet - PuppetConf 2014
Chasing AMI - Building Amazon machine images with Puppet, Packer and Jenkins
Managing Windows Systems with Puppet - PuppetConf 2013
Managing Puppet using MCollective
Rise of the Machines - Automate your Development
Jenkins Docker
Ic maven jenkins_sonar
Dockercon2015 bamboo
Red Hat Satellite 6 - Automation with Puppet
Game of Codes: the Battle for CI
Ad

Similar to Building On Puppet and Puppet Forge (20)

PDF
Adding Forge Modules to Puppet Enterprise
PDF
Intro to Github Actions @likecoin
PDF
Princeton RSE Peer network first meeting
PDF
Webpack: from 0 to 2
PPTX
PDF
Building kubectl plugins with Quarkus | DevNation Tech Talk
PDF
Ansible Workshop for Pythonistas
PPT
Django Deployment
PDF
From dev to prod: Kubernetes on AWS (short ver.)
PPT
Setting up the hyperledger composer in ubuntu
PDF
Put the dev back in devops - Cloud-native at local speed! - RH Summit 19
PDF
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
PPTX
Advancing Bitcoin 2019 - BTCPayServer Architecture
PDF
project_proposal_osrf
PDF
Developing MIPS Exploits to Hack Routers
PDF
Hackweek 20 Open Door - Support Windows clients in Uyuni/SUSE Manager
PDF
FOSDEM 2017: GitLab CI
PDF
Webpack presentation
PDF
Refactoring meta-rauc-community: Cleaner Code, Better Maintenance, More Machines
PPTX
Hyper-V OpenStack Nova Compute
Adding Forge Modules to Puppet Enterprise
Intro to Github Actions @likecoin
Princeton RSE Peer network first meeting
Webpack: from 0 to 2
Building kubectl plugins with Quarkus | DevNation Tech Talk
Ansible Workshop for Pythonistas
Django Deployment
From dev to prod: Kubernetes on AWS (short ver.)
Setting up the hyperledger composer in ubuntu
Put the dev back in devops - Cloud-native at local speed! - RH Summit 19
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
Advancing Bitcoin 2019 - BTCPayServer Architecture
project_proposal_osrf
Developing MIPS Exploits to Hack Routers
Hackweek 20 Open Door - Support Windows clients in Uyuni/SUSE Manager
FOSDEM 2017: GitLab CI
Webpack presentation
Refactoring meta-rauc-community: Cleaner Code, Better Maintenance, More Machines
Hyper-V OpenStack Nova Compute

More from Puppet (20)

PPTX
Puppet Community Day: Planning the Future Together
PPTX
The Evolution of Puppet: Key Changes and Modernization Tips
PPTX
Can You Help Me Upgrade to Puppet 8? Tips, Tools & Best Practices for Your Up...
PPTX
Bolt Dynamic Inventory: Making Puppet Easier
PPTX
Customizing Reporting with the Puppet Report Processor
PPTX
Puppet at ConfigMgmtCamp 2025 Sponsor Deck
PPTX
The State of Puppet in 2025: A Presentation from Developer Relations Lead Dav...
PPTX
Let Red be Red and Green be Green: The Automated Workflow Restarter in GitHub...
PDF
Puppet camp2021 testing modules and controlrepo
PPTX
Puppetcamp r10kyaml
PDF
2021 04-15 operational verification (with notes)
PPTX
Puppet camp vscode
PDF
Modules of the twenties
PDF
Applying Roles and Profiles method to compliance code
PPTX
KGI compliance as-code approach
PDF
Enforce compliance policy with model-driven automation
PDF
Keynote: Puppet camp compliance
PPTX
Automating it management with Puppet + ServiceNow
PPTX
Puppet: The best way to harden Windows
PPTX
Simplified Patch Management with Puppet - Oct. 2020
Puppet Community Day: Planning the Future Together
The Evolution of Puppet: Key Changes and Modernization Tips
Can You Help Me Upgrade to Puppet 8? Tips, Tools & Best Practices for Your Up...
Bolt Dynamic Inventory: Making Puppet Easier
Customizing Reporting with the Puppet Report Processor
Puppet at ConfigMgmtCamp 2025 Sponsor Deck
The State of Puppet in 2025: A Presentation from Developer Relations Lead Dav...
Let Red be Red and Green be Green: The Automated Workflow Restarter in GitHub...
Puppet camp2021 testing modules and controlrepo
Puppetcamp r10kyaml
2021 04-15 operational verification (with notes)
Puppet camp vscode
Modules of the twenties
Applying Roles and Profiles method to compliance code
KGI compliance as-code approach
Enforce compliance policy with model-driven automation
Keynote: Puppet camp compliance
Automating it management with Puppet + ServiceNow
Puppet: The best way to harden Windows
Simplified Patch Management with Puppet - Oct. 2020

Recently uploaded (20)

PPTX
TLE Review Electricity (Electricity).pptx
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Encapsulation theory and applications.pdf
PDF
Getting Started with Data Integration: FME Form 101
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Mushroom cultivation and it's methods.pdf
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
1. Introduction to Computer Programming.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Tartificialntelligence_presentation.pptx
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
TLE Review Electricity (Electricity).pptx
NewMind AI Weekly Chronicles - August'25-Week II
Encapsulation theory and applications.pdf
Getting Started with Data Integration: FME Form 101
Univ-Connecticut-ChatGPT-Presentaion.pdf
Unlocking AI with Model Context Protocol (MCP)
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Group 1 Presentation -Planning and Decision Making .pptx
Assigned Numbers - 2025 - Bluetooth® Document
Network Security Unit 5.pdf for BCA BBA.
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Mushroom cultivation and it's methods.pdf
cloud_computing_Infrastucture_as_cloud_p
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
1. Introduction to Computer Programming.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Tartificialntelligence_presentation.pptx
SOPHOS-XG Firewall Administrator PPT.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf

Building On Puppet and Puppet Forge