Enviar búsqueda
Cargar
Understanding lwrp development
•
17 recomendaciones
•
3,194 vistas
J
jtimberman
Seguir
Denunciar
Compartir
Denunciar
Compartir
1 de 32
Descargar ahora
Descargar para leer sin conexión
Recomendados
Postgres 12 Cluster Database operations.
Postgres 12 Cluster Database operations.
Vijay Kumar N
Hadoop spark performance comparison
Hadoop spark performance comparison
arunkumar sadhasivam
Serve Meals, Not Ingredients (ChefConf 2015)
Serve Meals, Not Ingredients (ChefConf 2015)
ThirdWaveInsights
Hadoop 2.0 cluster setup on ubuntu 14.04 (64 bit)
Hadoop 2.0 cluster setup on ubuntu 14.04 (64 bit)
Nag Arvind Gudiseva
Automated Java Deployments With Rpm
Automated Java Deployments With Rpm
Martin Jackson
Moving 12c database from NON-ASM to ASM
Moving 12c database from NON-ASM to ASM
Monowar Mukul
Colvin RMAN New Features
Colvin RMAN New Features
Enkitec
Introduction to scoop and its functions
Introduction to scoop and its functions
Rupak Roy
Recomendados
Postgres 12 Cluster Database operations.
Postgres 12 Cluster Database operations.
Vijay Kumar N
Hadoop spark performance comparison
Hadoop spark performance comparison
arunkumar sadhasivam
Serve Meals, Not Ingredients (ChefConf 2015)
Serve Meals, Not Ingredients (ChefConf 2015)
ThirdWaveInsights
Hadoop 2.0 cluster setup on ubuntu 14.04 (64 bit)
Hadoop 2.0 cluster setup on ubuntu 14.04 (64 bit)
Nag Arvind Gudiseva
Automated Java Deployments With Rpm
Automated Java Deployments With Rpm
Martin Jackson
Moving 12c database from NON-ASM to ASM
Moving 12c database from NON-ASM to ASM
Monowar Mukul
Colvin RMAN New Features
Colvin RMAN New Features
Enkitec
Introduction to scoop and its functions
Introduction to scoop and its functions
Rupak Roy
Java 7 Features and Enhancements
Java 7 Features and Enhancements
Gagan Agrawal
Asm disk group migration from
Asm disk group migration from
Anar Godjaev
Postgresql 12 streaming replication hol
Postgresql 12 streaming replication hol
Vijay Kumar N
Open-E DSS V7 Asynchronous Data Replication over a LAN
Open-E DSS V7 Asynchronous Data Replication over a LAN
open-e
Session 04 -Pig Continued
Session 04 -Pig Continued
AnandMHadoop
Build Automation 101
Build Automation 101
Martin Jackson
Rman cloning when both directory and db name are same.
Rman cloning when both directory and db name are same.
subhani shaik
Rman cloning guide
Rman cloning guide
Amit87_dba
20141111 파이썬으로 Hadoop MR프로그래밍
20141111 파이썬으로 Hadoop MR프로그래밍
Tae Young Lee
Open-E DSS V7 Synchronous Volume Replication over a LAN
Open-E DSS V7 Synchronous Volume Replication over a LAN
open-e
HaskellとDebianの辛くて甘い関係
HaskellとDebianの辛くて甘い関係
Kiwamu Okabe
Open-E DSS V7 Asynchronous Data Replication within a System
Open-E DSS V7 Asynchronous Data Replication within a System
open-e
Linux class 10 15 oct 2021-6
Linux class 10 15 oct 2021-6
Khawar Nehal khawar.nehal@atrc.net.pk
Session 04 pig - slides
Session 04 pig - slides
AnandMHadoop
361 Rac
361 Rac
Emanuel Mateus
Linux class 9 15 oct 2021-5
Linux class 9 15 oct 2021-5
Khawar Nehal khawar.nehal@atrc.net.pk
03 pig intro
03 pig intro
Subhas Kumar Ghosh
341 Rac
341 Rac
Emanuel Mateus
Building and Deploying Application to Apache Mesos
Building and Deploying Application to Apache Mesos
Joe Stein
Puppet_training
Puppet_training
Afroz Hussain
Day02 a pi.
Day02 a pi.
ABDEL RAHMAN KARIM
Automated infrastructure is on the menu
Automated infrastructure is on the menu
jtimberman
Más contenido relacionado
La actualidad más candente
Java 7 Features and Enhancements
Java 7 Features and Enhancements
Gagan Agrawal
Asm disk group migration from
Asm disk group migration from
Anar Godjaev
Postgresql 12 streaming replication hol
Postgresql 12 streaming replication hol
Vijay Kumar N
Open-E DSS V7 Asynchronous Data Replication over a LAN
Open-E DSS V7 Asynchronous Data Replication over a LAN
open-e
Session 04 -Pig Continued
Session 04 -Pig Continued
AnandMHadoop
Build Automation 101
Build Automation 101
Martin Jackson
Rman cloning when both directory and db name are same.
Rman cloning when both directory and db name are same.
subhani shaik
Rman cloning guide
Rman cloning guide
Amit87_dba
20141111 파이썬으로 Hadoop MR프로그래밍
20141111 파이썬으로 Hadoop MR프로그래밍
Tae Young Lee
Open-E DSS V7 Synchronous Volume Replication over a LAN
Open-E DSS V7 Synchronous Volume Replication over a LAN
open-e
HaskellとDebianの辛くて甘い関係
HaskellとDebianの辛くて甘い関係
Kiwamu Okabe
Open-E DSS V7 Asynchronous Data Replication within a System
Open-E DSS V7 Asynchronous Data Replication within a System
open-e
Linux class 10 15 oct 2021-6
Linux class 10 15 oct 2021-6
Khawar Nehal khawar.nehal@atrc.net.pk
Session 04 pig - slides
Session 04 pig - slides
AnandMHadoop
361 Rac
361 Rac
Emanuel Mateus
Linux class 9 15 oct 2021-5
Linux class 9 15 oct 2021-5
Khawar Nehal khawar.nehal@atrc.net.pk
03 pig intro
03 pig intro
Subhas Kumar Ghosh
341 Rac
341 Rac
Emanuel Mateus
Building and Deploying Application to Apache Mesos
Building and Deploying Application to Apache Mesos
Joe Stein
La actualidad más candente
(19)
Java 7 Features and Enhancements
Java 7 Features and Enhancements
Asm disk group migration from
Asm disk group migration from
Postgresql 12 streaming replication hol
Postgresql 12 streaming replication hol
Open-E DSS V7 Asynchronous Data Replication over a LAN
Open-E DSS V7 Asynchronous Data Replication over a LAN
Session 04 -Pig Continued
Session 04 -Pig Continued
Build Automation 101
Build Automation 101
Rman cloning when both directory and db name are same.
Rman cloning when both directory and db name are same.
Rman cloning guide
Rman cloning guide
20141111 파이썬으로 Hadoop MR프로그래밍
20141111 파이썬으로 Hadoop MR프로그래밍
Open-E DSS V7 Synchronous Volume Replication over a LAN
Open-E DSS V7 Synchronous Volume Replication over a LAN
HaskellとDebianの辛くて甘い関係
HaskellとDebianの辛くて甘い関係
Open-E DSS V7 Asynchronous Data Replication within a System
Open-E DSS V7 Asynchronous Data Replication within a System
Linux class 10 15 oct 2021-6
Linux class 10 15 oct 2021-6
Session 04 pig - slides
Session 04 pig - slides
361 Rac
361 Rac
Linux class 9 15 oct 2021-5
Linux class 9 15 oct 2021-5
03 pig intro
03 pig intro
341 Rac
341 Rac
Building and Deploying Application to Apache Mesos
Building and Deploying Application to Apache Mesos
Similar a Understanding lwrp development
Puppet_training
Puppet_training
Afroz Hussain
Day02 a pi.
Day02 a pi.
ABDEL RAHMAN KARIM
Automated infrastructure is on the menu
Automated infrastructure is on the menu
jtimberman
Puppet slides for intelligrape
Puppet slides for intelligrape
Sharad Aggarwal
Python tools for testing web services over HTTP
Python tools for testing web services over HTTP
Mykhailo Kolesnyk
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Puppet
TYPO3 Flow 2.0 (International PHP Conference 2013)
TYPO3 Flow 2.0 (International PHP Conference 2013)
Robert Lemke
Pinterest like site using REST and Bottle
Pinterest like site using REST and Bottle
Gaurav Bhardwaj
Serve Meals, Not Ingredients - ChefConf 2015
Serve Meals, Not Ingredients - ChefConf 2015
Chef
C++ PSM for DDS: Revised Submission
C++ PSM for DDS: Revised Submission
Rick Warren
LinuxCon 2013 Steven Dake on Using Heat for autoscaling OpenShift on Openstack
LinuxCon 2013 Steven Dake on Using Heat for autoscaling OpenShift on Openstack
OpenShift Origin
How To Install Openbravo ERP 2.50 MP43 in Ubuntu
How To Install Openbravo ERP 2.50 MP43 in Ubuntu
Wirabumi Software
Exploring Oracle Database 12c Multitenant best practices for your Cloud
Exploring Oracle Database 12c Multitenant best practices for your Cloud
dyahalom
Cqrs api v2
Cqrs api v2
Brandon Mueller
Pandora FMS: Sun One webserver
Pandora FMS: Sun One webserver
Pandora FMS
DevOps Hackathon: Session 3 - Test Driven Infrastructure
DevOps Hackathon: Session 3 - Test Driven Infrastructure
Antons Kranga
The Grand Puppet Sub-Systems Tour - Nicholas Fagerlund, Puppet Labs
The Grand Puppet Sub-Systems Tour - Nicholas Fagerlund, Puppet Labs
Puppet
Chef in the cloud [dbccg]
Chef in the cloud [dbccg]
jtimberman
Introduction to OData
Introduction to OData
Mindfire Solutions
Embedding a Jupyter Notebook - SORSE.pdf
Embedding a Jupyter Notebook - SORSE.pdf
florinpico
Similar a Understanding lwrp development
(20)
Puppet_training
Puppet_training
Day02 a pi.
Day02 a pi.
Automated infrastructure is on the menu
Automated infrastructure is on the menu
Puppet slides for intelligrape
Puppet slides for intelligrape
Python tools for testing web services over HTTP
Python tools for testing web services over HTTP
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
TYPO3 Flow 2.0 (International PHP Conference 2013)
TYPO3 Flow 2.0 (International PHP Conference 2013)
Pinterest like site using REST and Bottle
Pinterest like site using REST and Bottle
Serve Meals, Not Ingredients - ChefConf 2015
Serve Meals, Not Ingredients - ChefConf 2015
C++ PSM for DDS: Revised Submission
C++ PSM for DDS: Revised Submission
LinuxCon 2013 Steven Dake on Using Heat for autoscaling OpenShift on Openstack
LinuxCon 2013 Steven Dake on Using Heat for autoscaling OpenShift on Openstack
How To Install Openbravo ERP 2.50 MP43 in Ubuntu
How To Install Openbravo ERP 2.50 MP43 in Ubuntu
Exploring Oracle Database 12c Multitenant best practices for your Cloud
Exploring Oracle Database 12c Multitenant best practices for your Cloud
Cqrs api v2
Cqrs api v2
Pandora FMS: Sun One webserver
Pandora FMS: Sun One webserver
DevOps Hackathon: Session 3 - Test Driven Infrastructure
DevOps Hackathon: Session 3 - Test Driven Infrastructure
The Grand Puppet Sub-Systems Tour - Nicholas Fagerlund, Puppet Labs
The Grand Puppet Sub-Systems Tour - Nicholas Fagerlund, Puppet Labs
Chef in the cloud [dbccg]
Chef in the cloud [dbccg]
Introduction to OData
Introduction to OData
Embedding a Jupyter Notebook - SORSE.pdf
Embedding a Jupyter Notebook - SORSE.pdf
Más de jtimberman
Socal piggies-app-deploy
Socal piggies-app-deploy
jtimberman
Oscon2011 tutorial
Oscon2011 tutorial
jtimberman
Agile services-dev opsdays
Agile services-dev opsdays
jtimberman
Velocity2011 chef-workshop
Velocity2011 chef-workshop
jtimberman
Cooking security sans@night
Cooking security sans@night
jtimberman
Mwrc2011 cookbook design patterns
Mwrc2011 cookbook design patterns
jtimberman
tmux lightning talk mwrc
tmux lightning talk mwrc
jtimberman
Fosdem chef-101-app-deploy
Fosdem chef-101-app-deploy
jtimberman
Data driven app deploys with chef frontdev
Data driven app deploys with chef frontdev
jtimberman
Derailed chef update-oct2010
Derailed chef update-oct2010
jtimberman
Más de jtimberman
(10)
Socal piggies-app-deploy
Socal piggies-app-deploy
Oscon2011 tutorial
Oscon2011 tutorial
Agile services-dev opsdays
Agile services-dev opsdays
Velocity2011 chef-workshop
Velocity2011 chef-workshop
Cooking security sans@night
Cooking security sans@night
Mwrc2011 cookbook design patterns
Mwrc2011 cookbook design patterns
tmux lightning talk mwrc
tmux lightning talk mwrc
Fosdem chef-101-app-deploy
Fosdem chef-101-app-deploy
Data driven app deploys with chef frontdev
Data driven app deploys with chef frontdev
Derailed chef update-oct2010
Derailed chef update-oct2010
Understanding lwrp development
1.
Copyright © 2010
Opscode, Inc - All Rights Reserved Speaker: ‣ joshua@opscode.com ‣ @jtimberman ‣ www.opscode.com Joshua Timberman Technical Evangelist 1 Understanding LWRP Tuesday, November 2, 2010
2.
Copyright © 2010
Opscode, Inc - All Rights Reserved Chef manages Resources on Nodes 2 cookbook_file template service package deploy git http_request link ruby_block log bash execute remote_file user Tuesday, November 2, 2010 Resources are an abstraction we feed data into. When you write recipes in Chef, you create resources of things you want to configure. You describe the state of some part of the system. We’re going to talk about how this works in depth.
3.
Copyright © 2010
Opscode, Inc - All Rights Reserved 3 gem_package "bluepill" Tuesday, November 2, 2010 A very simple resource, simply tells Chef to install the bluepill package as a RubyGem.
4.
Copyright © 2010
Opscode, Inc - All Rights Reserved 4 package "bluepill" do provider Chef::Provider::Package::Rubygems end package "bluepill" do provider gem_package end Tuesday, November 2, 2010 Likewise, these are both the equivalent of the previous gem_package, we’re just specifically telling the package resource to use a particular provider. We’ll see why this matters later.
5.
Copyright © 2010
Opscode, Inc - All Rights Reserved 5 template "/etc/bluepill/dnscache.pill" do source "dnscache.pill.erb" mode 0644 end Tuesday, November 2, 2010 Another somewhat simple resource, specify a file to be written somewhere as a template.
6.
Copyright © 2010
Opscode, Inc - All Rights Reserved 6 bluepill_service "dnscache" do action [:enable,:load,:start] end Tuesday, November 2, 2010 Here’s a custom resource that specifies actions to run. We’ll talk in a bit how this works.
7.
Copyright © 2010
Opscode, Inc - All Rights Reserved Resources take action through Providers 7 Tuesday, November 2, 2010 The abstraction over the commands or API calls that will configure the resource to be in the state you have defined.
8.
Copyright © 2010
Opscode, Inc - All Rights Reserved 8 service "dnscache" do provider bluepill_service action [:enable, :load, :start] end Tuesday, November 2, 2010
9.
Copyright © 2010
Opscode, Inc - All Rights Reserved 9 Chef’s Recipe DSL creates resources Tuesday, November 2, 2010
10.
Copyright © 2010
Opscode, Inc - All Rights Reserved Recipes evaluated in two phases 10 Compile Phase Execution Phase Tuesday, November 2, 2010 Going to leave out some of the details. The rest is in the code. :)
11.
Copyright © 2010
Opscode, Inc - All Rights Reserved Compile Phase 11 Tuesday, November 2, 2010
12.
Copyright © 2010
Opscode, Inc - All Rights Reserved Resources added to ResourceCollection 12 Tuesday, November 2, 2010 When recipes are processed for Resources during the compile phase, they are added to the resource collection. These can include..
13.
Copyright © 2010
Opscode, Inc - All Rights Reserved Chef::ResourceCollection 13 Resources and definitions Hash of indexed resources Definitions are replaced Tuesday, November 2, 2010 Chef “recognizes” resources and definitions through method_missing. These are created as a hash of numerically indexed resources. Definitions are replaced entirely by the resources they contain.
14.
Copyright © 2010
Opscode, Inc - All Rights Reserved 14 @resources_by_name={"file[/tmp/something]"=>0} Tuesday, November 2, 2010 essential what the Resource Collection looks like.
15.
Copyright © 2010
Opscode, Inc - All Rights Reserved 15 Chef::RunContext Loads cookbook components ‣ Libraries ‣ Providers ‣ Resources ‣ Attributes ‣ Definitions ‣ Recipes Tuesday, November 2, 2010 The order is important because of where you can put things, and when things are available.
16.
Copyright © 2010
Opscode, Inc - All Rights Reserved Execution Phase 16 Tuesday, November 2, 2010 Once everything is loaded up and the recipes have been parsed for the resources they contain, the runner starts the execution phase.
17.
Copyright © 2010
Opscode, Inc - All Rights Reserved 17 Chef::Runner converges the node Tuesday, November 2, 2010 runs the provider actions specified by the resource
18.
Copyright © 2010
Opscode, Inc - All Rights Reserved Chef::Resource calls run_action 18 Tuesday, November 2, 2010 run_action calls the method for that particular action in the provider
19.
Copyright © 2010
Opscode, Inc - All Rights Reserved Provider is chosen by Chef::Platform 19 Tuesday, November 2, 2010 This is how platform specific providers are chosen like apt/yum, useradd, etc. It also contains logic to get the provider for the resource..
20.
Copyright © 2010
Opscode, Inc - All Rights Reserved Chef::Platform finds the provider 20 Specifically named parameter Platform assigned providers Matching the resource name Tuesday, November 2, 2010 Specifically named providers are like we saw earlier where the resource itself had the provider parameter. Platform assigned are the ones like apt/yum for packages. Matching the resource name is how LWRPs get chosen.
21.
Copyright © 2010
Opscode, Inc - All Rights Reserved Cookbook LWRP 21 Tuesday, November 2, 2010 LWRPs, or resources and providers written in this special DSL, reside in cookbooks.
22.
Copyright © 2010
Opscode, Inc - All Rights Reserved Ruby DSL for writing Resources & Providers 22 Tuesday, November 2, 2010 All LWRPs are, a Ruby DSL for writing resources and providers. This DSL is designed to be easier to write and understand than the fully resource/provider code in the code included by the Chef libraries.
23.
Copyright © 2010
Opscode, Inc - All Rights Reserved Resources have states 23 Tuesday, November 2, 2010
24.
Copyright © 2010
Opscode, Inc - All Rights Reserved Resources have states 24 Resource DSL describe states Two possible states ‣ Current (@current_resource) ‣ Desired (@new_resource) Providers load_current_resource Tuesday, November 2, 2010 The resource describes the state that some aspect of the system should be in by passing parameters that configure it for that state. Current and desired are the two states that a resource can be in. Providers load_current_resource determines what state the resource is in.
25.
Copyright © 2010
Opscode, Inc - All Rights Reserved 25 def load_current_resource @bp = Chef::Resource::BluepillService.new(new_resource.name) @bp.service_name(new_resource.service_name) Chef::Log.debug("Checking status of service #{new_resource.service_name}") begin if run_command_with_systems_locale(:command => "#{node['bluepill']['bin']} status # {new_resource.service_name}") == 0 @bp.running(true) end rescue Chef::Exceptions::Exec @bp.running(false) nil end if ::File.exists?("#{node['bluepill']['conf_dir']}/#{new_resource.service_name}.pill") && ::File.symlink?("#{node['bluepill']['init_dir']}/#{new_resource.service_name}") @bp.enabled(true) else @bp.enabled(false) end end Tuesday, November 2, 2010 The code is not important. What is important that we’re checking for some various states on the system by running commands or code and setting “state” parameters.
26.
Copyright © 2010
Opscode, Inc - All Rights Reserved 26 actions :start, :stop, :enable, :disable, :load, :restart attribute :service_name, :name_attribute => true attribute :enabled, :default => false attribute :running, :default => false attribute :variables, :kind_of => Hash attribute :supports, :default => { :restart => true, :status => true } Resource DSL Tuesday, November 2, 2010 Actions correspond to ‘action’ methods in the provider. Attributes correspond to methods for the resource. These are also called parameters and are not node attributes.
27.
Copyright © 2010
Opscode, Inc - All Rights Reserved Provider DSL 27 action :start do unless @bp.running execute "/usr/bin/bluepill start #{new_resource.service_name}" end end Tuesday, November 2, 2010 The provider DSL at a minimum has action methods. The action methods handle doing whatever is needed to configure the resource to be in the declared state. Earlier we set @bp_running to true or false depending on the current state, here we check.
28.
Copyright © 2010
Opscode, Inc - All Rights Reserved 28 action :start do unless @bp.running execute "/usr/bin/bluepill start #{new_resource.service_name}" end end actions :start, :stop, :enable, :disable, :load, :restart attribute :service_name, :name_attribute => true attribute :enabled, :default => false attribute :running, :default => false attribute :variables, :kind_of => Hash attribute :supports, :default => { :restart => true, :status => true } Tuesday, November 2, 2010 Lets break down the provider’s methods
29.
Copyright © 2010
Opscode, Inc - All Rights Reserved 29 def load_current_resource @bp = Chef::Resource::BluepillService.new(new_resource.name) @bp.service_name(new_resource.service_name) Chef::Log.debug("Checking status of service #{new_resource.service_name}") begin if run_command_with_systems_locale(:command => "#{node['bluepill']['bin']} status # {new_resource.service_name}") == 0 @bp.running(true) end rescue Chef::Exceptions::Exec @bp.running(false) nil end if ::File.exists?("#{node['bluepill']['conf_dir']}/#{new_resource.service_name}.pill") && ::File.symlink?("#{node['bluepill']['init_dir']}/#{new_resource.service_name}") @bp.enabled(true) else @bp.enabled(false) end end actions :start, :stop, :enable, :disable, :load, :restart attribute :service_name, :name_attribute => true attribute :enabled, :default => false attribute :running, :default => false attribute :variables, :kind_of => Hash attribute :supports, :default => { :restart => true, :status => true } Tuesday, November 2, 2010
30.
Copyright © 2010
Opscode, Inc - All Rights Reserved 30 action :start do unless @bp.running execute "/usr/bin/bluepill start #{new_resource.service_name}" end end Tuesday, November 2, 2010
31.
Copyright © 2010
Opscode, Inc - All Rights Reserved 31 action :start do unless @bp.running execute "/usr/bin/bluepill start #{new_resource.service_name}" end end Chef Resources! New resource parameters Tuesday, November 2, 2010 You can use chef resources inside LWRPs, too. The goal: Replace definitions with LWRPs
32.
Copyright © 2010
Opscode, Inc - All Rights Reserved LWRPs in Opscode Cookbooks 32 aws_ebs_volume aws_elastic_ip bluepill_service daemontools_service dynect_rr mysql_database pacman_aur pacman_group samba_user Tuesday, November 2, 2010 built from the name of the cookbook and the ruby file in the resources/providers directory. these are the aws, bluepill, daemontools, dynect, mysql, pacman and samba cookbooks respectively.
Descargar ahora