Changes between Initial Version and Version 1 of how-to/puppet/dev-env


Ignore:
Timestamp:
Apr 6, 2011, 12:47:36 AM (14 years ago)
Author:
Jamie McClelland
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • how-to/puppet/dev-env

    v1 v1  
     1[PageOutline]
     2= Setting up a puppet development environment =
     3
     4== Pain test ==
     5Before you begin, check to see if your CPU supports virtualization:
     6
     7{{{
     8egrep '(vmx|svm)' /proc/cpuinfo
     9}}}
     10
     11If that commands returns nothing, you are in for a painful ride. Development will be really slow and possibly not worth it.
     12
     13Hopefull, you will instead see something like:
     14
     15{{{
     160 jamie@chicken:puppet$  egrep '(vmx|svm)' /proc/cpuinfo
     17flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow up rep_good nopl extd_apicid pni cx16 lahf_lm svm extapic cr8_legacy 3dnowprefetch lbrv
     180 jamie@chicken:puppet$
     19}}}
     20
     21== Setting up your directory structure ==
     22
     23Be sure you have at least 2GB of space available on your disk.
     24
     25Here's a sample directory layout:
     26
     27 * confdir - put the MFPL git repo here (e.g. `git clone gitosis@git.mayfirst.org/mfpl/puppet confdir`)
     28
     29 * images - download (link coming soon) into your images directory. Don't gunzip right away! Instead, make a backup copy (so you don't have to re-download it if you mess it up), then gunzip it.
     30
     31 * modules - this is where I git checkout puppet modules from other puppet developers before adding them to our repository.
     32
     33== Launching your virtual image
     34
     35Be sure you have the qemu-kvm package installed.
     36
     37You can start your virtual image with:
     38
     39{{{
     40screen kvm -hda images/roach.qcow -m 512 -net nic -net user,hostfwd=tcp::2222-:22 -nographic
     41}}}
     42
     43This should put you into a screen session, allowing you to watch the boot process. You can detach with `ctl-a d` and re-attach with screen -x.
     44
     45You can login with root (no password).
     46
     47After logging in, set the root password by typing:
     48
     49{{{
     50passwd
     51}}}
     52
     53Then, you can exit and detach from the screen session.
     54
     55The kvm command sets up very simple networking, with port 2222 on our localhost forwarded to port 22 on roach.
     56
     57Add the following to your ~/.ssh/config file:
     58
     59{{{
     60Host roach
     61Hostname localhost
     62Port 2222
     63User root
     64}}}
     65
     66Now, you should be able to ssh into your host with:
     67
     68{{{
     69ssh root@roach
     70}}}
     71
     72== Bootstrapping your puppet configuration ==
     73
     74You are now ready for your first puppet push.
     75
     76Begin in your confdir. Add a remote for roach:
     77
     78{{{
     79git remote add roach root@roach:/etc/puppet-bare
     80}}}
     81
     82Next, push into roach:
     83
     84{{{
     85git push roach master
     86}}}