Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Puppet Node Classifiers Talk - Patrick Buckley


Published on

Patrick Buckley gives a talk on Puppet Node Classfiers and Infrastructure Talk Meetup.

Published in: Technology, Spiritual
  • Be the first to comment

Puppet Node Classifiers Talk - Patrick Buckley

  1. 1. External Node Classifierswith a dash of puppet and a hint of provisioning
  2. 2. Stages of provisioningInitiate host requestHost initiated Host up Host contacts puppet master Puppet master calls node_terminus node_terminus creates node entry and configures groups Puppet agent executes classes returned Host readyInitiate host removal Host removed from inventory service and infrastructure dependencies Host shutdown
  3. 3. Puppet Dashboard
  4. 4. Groups && Classes
  5. 5. node_terminus/etc/puppet/puppet.conf [master] node_terminus = exec external_nodes = /etc/puppet/puppet-dashboard/external_nodeAn external node classifier is an executable that can be called by the puppet master; it doesn’t have to be written in any specific language. Its only requirement is that it returns a YAML document describing the node.
  6. 6. Example YAML---parameters: env: production puppet_version: 2.7.14 dashboard_version: 1.2.8classes:- puppet::master- users::ops- users::eng- puppet::dashboard- puppet::agentname:
  7. 7. external_nodePuppet dashboards out of the box external_node script is basically just /usr/bin/curl -k -H "Accept: text/yaml" "${ENC_BASE_URL}/${hostname}"Since this script gets called before a list of a classes are applied to a host this enables us to configure the host in the enc before the first puppet run. function add_node { if [ $NOOP == true ] then echo "CMD: rake node:add name=$1 groups=$2" RESULT="NOOP" else RESULT=`cd /usr/share/puppet-dashboard; rake node:add name=$1 groups=$2 2>>$LOG` fi }Wow, hold up a minute. Whats this rake task?
  8. 8. Dashboard rake/face*Puppet Dashboard provides rake tasks that can create nodes, group nodes, create classes, and assign classes to nodes and groups. To get a full list of these tasks cd /usr/share/puppet- dashboard && rake -T. Here are a few excerptsrake node:add # Add a new noderake node:classes # Add/Edit class(es) for a noderake node:del # Remove a noderake node:groups # Edit/Add groups for a noderake node:list # List nodesrake node:parameters # Edit/Add parameters for a node* There are murmurs about this functionality being ported to puppet faces. Faces being an api that allows you to extend the puppet command
  9. 9. Initiate Host Request
  10. 10. Host Initiated
  11. 11. Host contacts puppet masterPuppet agent contacts puppet master Master redirects to external node terminus Node terminus classifys host based on dns This was chosen due to ease of setupcat /etc/puppet/puppet-dashboard/classify.log Tue May 22 23:34:28 UTC 2012 env:production type:puppet- dashboard,puppet-master result:Node successfully create!Host has been classified and returns the proper YAML (see earlier example)
  12. 12. Agent + Catalog + ReportHost has completed the puppet run and submitted a report. The delayed workers have processed the report. This is a recent change from older versions of the dashboard which processed reports synchronously.
  13. 13. Inventory ServiceThe inventory service allows you to easily access any facts you have configured for a host
  14. 14. Other hooks
  15. 15. Links/Questions