官术网_书友最值得收藏!

Getting ready for Puppet

Although Puppet is inherently cross-platform and works with many different operating systems, for the purposes of this book, I'm going to focus on just one operating system, namely the Ubuntu 16.04 LTS distribution of Linux, and the most recent version of Puppet, Puppet 5. However, all the examples in the book should work on any recent operating system or Puppet version with only minor changes.

You will probably find that the best way to read this book is to follow along with the examples using a Linux machine of your own. It doesn't matter whether this is a physical server, desktop or laptop, cloud instance, or a virtual machine. I'm going to use the popular Vagrant software to run a virtual machine on my own computer, and you can do the same. The public GitHub repository for this book contains a Vagrantfile, which you can use to get up and running with Puppet in just a few steps.

Installing Git and downloading the repo

To get a copy of the repo that accompanies this book, follow these steps:

  1. Browse to https://git-scm.com/downloads
  2. Download and install the right version of Git for your operating system.
  3. Run the following command:
    git clone https://github.com/bitfield/puppet-beginners-guide-3.git
    

Installing VirtualBox and Vagrant

If you already have a Linux machine or cloud server you'd like to use for working through the examples, skip this section and move on to the next chapter. If you'd like to use VirtualBox and Vagrant to run a local virtual machine (VM) on your computer to use with the examples, follow these instructions:

  1. Browse to https://www.virtualbox.org/
  2. Download and install the right version of VirtualBox for your operating system
  3. Browse to https://www.vagrantup.com/downloads.html
  4. Select the right version of Vagrant for your operating system: OS X, Windows, and so on
  5. Follow the instructions to install the software

Running your Vagrant VM

Once you have installed Vagrant, you can start the Puppet Beginner's Guide virtual machine:

  1. Run the following commands:
    cd puppet-beginners-guide-3
    scripts/start_vagrant.sh
    

    Vagrant will begin downloading the base box. Once that has booted, it will install Puppet. This may take a while, but once the installation is complete, the virtual machine will be ready to use.

  2. Connect to the VM with the following command:
    vagrant ssh
    
  3. You now have a command-line shell on the VM. Check that Puppet is installed and working by running the following command (you may get a different version number, which is fine):
    puppet --version
    5.2.0
    

    Tip

    If you're using Windows, you may need to install the PuTTY software to connect to your VM. There is some helpful advice about using Vagrant on Windows at:

    http://tech.osteel.me/posts/2015/01/25/how-to-use-vagrant-on-windows.html

Troubleshooting Vagrant

If you have any problems running the VM, look for help on the VirtualBox or Vagrant websites. In particular, if you have an older machine, you may see a message like the following:

VT-x/AMD-V hardware acceleration is not available on your system. Your 64-bit guest will fail to detect a 64-bit CPU and will not be able to boot.

Your computer may have a BIOS setting to enable 64-bit hardware virtualization (depending on the manufacturer, the trade name for this is either VT-x or AMD-V). Enabling this feature may fix the problem. If not, you can try the 32-bit version of the Vagrant box instead. Edit the file named Vagrantfile in the Git repository, and comment out the following line with a leading # character:

config.vm.box = "ubuntu/xenial64"

Uncomment the following line by removing the leading # character:

# config.vm.box = "ubuntu/xenial32"

Now re-run the scripts/start_vagrant.sh command.

主站蜘蛛池模板: 黄石市| 邯郸县| 金乡县| 泊头市| 芜湖县| 大埔区| 方山县| 昌吉市| 织金县| 仁寿县| 宁晋县| 南澳县| 扬中市| 广西| 大英县| 宁化县| 旅游| 南部县| 丰宁| 东兰县| 崇文区| 芦山县| 吉木萨尔县| 汤阴县| 邯郸县| 宁德市| 阿图什市| 肇州县| 襄樊市| 迁西县| 栖霞市| 海口市| 延安市| 务川| 神木县| 嘉义市| 太康县| 博罗县| 九江县| 方正县| 靖西县|