Re: [Puppet Users] Running classes alone

2013-08-20 Thread Peter
Hi David,

I don't suppose you know of any good resources (blog posts or git hub 
example code) showing this.  I am trying to look at a way to kickstart the 
build of a puppet master and would prefer moving down this path.  At the 
moment I am using a bootstrap script to download forge modules and modules 
hosted on github then doing a puppet apply from the command line to 
kickstart.

Thanks,

Peter.

On Tuesday, 20 August 2013 00:45:45 UTC+10, David Schmitt wrote:

 On 2013-08-19 14:06, Matt S wrote: 
  Hello! 
  
  I've got a manifest that involves downloading and updating a bunch of 
  different packages using apt, pip, etc. One of my apt-dependencies, 
  dnsmasq http://www.thekelleys.org.uk/dnsmasq/doc.html, redirects the 
  machine's DNS. Any modules currently running at that time that use the 
  internet get a temporary name resolution error. Unfortunately, I can't 
  run this class in a different stage, as it creates a dependency cycle 
  with the other things that depend on dnsmasq. 
  
  Is there a way to force puppet to run a particular class by itself? 
  There are enough other tasks/jobs/whatever-we-call-them that being 
  explicit about the dependencies isn't really worth it (and it'd have to 
  be kept up to date as my manifest grows). 


 You might want to look into tags. I've got a few resources which are 
 applied to bootstrap the whole process, which can be applied separately 
 using --tags kickstart::bootstrap, which is used while kickstarting 
 the node. This ensures that when it reboots, it has a properly 
 configured puppet, but doesn't start services in kickstart. 


 Alternatively you can pack the initial installation and configuration of 
 dnsmasq into an exec{} to ensure semi-atomic execution. Not recommended, 
 but possible. 


 Regards, David 




-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Possible for each user to have their own testing environment?

2013-08-20 Thread Sandra Schlichting


On Monday, 19 August 2013 15:48:38 UTC+2, myeazel wrote:

 Git branching and environments is exactly what we did to solve this 
 problem. We are actually using gitolite which allows us to lock down who 
 can push to certain branches. So anyone can create their own branch, push 
 that up (which creates the proper directories through git hooks) and test 
 with --environment [branch_name] and then when they know it works great, 
 request a merge into our permanent environments like production and 
 testing. Once the new code is merged into its final home, the temporary 
 branch is deleted. 

 The hard part is the git hooks. We actually have a script that emulates 
 the Github WebHook URL functionality and a hook that catches that POST 
 and does all the magic. I included the web pages that helped me get our 
 setup working how we wanted it to.

 https://github.com/metajack/notify-webhook
 https://puppetlabs.com/blog/git-workflow-and-puppet-environments/


Thanks a really cool script! Thanks =)



 

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Possible for each user to have their own testing environment?

2013-08-20 Thread Sandra Schlichting


  How can a git branch name (master) conflict with content in the 
  puppet.conf file? 

 When using puppet agent --environment=master, the [master] section 
 containing configuration directives (e.g. database connection for 
 puppetdb) will be interpreted by the puppet agent, with less than 
 stellar results. 


That makes a lot of sense, why master is not allowed as an environment 
name.

 

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Puppet environments vs App environments

2013-08-20 Thread jcbollinger


On Monday, August 19, 2013 9:49:59 AM UTC-5, JeremyCampbell wrote:

 Hi John,

 Thank you for a most well considered response given my level of 
 understanding. I'd much appreciate an example of a system sliced along 2 or 
 more different dimensions that need to be flattened into one, this is the 
 only part not clear to me.


It was not individual systems I was talking about slicing, but rather your 
overall pool of systems.  For example, suppose you want dev, staging, and 
production environments for your system configuration management.  Suppose 
you also want separate (sets of) environments for different departments 
(say RD, sales, and accounting).  Flattening these means you end up with 
environments such as rnd_dev, rnd_staging, sales_production, etc. -- a 
total of nine environments.  Each system must be assigned to exactly one 
environment.


John

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Pass same parameter value to multiple classes using Puppet Hiera

2013-08-20 Thread jcbollinger


On Monday, August 19, 2013 10:03:03 AM UTC-5, RobH wrote:

 I'm using Hiera with Puppet and I want to pass the same parameter value to 
 multiple classes without repeating it. Right now I've got (in Yaml):

 ---
 class_a::database_server: myoraclebox.example.com
 class_b::database_server: myoraclebox.example.com


 This works, but how can I specify the server only once and still use 
 Puppet's automatic parameter lookup? (I'd rather not embed an explicit 
 Hiera lookup in my manifest, since that would couple it to Hiera.)

 Thanks!


