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