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.

Razor, the Provisioning Toolbox - PuppetConf 2014

1,868 views

Published on

Razor, the Provisioning Toolbox - David Lutterkort, Puppet Labs

Published in: Technology
  • Be the first to comment

Razor, the Provisioning Toolbox - PuppetConf 2014

  1. 1. Razor David Lutterkort Principal Engineer | Puppet Labs @lutterkort
  2. 2. PXE provisioning - user satisfaction
  3. 3. Overview • Intro to Razor • Examples • Minimal setup • Direct provisioning • Brownfield • Windows • Server locality • Puppet Enterprise
  4. 4. Razor in a nutshell • iPXE • Node Discovery • Stay focussed
  5. 5. Moving pieces Repo What to install ISO contents Task How to install Installer scripts Broker How to manage PE agent install Tag Where to install Named match rule Policy Combine it all Ordered table
  6. 6. Examples
  7. 7. Minimal setup > razor create-repo --name centos6 --iso-url http://example.org/centos-6.5.iso --task centos
  8. 8. Minimal setup > razor create-repo --name centos6 --iso-url http://example.org/centos-6.5.iso --task centos From http://razor:8080/api/collections/repos/centos6: name: centos6 iso_url: http://example.org/centos-6.5.iso url: — task: centos command: http://razor:8080/api/collections/commands/74
  9. 9. Minimal setup > razor create-broker --name pe --broker-type puppet-pe --configuration server=puppet-master.example.org
  10. 10. Minimal setup > razor create-tag --name test --rule '["=", 1, 1]'
  11. 11. Minimal setup > razor create-policy --name demo --repo centos6 --hostname 'host${id}.example.com' --root-password 'geheim' --broker pe --tag test
  12. 12. MAC-based provisioning > razor update-tag-rule --name test --force --rule '["in", ["fact", "macaddress"], "00:00:de:ad:be:ef"]'
  13. 13. MAC-based provisioning > razor update-tag-rule --name test --force --rule '["in", ["fact", "macaddress"], "00:00:de:ad:be:ef", "00:00:8b:ad:f0:0d"]'
  14. 14. Using node metadata > razor update-tag-rule --name test --force --rule '["=", ["metadata", "os"] "centos"]'
  15. 15. Using node metadata > razor update-node-metadata --node node42 --key os --value centos
  16. 16. Brownfield deployments • protect_new_nodes setting in config.yaml • register_node command
  17. 17. Windows installation • Additional setup steps: 1. Build WinPE 2. Create Windows repo 3. Samba server • Supported: Windows 8, Windows 2012R2, 2008R2 WIP
  18. 18. Server locality (@virtualswede) • server role based on position • talk to network equipment • extend MK with LLDP facts
  19. 19. LLDP facts > razor nodes node1 facts From http://localhost:8080/api/collections/nodes/node1: … ipaddress_ens2f0: 192.168.1.107 macaddress_ens2f0: 00:1e:67:4d:c2:06 netmask_ens2f0: 255.255.255.0 … lldp_neighbor_portid_ens2f0: Ethernet17 lldp_neighbor_sysname_ens2f0: razor-switch1 lldp_neighbor_mngaddr_ipv4_ens2f0: 192.168.1.254 …
  20. 20. Microkernel extensions > tree extension extension/ ├── bin/ ├── lib/ │ └── ruby/ │ └── facter/ └── facts.d/ > cd extension && zip -r ../mk-extension.zip * > cp mk-extension.zip $extension-zip
  21. 21. Hook scripts • Called at predefined points in a node’s lifecycle • node-registered • node-bound • node-uninstalled • node-deleted
  22. 22. Hook scripts json=$(< /dev/stdin) name=$(jq '.hook.name' <<< $json) value=$(( $(jq '.hook.config.value' <<< $json) + 1 )) cat <<EOF { "hook": { "config": { "value": $value } }, "metadata": { $name: $value } } EOF
  23. 23. Puppet Enterprise
  24. 24. Razor and Puppet Enterprise • In Tech Preview since PE 3.2 • Major updates in PE 3.3 • Ongoing work to support fully • Vagrant stack: https://github.com/npwalker/pe-razor-vagrant-stack
  25. 25. Questions ? https://github.com/puppetlabs/razor-server http://virtualswede.files.wordpress.com/2012/07/puppet-plus-razor-is-good.png

×