The appropriate mechanism(s) for doing this depend in part on what you mean 
to express.  Is it meaningful that parameters to two different classes have 
the same value, or is it a random coincidence?  If meaningful, then is that 
meaning tied specifically to your site, or is it general to the nature of 
the classes involved?  Here are some of your better options:

   1. YAML has a mechanism for expressing a value in the form of a 
   reference to another value in the same document.  I think this will work 
   with the YAML parser Hiera is using.  Look up anchors and aliases in 
   the YAML spec (http://www.yaml.org/spec/1.2/spec.html).  I would use this 
   only if it is a requirement peculiar to your site that the two class 
   parameters take the same value, there is no likelihood of that requirement 
   changing in the foreseeable future, and (2) below does not apply.
   2. Alternatively, if the requirement for the two parameters to take the 
   same value can be construed as part of the nature of the classes involved, 
   then you could have one class reference the other's parameter instead of 
   defining its own, or else create a third class on which the parameter can 
   reside, and have both the others rely on it.

If, however, it is not deeply significant that the two classes take the 
same parameter value, then I would retain the data duplication.  It better 
expresses the nature of the coincidence, and it minimizes your risk of 
breaking things when the circumstances giving rise to the coincidence 
change.



John

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: if defined not working when class is enlcosed within Class[ ]

2013-08-20 Thread jcbollinger


On Monday, August 19, 2013 10:32:39 PM UTC-5, Florian Gray Jones wrote:

 ok, that's great. Thanks for the help.

 The puppet-docs it says: *Modules are how Puppet finds the classes and 
 types it can use* — it automatically loads any 
 classhttp://docs.puppetlabs.com/puppet/2.7/reference/lang_classes.html
  or defined 
 typehttp://docs.puppetlabs.com/puppet/2.7/reference/lang_defined_types.html 
 stored 
 in its modules.



Where did you see that?  Although true, it may be a bit misleading to new 
Puppeteers, as load in this context does not mean the same thing as 
declare.  That is, the classes in installed modules are not automatically 
assigned to any node; you must still declare them for the nodes where you 
want them.

 

 With this in mind, if *if *defined(Class[ ]) checks for classes.. and 
 in my case 'supervisor::service' is as you mentioned not a class but a 
 define. Is there an equivalent like if defined(Define[ ]) or is best 
 practice to continue using if defined('supervisor::service') to just 
 check for anything of that name.


The expression defined(Class[classname]) checks for the named class 
being already declared for the target node.  The expression 
defined(classname) on the other hand, checks whether a class or 
resource type is known to Puppet, so that it is *available* to be declared 
for the target node.  The form you suggest, defined(Define[title]) does 
not make sense, but the either the condition  defined(Supervisor::Service['
sabnzbd']) or the condition defined 'supervisor::service' should work, 
depending on which you mean (they are not equivalent).

Now, having said all that, I leave you with one more piece of advice: don't 
do it.  The usual use of the defined() function, wherein its argument is a 
resource reference, introduce a parse-order dependency into your manifest 
set, and that's bad news for you.  The other form, where you test for a 
class or resource type being available, is less problematic, but usually 
not what you want.  It is rarely the case that the desired response to a 
resource type or class being undefined is anything other than catalog 
compilation failure, and you don't need defined() for that.


John

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Possible for each user to have their own testing environment?

2013-08-20 Thread Sandra Schlichting


 The environment name is just a directory within the 
 /etc/puppet/environments directory, nothing more.  If you use a git branch 
 named 'master', you will just have to check it out into an environment 
 directory with a different name, such as 'production', 'main', etc...  It 
 doesn't matter what you want to call the environment directory, as long as 
 it's not one of those 4 you mentioned above, and git does not care what the 
 name of the directory the files are checked out into.  Puppet is not doing 
 any sort of checking with git to see what the branch name is.


Than I am more relaxed. =) Since PuppetLabs mentioned git, I was under the 
impression that I had to rename the native master branch in git, which it 
creates as default.

This is what my plan is, which I hope is not a problem?

cd /etc/puppet
git init
git add fileserver manifests/classes modules nodes
git commit -m init commit from puppet2
git branch

# outputs

* master

and then puppet.conf would become

[main]
logdir = /var/log/puppet
rundir = /var/run/puppet
ssldir = $vardir/ssl

[agent]
classfile = $vardir/classes.txt
localconfig = $vardir/localconfig

[sandra]
modulepath = $confdir/environments/sandra/modules
manifestdir = $confdir/environments/sandra/manifests
manifest = $confdir/environments/sandra/site.pp

where site.pp contains

filebucket {'main':
server = puppet.example.com,
path   = false,
}
File { backup = main }
Exec { path = 
/usr/bin:/usr/sbin/:/bin:/sbin:/usr/local/bin:/usr/local/sbin }
import 'classes/*.pp'
import '../nodes/*.pp'

To use it, I would

cd /etc/puppet/environments
git clone /etc/puppet sandra
cd sandra

This would not conflict, right?

I don't have a [master] block in puppet.conf. Is that needed in this case?






-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Installation problem (PE 3.0.0 on RHEL 6.4 x64)

2013-08-20 Thread Jan Walczuk
Hello everyone.

I'm trying to install Puppet Enterprise for test purposes before my company 
make a purchase of Puppet Enterprise.

There is a problem with installation (good start i guess :) ).
After QA from installator and packages installation I'm getting this 
output:
## Setting up puppet master...
## Checking the agent certificate name detection...
## Setting up puppet agent...
## Setting up the database...
Configuring postgresql server...
PostgreSQL server configured.
!! ERROR: The PostgreSQL server failed to start; unable to proceed

My conclusion after browsing install_log:
If you guys could be so nice and put info about remounting /var with exec 
that would be nice. :)

