Learn Puppet: Quest Guide for the Learning VM Table of Contents: ▪ 1 Learning V

Learn Puppet: Quest Guide for the Learning VM Table of Contents: ▪ 1 Learning VM Setup ▪ 5 Welcome ▪ 10 The Power of Puppet ▪ 19 Resources ▪ 25 Manifests and Classes ▪ 32 Modules ▪ 39 NTP ▪ 45 MySQL ▪ 52 Variables and Class Parameters ▪ 58 Conditional Statements ▪ 65 Resource Ordering ▪ 71 Afterword ▪ 72 Troubleshooting ▪ 73 Glossary of Puppet Vocabulary Contents Learning VM Setup About the Learning Virtual Machine The Learning Virtual Machine (VM) is a sandbox environment equipped with everything you'll need to get started learning Puppet and Puppet Enterprise (PE). Because we believe exploration and playfulness are key to successful learning, we've done our best to make getting started with Puppet a fun and frictionless process. The VM is powered by CentOS Linux and for your convenience, we've pre-installed Puppet Enterprise (PE) along with everything you'll need to put it into action. Before you get started, however, we'll walk you through a few steps to get the VM conRgured and running. The Learning VM comes in two Savors. You downloaded this guide with either a VMware (.vmx) Rle or an Open Virtualization Format (.ovf) Rle. The .vmx version works with VMware Player or VMware Workstation on Linux and Windows based machines, and VMware Fusion for Mac. The .ovf Rle is suitable for Oracle's Virtualbox as well as several other virtualization players that support this format. We've included instructions below for VMware Fusion, VMware Player, and Virtualbox. If you run into issues getting the Learning VM set up, feel free to contact us at learningvm@puppetlabs.com, and we'll do our best to help out. Getting started with the Learning VM If you haven't already downloaded VMware Player, VMware Fusion, or Oracle Virtualbox, please see the links below: • VMWare Player • VMWare Fusion • VirtualBox You'll also need an SSH client to interact with the Learning VM over a Secure Shell (SSH) connection. This will be more comfortable than interacting with the virtualization software directly. If you're using Mac OS, you will be able to run SSH by way of the default Terminal application or a third party application like iTerm. If you are on a Windows OS, we recommend PuTTY, a free SSH client for Windows. © 2014 Puppet Labs 1 Once you have an up-to-date virtualization application and the means to SSH to the Learning VM you're ready to conRgure the Learning VM itself. If you're reading this guide, you've probably already extracted the .zip Rle that contains the Learning VM. Keep that .zip Rle around in case you want to create a fresh instance of the Learning VM without having the re-do the download. VM Setup Start by launching your virtualization software. (Don't be tempted by any dialogues or wizards that pop up the Rrst time you open the software. These will walk you through creating a new virtual machine, and will mislead you if you're trying to open the existing Learning VM Rle.) Depending on what virtualization software you're using, there are some slight variations in how you'll open Learning VM Rle. • In VMware Player there will be an Open a Virtual Machine option on the • Welcome screen. You can also select File > Open... from the Player menu • in the top left. • For VMWare Fusion, select File > Open... from the menu bar. • For VirtualBox, select File > Import Appliance... from the menu bar. • If you're using different virtualization software, just be sure to open or • import, rather than create new. Don't launch the VM just yet. There are a few conRguration steps that you should complete before launching the Learning VM for the Rrst time. (If you skipped ahead and already launched the VM, shut it down by logging in with the credentials root and puppet and entering the command shutdown -P now . And if you run into errors, remember that you can simply delete the VM and create another by unpacking the .zip archive and following the instructions above.) With the Learning VM selected in the library or manager window, open the Settings panel. There are a few things to adjust here. First, under Network or Network Adapter, conRrm that the Network Adapter is enabled, and conRgure it to use Bridged networking. Next, you'll need to increase the memory allocation and processors to the VM to ensure that it has the resources neccessary to run smoothly. These options are under System in VirtualBox and Processors & Memory in VMware Fusion. Allocate 4 GB of memory (4096 MB) and two processor cores. You can run the Learning VM with less memory and fewer processor cores, but you may encounter performance issues. Learning VM Setup © 2014 Puppet Labs 2 Now that your settings are conRgured, select Start or Power On to boot up the VM. Input Capture Virtualization software uses mouse and keyboard capture to 'own' these devices and communicate input to the guest operating system. The keystroke to release the mouse and keyboard will be displayed at the top right of the VM window. Next Steps Once the VM is booted, you may have to hit enter to see to the login prompt. Log in using the following credentials: • username: root • password: puppet All you'll want to do for now is get the Learning VM's IP address. Use the Facter tool bundled with Puppet Enterprise tool to Rnd it. facter ipaddress Make a note of the IP address displayed. You'll need it to open an SSH connection to the Learning VM and in order to access to the PE Console later. For the Learning VM's quest tool to work smoothly, you'll need to log out before starting your SSH session. The Rle that tracks your command line history and helps us test completion of some tasks will only be created after you log out for the Rrst time. Enter the command: exit Now that you have the IP address, open an SSH connection to the Learning VM. On a Linux system or a Mac, you can open a Terminal application and run the following command, replacing <ip-address> with the IP address of your Learning VM: ssh root@<ip-address> If you are on a Windows system, use an SSH client. We recommend Putty. Enter the IP address into the Hostname textbox and click Open to start your session. Use the same credentials: • username: root Learning VM Setup © 2014 Puppet Labs 3 • password: puppet Now that the Learning VM is conRgured and you're connected, you're all set to take on your Rrst quest! We hope you have fun learning Puppet! In addition to the VM, the following resources may be handy in your journey to learn Puppet: • Puppet users group • Puppet Ask - Q&A site • #puppet IRC channel on irc.freenode.net • Learning VM Issue Tracker • You can also email us at learningvm@puppetlabs.com Learning VM Setup © 2014 Puppet Labs 4 “ Welcome Quest Objectives • Learn about the value of Puppet and Puppet Enterprise • Familiarize yourself with the Quest structure and tool The Learning VM Welcome to the Quest Guide for the Learning Virtual Machine. This guide will be your companion as you make your way through a series of interactive quests on the accompanying VM. This Rrst quest serves as an introduction to Puppet and gives you an overview of the quest structure and the integrated quest tool. We've done our best to keep it short so you can get on to the meatier stuff in the quests that follow. You should have started up the VM by now, and have an open SSH session from your terminal or SSH client. If you need to, return to the Setup section and review the instructions to get caught up. Remember, the credentials to log in to the Learning VM via SSH are: • username: root • password: puppet If you're comfortable in a Unix command-line environment, feel free to take a look around and get a feel for what you're working with. Getting Started The Learning VM includes a quest tool that will provide structure and feedback as you progress. You'll learn more about this tool below, but for now, type the following command to start your Rrst quest: the "Welcome" quest. quest --start welcome Any sufficiently advanced technology is indistinguishable from magic. -Arthur C. Clarke © 2014 Puppet Labs 5 What is Puppet? Puppet is an open-source IT automation tool. The Puppet Domain SpeciRc Language (DSL) is a Ruby-based coding language that provides a precise and adaptable way to describe a desired state for each machine in your infrastructure. Once you've described a desired state, Puppet does the work to bring your systems in line and keep them there. The easy-to-read syntax of Puppet's DSL gives you an operating-system-independent language to specify which packages should be installed, what services you want running, which users accounts you need, how permissions are set, and just about any other detail of a uploads/Industriel/ quest-guide.pdf

  • 23
  • 0
  • 0
Afficher les détails des licences
Licence et utilisation
Gratuit pour un usage personnel Attribution requise
Partager