Skip to content

Instantly share code, notes, and snippets.

@initcron
Created June 27, 2017 09:33
Show Gist options
  • Select an option

  • Save initcron/e2164954fbbba696d5d73a4f9c85b9e5 to your computer and use it in GitHub Desktop.

Select an option

Save initcron/e2164954fbbba696d5d73a4f9c85b9e5 to your computer and use it in GitHub Desktop.

Lab 03 : Creating and applying a Puppet Manifest

Getting familiar with Puppet

puppet

puppet --version 

puppet help 

puppet help 

puppet man resource 

puppet resource 

puppet resource user root

Creating and aplying the first Resource

Lets create our first resource to manage a system user by name deploy file: base.pp


user {"deploy" :
      ensure       => present, 
      uid          => 5001, 
      password     => '$1$WD98.uaZ$cxx30x/K3FXQrljxsvBIu/',
      home         => '/home/deploy', 
      managehome   => true, 
  }
  

Validating the syntax

puppet parser validate base.pp

puppet apply --noop base.pp

puppet apply  base.pp

Exercise

Create the following resources

  • Create users:

    • tree
    • git
    • ntp
    • wget
    • unzip
  • Remove user:

    • dojo
  • Manage file:

    • path: /etc/motd
    • Content : "Property of XYZ Inc."
  • Service

    • ntp
      • state : started, enabled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment