$30 off During Our Annual Pro Sale. View Details »

Puppet: a (very) brief introduction

Puppet: a (very) brief introduction

Presented to @CodeCumbria
2013-04-24

David Murphy

April 24, 2013
Tweet

More Decks by David Murphy

Other Decks in Technology

Transcript

  1. Puppet:
    a (very) brief introduction
    Presented to @CodeCumbria
    2013-04-24

    View Slide

  2. http://schwuk.com
    @schwuk

    View Slide

  3. Once upon a time...
    ...there was server.
    It was a good little server.
    It only had one application to serve,
    and a nice sysadmin who cared for it.
    He'd configured it from bare metal,
    had hand-crafted each config file,
    and installed every package by hand.

    View Slide

  4. http://www.flickr.com/photos/bionicteaching/

    View Slide

  5. An unhappy ending
    That nice sysadmin got a job at Google...
    ...and that one application made the front
    page of Hacker News.
    The server broke.

    View Slide

  6. PANIC

    View Slide

  7. An unhappy ending beginning
    This time they could do it right.

    View Slide

  8. Configuration Management
    ...it does exactly what is says on the tin.

    View Slide

  9. What is Puppet?
    Configuration Management of course!
    ...and much more...
    ● Provisioning
    ● Configuration
    ● Automation
    ● Deployment

    View Slide

  10. How does work?
    Create a configuration
    Apply it to a server
    Rinse, repeat

    View Slide

  11. How does it work?
    Standalone
    A local manifest is
    manually applied to
    the local server
    Locally
    :)
    Client/Server
    The client sends it's
    information to the
    server
    The server sends back
    the configuration
    The client applies it

    View Slide

  12. (The official version)

    View Slide

  13. Don't get carried away
    Stick to standalone mode until you've got your
    head around the concepts

    View Slide

  14. Time to learn some new terms
    Resource Manifest

    View Slide

  15. Resource
    Describes a "thing"
    There are many types of things...
    user, group, file, package, service...
    http://docs.puppetlabs.
    com/references/latest/type.html

    View Slide

  16. Example resource
    user { 'dave':
    ensure => present,
    uid => '507',
    gid => 'admin',
    shell => '/bin/zsh',
    home => '/home/dave',
    managehome => true,
    }

    View Slide

  17. Querying resources
    $ puppet resource user dave

    View Slide

  18. Manifests
    Describe many "things" i.e. resources
    Use a .pp file extension
    Can be nested
    Can be combined

    View Slide

  19. Example manifest
    # ~/example.pp
    file {'testfile':
    path => '/tmp/testfile',
    ensure => present,
    mode => 0640,
    content => "I'm a test file.",
    }

    View Slide

  20. Applying manifests
    $ puppet apply example.pp

    View Slide

  21. Applying manifests
    $ puppet apply example.pp
    notice: /Stage[main]//File[testfile]/ensure: created
    $ cat /tmp/testfile
    I'm a test file.
    $ ls -lah /tmp/testfile
    -rw-r----- 1 root root 16 Feb 23 13:15 /tmp/testfile

    View Slide

  22. A real world example
    [REDACTED]
    (Not really, just too complex for a single slide)

    View Slide

  23. The tip of the iceberg
    Go forth and experiment!
    http://docs.puppetlabs.com/learning/
    http://docs.puppetlabs.com/

    View Slide

  24. Questions?
    @schwuk

    View Slide