Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Puppets, Chefs, and Ansibles - Making sense of the provisioning circus

Puppets, Chefs, and Ansibles - Making sense of the provisioning circus

COME ONE! COME ALL! As we explore the circus of server provisioning and automation tools. Watch the puppet show and learn how to make your servers dance at your command! We'll manifest production environments right before your very eyes! See the cooking show where our Chef whips up a fresh batch of servers from their playbooks ready to bring your application to your visitors! Lastly, watch how ansible makes easy work of automating everything from application deployments to server updates. We'll even cover your servers in fabric - the pythonic remote execution tool for server automation! We'll give a whirlwind tour of each tool and show real world examples of usage. We'll compare, contrast, and maybe enjoy some cotton candy while we wait for the tools to run!

Joe Ferguson

March 10, 2018
Tweet

More Decks by Joe Ferguson

Other Decks in Technology

Transcript

  1. Puppets, Chefs, and Ansibles –
    Making Sense of the
    Provisioning Circus
    Joe Ferguson

    View Slide

  2. Who Am I?
    Joe Ferguson
    PHP Developer
    PHP Architect @ Ministry Brands
    Twitter: @JoePFerguson
    Organizer of @MemphisPHP
    OSMI Board Member
    Certified Laravel Developer
    Drone Racing Pilot

    View Slide

  3. What is a Provisioner?

    View Slide

  4. The Provisioning Circus

    View Slide

  5. View Slide

  6. Download the Puppet Learning VM
    https://puppet.com/download-learning-vm

    View Slide

  7. Puppet Learning VM

    View Slide

  8. Puppet Learning VM

    View Slide

  9. Puppet Learning VM

    View Slide

  10. Puppet Learning VM

    View Slide

  11. Puppet Learning VM

    View Slide

  12. Puppet Learning VM

    View Slide

  13. Running puppet agent —test

    View Slide

  14. Checking our Graphite App
    Graphite installed Graphite Displaying Sample Data

    View Slide

  15. Out-of-Enterprise Puppet
    https://puphpet.com

    View Slide

  16. https://puphpet.com

    View Slide

  17. Deployment Target

    View Slide

  18. Languages

    View Slide

  19. Download

    View Slide

  20. Vagrant Up

    View Slide

  21. Simple Manifest Yaml

    View Slide

  22. View Slide

  23. http://learn.chef.io

    View Slide

  24. View Slide

  25. View Slide

  26. vagrant init bento/centos-7

    View Slide

  27. Vagrant ssh

    View Slide

  28. Install Chef DK

    View Slide

  29. Creating a motd via Chef

    View Slide

  30. Running our hello.rb

    View Slide

  31. Running our hello.rb

    View Slide

  32. Check the contents of our file

    View Slide

  33. Running our hello.rb again

    View Slide

  34. Update the motd

    View Slide

  35. chef-client --local-mode hello.rb

    View Slide

  36. Delete the motd file

    View Slide

  37. chef-client --local-mode goodbye.rb

    View Slide

  38. Chef Concepts
    Resources describe the what, not the how
    Recipe is a file that holds one or more resources
    hello.rb was our resource
    Resources have actions
    :create is the default action. We didn’t have to specify.
    Recipes organize resources

    View Slide

  39. Configure a package and service

    View Slide

  40. Creating webserver.rb

    View Slide

  41. Running webserver.rb

    View Slide

  42. Configure Service for apache2

    View Slide

  43. Running webserver.rb

    View Slide

  44. Add default html to apache

    View Slide

  45. Running webserver.rb

    View Slide

  46. Verify file contents updated

    View Slide

  47. Chef works in the order you
    specify

    View Slide

  48. View Slide

  49. pip install ansible

    View Slide

  50. Ansible Concepts
    Modules
    Standalone work units to perform a task
    Inventory Configuration
    Declaration of target systems to perform tasks upon
    Playbooks
    Complete set of roles / list of actions to take

    View Slide

  51. Create Ansible Playbook

    View Slide

  52. Running Our Ansible Playbook

    View Slide

  53. Ansible Variable Precedence
    http://docs.ansible.com/ansible/playbooks_variables.html

    View Slide

  54. Ansible Variable Precedence
    Role Defaults (In your role folder)
    Inventory (Your inventory File)
    Inventory Group (Inventory Group variables)
    Inventory Host (In Inventory Host)
    …many more

    View Slide

  55. Reusing Playbooks from others

    View Slide

  56. Ansible Galaxy Authors

    View Slide

  57. Adding ansible-role-php

    View Slide

  58. Adding ansible-role-php

    View Slide

  59. Running ansible-role-php

    View Slide

  60. Ansible can deploy your code

    View Slide

  61. Ansible Tower
    https://www.ansible.com/products/tower/editions

    View Slide

  62. Ansible Tower
    https://www.ansible.com/products/tower/pricing

    View Slide

  63. AWX - Open Source Tower

    View Slide

  64. View Slide

  65. pip install fabric

    View Slide

  66. Fabric Basics

    View Slide

  67. Running hello()

    View Slide

  68. Getting Info From Remote System

    View Slide

  69. Getting Info From Remote System

    View Slide

  70. Upgrade the Remote System

    View Slide

  71. Upgrade the Remote System

    View Slide

  72. Compress and Grab Log Files

    View Slide

  73. Compress and Grab Log Files

    View Slide

  74. Grouping Methods

    View Slide

  75. Which Should You Use?

    View Slide

  76. Resources / Q & A
    Puppet Learning VM
    https://puppet.com/download-learning-vm
    http://www.puphpet.com
    https://learn.chef.io
    http://docs.ansible.com/ansible/playbooks_variables.html
    http://docs.fabfile.org

    View Slide

  77. Joe Ferguson
    Twitter: @JoePFerguson
    Email: [email protected]
    Freenode: joepferguson
    Contact Info:
    Feedback!
    https://joind.in/talk/a4d60

    View Slide