Best regards.

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] How to handle apt-get -f install -y with Puppet

2013-08-20 Thread Yves Fauser
Hi All,

I'm trying to install packages using the dpkg provider on Ubuntu that leave 
the package unconfigured because of missing dependencies. After installing 
all packages, I need to run apt-get -f install -y to fix the 
dependencies. Now with puppet I did not find a way to do so yet. 

I'm trying to do the following:
..
package { mypackage:
provider = dpkg,
ensure = installed,
source = /tmp/mypkg/mypackage.deb,
before = Exec['apt-get fix'],
  }
  exec { apt-get fix:
command = /usr/bin/apt-get -f install -y,
  }
..

But dpkg exits with a failure, and therefore the exec of apt-get -f 
install -y is skipped because of failed (puppet) dependencies.

Error: /Stage[main]/mymodule::mypkg/Package[mypackage]/ensure: change from 
absent to present failed: Execution of '/usr/bin/dpkg --force-confold -i 
/tmp/mypkg/mypackage.deb' returned 1: (Reading database ... 84559 files and 
directories currently installed.)
Preparing to replace . (using .../mypackage.deb) ...
Unpacking replacement mypackage ...
dpkg: dependency problems prevent configuration of : etc

.
Warning: /Stage[main]/Vswitch::Mypkg/Exec[apt-get fix]: Skipping because of 
failed dependencies

Any ideas on how I can make this work? can I somehow ignore the return 
code? Is there an great elegant way to work around this?

Many thanks! Any help is really appreciated.
Yves


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Despite no change in content, agent log file indicates content changed in each catalog run

2013-08-20 Thread Ed Young

Despite no change in file (actually, template) content, with each catalog 
run I get such log output as: 

Aug 19 20:49:50 app-dev puppet-agent[30132]: 
(/Stage[main]/Apache-httpd/File[/etc/httpd/conf/httpd.conf]/content) 
content changed '{md5}b8a5c22154e45771bc09ef5c34
[root@chimps-dev puppet]# service puppet restart   
 │603e7f' to 
'{md5}14699f9c769a61cbc6cc5e2c2a7465ff'

Which indicates that the file changed on the puppet master and so will be 
updated on the agent. 

This happens consistently and results in a service restart when the files 
are config files like httpd.conf. 

this is with puppet 2.6.18 on RHEL 6 (puppet master) and RHEL 5 (puppet 
agent) 

Here is my init.pp in my apache module. Note that I'm using templates only 
(nothing in my files directory) 

class apache-httpd {

  $moduleName = apache-httpd

  file { '/etc/httpd/conf/httpd.conf':
   owner = root,
   group = root,
   mode = 0644,
   ensure = 'file',
#   source = 
'puppet:///modules/apache-httpd/etc/httpd/conf/httpd.conf',
   content = template('apache-httpd/etc/httpd/conf/httpd.conf.erb'),
  }

file { '/etc/httpd/conf.d/proxy_ajp.conf':
   owner = root,
   group = root,
   mode = 0644,
   ensure = 'file',
#   source = 
'puppet:///modules/apache-httpd/etc/httpd/conf.d/proxy_ajp.conf',
   content = 
template('apache-httpd/etc/httpd/conf.d/proxy_ajp.conf.erb'),
  }

