Ask Your Question

Where can I find a good puppet template that ensures packages present and how to install python packages?

asked 2016-05-05 11:33:27 -0600

devop_drone gravatar image

I am trying to learn to use puppet but I can't find any easy to follow templates to copy and modify. as background I spent about a week just to work out that the latest version puppet 4.4 uses environments and I had to have a folder structure of:

puppet/environments/production/manifests rather than just puppet/manifests like with older versions

I have been trying to install packages with:

class testclass {
  package { 'python-devel':  ensure => 'present' }

include testclass

inside my site.pp file yes I know should have nodes but is my single VM just

node 'default' { 

as some tutorials seem to suggest? I tried that but then it didn't seem work properly with my vagrant provision. Now although my testclass doesn't error out the first time I provision subsequent attempts result in:

==> default: Error: Evaluation Error: Error while evaluating a Resource Statemen
t, Cannot alias Package[python-dev] to ["python-devel", nil] at /tmp/vagrant-pup
pet/environments/production/modules/python/manifests/install.pp:171; resource ["
Package", "python-devel", nil] already declared at /tmp/vagrant-puppet/environme
nts/production/manifests/site.pp:3 at /tmp/vagrant-puppet/environments/productio
n/modules/python/manifests/install.pp:171:7 on node localhost.localdomain

any tutorials on how to just have puppet configure a server with a few packages installed and some python libraries? I don't need multinodes / users / files copied / services started yet just basics for now.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2016-05-06 11:55:43 -0600

UBPClaw gravatar image

Check out the Puppet Cheat Sheet

edit flag offensive delete link more

answered 2016-05-06 09:12:42 -0600

slk gravatar image

Did you look into this module ?

Look here as well. It will help you design a good 'roles and profiles' based puppet-control repo

edit flag offensive delete link more


I did look at that module and got it kinda working but I need packages like python-devel etc before scipy etc can be installed. it also keeps complaining about `heira` stuff missing but I thought using heira configs was optional?

devop_drone gravatar imagedevop_drone ( 2016-05-07 06:48:05 -0600 )edit

Look in the docs, it's all there :

 class { 'python' :
    version    => 'system',
    pip        => 'present',
    dev        => 'absent',
    virtualenv => 'absent',
    gunicorn   => 'absent',
As for hiera, I can help you better if you can post the error message

slk gravatar imageslk ( 2016-05-09 12:18:30 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-05-05 11:33:27 -0600

Seen: 178 times

Last updated: May 06 '16