Successfully reported this slideshow.
Puppet Types and Providers
Dan Bode
One man comedy routine | BodeCo
@bodepd
Nan Liu
Outsourced Intern
puppetconf.com #puppetconf
•  Resource Behavior and Terminology
•  Resource Development
– Type
– Providers
•  … (Dan’s Sec...
puppetconf.com #puppetconf
•  How it works
•  Type
•  Providers
Resource
puppetconf.com #puppetconf
How it works?
puppetconf.com #puppetconf
•  How to identify a unique resource
•  Commands to manage resource
– Inspect current state
– C...
puppetconf.com #puppetconf
•  Title (namevar)
– uuids and guids
– satisfy unique constraint
– composite namevar
•  Attribu...
puppetconf.com #puppetconf
•  Have desire state
•  Preferably only two
– present/absent
– running/stopped
•  Overloading
–...
puppetconf.com #puppetconf
service { “sshd”:
ensure => ‘running’,
enable => true,
require => Package[‘ssh’],
tag => ‘Puppe...
puppetconf.com #puppetconf
/etc/init.d/sshd start/stop/status/restart
service sshd start/stop/status/restart
smf ?
Commands
puppetconf.com #puppetconf
Type
puppetconf.com #puppetconf
•  Type (single)
– Describes resources attributes
– What you write as Puppet manifests
•  Provi...
puppetconf.com #puppetconf
•  Type
•  Namevar
Type
puppetconf.com #puppetconf
•  exists?
•  create
•  destroy
Ensurable
puppetconf.com #puppetconf
•  exists?
•  install
•  uninstall
Override ensurable
puppetconf.com #puppetconf
•  install_options
•  remove_options
•  version
Parameters
puppetconf.com #puppetconf
•  version
•  Property vs. Parameter
Problems?
puppetconf.com #puppetconf
•  getter
•  setter
Property
puppetconf.com #puppetconf
•  Get all instance of resource
•  mk_resource_methods
self.instances
puppetconf.com #puppetconf
•  confine
•  defaultfor
Provider constraints
puppetconf.com #puppetconf
•  Not a hard relationship
Autorequire
Thank You
Nan Liu
Sr Systems Engineer | VMware
@sesshin
Upcoming SlideShare
Loading in …5
×

PuppetConf 2013 Types and Providers

798 views

Published on

Puppet Conf 2013 Types and Provider
Code: www.github.com/nanliu/puppet-pkg

  • Be the first to comment

PuppetConf 2013 Types and Providers

  1. 1. Puppet Types and Providers Dan Bode One man comedy routine | BodeCo @bodepd Nan Liu Outsourced Intern
  2. 2. puppetconf.com #puppetconf •  Resource Behavior and Terminology •  Resource Development – Type – Providers •  … (Dan’s Secret) •  Profit !!! Overview
  3. 3. puppetconf.com #puppetconf •  How it works •  Type •  Providers Resource
  4. 4. puppetconf.com #puppetconf How it works?
  5. 5. puppetconf.com #puppetconf •  How to identify a unique resource •  Commands to manage resource – Inspect current state – Configure desire state Prereqs
  6. 6. puppetconf.com #puppetconf •  Title (namevar) – uuids and guids – satisfy unique constraint – composite namevar •  Attributes – Properties – Parameters •  Metaparameters Resource
  7. 7. puppetconf.com #puppetconf •  Have desire state •  Preferably only two – present/absent – running/stopped •  Overloading – version Ensurable Resource
  8. 8. puppetconf.com #puppetconf service { “sshd”: ensure => ‘running’, enable => true, require => Package[‘ssh’], tag => ‘PuppetConf’, } Resource Example
  9. 9. puppetconf.com #puppetconf /etc/init.d/sshd start/stop/status/restart service sshd start/stop/status/restart smf ? Commands
  10. 10. puppetconf.com #puppetconf Type
  11. 11. puppetconf.com #puppetconf •  Type (single) – Describes resources attributes – What you write as Puppet manifests •  Provider (many) – Query state – Configure resource Separation of Responsibility
  12. 12. puppetconf.com #puppetconf •  Type •  Namevar Type
  13. 13. puppetconf.com #puppetconf •  exists? •  create •  destroy Ensurable
  14. 14. puppetconf.com #puppetconf •  exists? •  install •  uninstall Override ensurable
  15. 15. puppetconf.com #puppetconf •  install_options •  remove_options •  version Parameters
  16. 16. puppetconf.com #puppetconf •  version •  Property vs. Parameter Problems?
  17. 17. puppetconf.com #puppetconf •  getter •  setter Property
  18. 18. puppetconf.com #puppetconf •  Get all instance of resource •  mk_resource_methods self.instances
  19. 19. puppetconf.com #puppetconf •  confine •  defaultfor Provider constraints
  20. 20. puppetconf.com #puppetconf •  Not a hard relationship Autorequire
  21. 21. Thank You Nan Liu Sr Systems Engineer | VMware @sesshin

×