  file { '/etc/httpd/conf.d/ssl.conf':
   owner = root,
   group = root,
   mode = 0644,
   ensure = 'file',
##   source = 
'puppet:///modules/apache-httpd/etc/httpd/conf.d/ssl.conf',
   content = template('apache-httpd/etc/httpd/conf.d/ssl.conf.erb'),
  }

}

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] repositories

2013-08-20 Thread Stuart Cracraft
Hi,

I need to have yum repository entries
for this OS:

root@vs01 yum.repos.d]# uname -a
Linux vs01.usa.com2.6.18-128.2.1.5.10.el5xen #1 SMP Thu May 16 15:07:41 PDT 
2013 i686 i686 i386 GNU/Linux
[root@vs01 yum.repos.d]#

What are the appropriate entries
for /etc/yum.repos.d/puppetlabs.repo for the above?
 
Thanks. 

--Stuart


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Re: Freebsd + Puppet 3.2.2 pkg_add -f ?

2013-08-20 Thread joel johnston
So I think the core issue at this point is that no matter where I try
to set PACKAGESITE (on the server via rc, on the client via rc, on the
shell via overrides) the path to the ftp server always returns:

Error: /Stage[main]/Rsync/Package[net/rsync]/ensure: change from
absent to present failed: Execution of '/usr/sbin/pkg_add -f
ftp://ftp.freebsd.org/%2Fpub/FreeBSD/ports/amd64/packages-9-stable/All/rsync-3.0.9_3.tbz'
returned 1: pkg_add: unable to fetch 'ftp://ftp.freebsd.org/

The url is bad/wrong. For some reason it is injecting this %2F in
front of pub where it SHOULD just be /pub/

How and where is this getting set and how can I change it?


On Mon, Aug 12, 2013 at 5:54 PM, badgerious badge...@hotmail.com wrote:
 I should disclaim that I'm not a huge FreeBSD guy, but do have a couple of
 FreeBSD boxes around. I've been content getting all packages with 'pkg_add
 -r' (which seems to work fine with the unpatched freebsd provider); no idea
 about the interactions with ports you've mentioned.

 Couple of others things regarding the patch (semi tangential):

 1) If you do an install of puppet 3.2.3 from ports with ruby 1.9.3, you get
 piles of warnings during puppet runs due to some class variable use in the
 freebsd provider. This is fixed in vanilla puppet 3.2.3, but undone by the
 patch.

 2) If the freebsd provider is broken, seems like it should be going back
 upstream rather than patching in the port (forgive my ignorance if this is
 in fact happening and the patch is interim).

 Eric


 On Monday, August 12, 2013 3:35:41 PM UTC-5, Russell Jackson wrote:

 The standard provider doesn't work with packages that have multiple
 origins (the apache ports for instance) because the package name doesn't
 match was is recorded in the package database. So, what will happen is that
 puppet will think the package isn't installed on every run and attempt to
 install it.

 The only sane way around that was to use the package origin as a key and
 duplicated the '-r' functionality in the provider; this is what the patch
 does. Passing '-f' to pkg_add was questionable, but I remember there being
 problems without it.

 --
 You received this message because you are subscribed to a topic in the
 Google Groups Puppet Users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/puppet-users/1CqH0u84u6g/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 puppet-users+unsubscr...@googlegroups.com.
 To post to this group, send email to puppet-users@googlegroups.com.
 Visit this group at http://groups.google.com/group/puppet-users.
 For more options, visit https://groups.google.com/groups/opt_out.





-- 
___
Joel Johnston
760.437.5116
www.metaband.net
www.j03l.com

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] repositories

2013-08-20 Thread James A. Peltier
- Original Message - 

| Hi,

| I need to have yum repository entries
| for this OS:

| root@vs01 yum.repos.d]# uname -a
| Linux vs01.usa.com 2.6.18-128.2.1.5.10.el5xen #1 SMP Thu May 16
| 15:07:41 PDT 2013 i686 i686 i386 GNU/Linux
| [root@vs01 yum.repos.d]#

| What are the appropriate entries
| for /etc/yum.repos.d/puppetlabs.repo for the above?

| Thanks.

| --Stuart


Something more useful would be lsb_release -a or the output of factor.  This 
information is really not all that useful.
-- 

-- 
James A. Peltier
Manager, IT Services - Research Computing Group
Simon Fraser University - Burnaby Campus
Phone   : 778-782-6573
Fax : 778-782-3045
E-Mail  : jpelt...@sfu.ca
Website : http://www.sfu.ca/itservices

“A successful person is one who can lay a solid foundation from the bricks 
others have thrown at them.” -David Brinkley via Luke Shaw

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.