Re: [Puppet Users] One node and several environments

2013-09-23 Thread kay kay
Thanks. It works.

-- 
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: enablerepo option

2013-09-23 Thread Sneha More
Hi,
 I understood the problem,
You may try following things.
Just try running the commnad -> yum -y *install *fusioninventory-agent
--enablerepo=epel
And check whether its installing latest version or not.
1. If it is installing latest version then just use this in manifest:
exec { 'fusioninventory-agent':
 command => 'yum -y *update *fusioninventory-agent --enablerepo=*',
 path => '/usr/bin',
}
Dont use Package resource again.
Because it also does the same as yum command.

2. If it is not installing latest version and if you know the latest
version then specify that in your command, like
yum -y *install *fusioninventory-agent-1.2.0 --enablerepo=epel (here i have
assumed 1.2.0 as latest version )
And use just
exec { 'fusioninventory-agent':
 command => 'yum -y *update *fusioninventory-agent-1.2.0 --enablerepo=epel',
 path => '/usr/bin',
}
Do not use Package resource again.

I hope this will help you.

Thanks & Regards
Sneha More


On Mon, Sep 23, 2013 at 3:46 PM, puppetstan wrote:

> Hi
>
> This configuration is not good if fusioninventory-agent is installed and
> puppet want to verify the latest version because yum command option is
> "install" and not "update" . This configuration is only good if
> fusioninventory-agent is not installed.
>
> exec { 'fusioninventory-agent':
>  command => 'yum -y *install *fusioninventory-agent --enablerepo=*',
>  path => '/usr/bin',
>
> }
>
> package { 'fusioninventory-agent':
>  ensure => latest,
> require => Exec['fusioninventory-agent'],
> }
>
>
>
> This configuration is not good if fusioninventory-agent is not installed
> and puppet want to verify fusioninventory-agent is present  because yum
> command option is "update" and not "install" . This configuration is only
> good  if fusioninventory-agent is installed.
>
> exec { 'fusioninventory-agent':
>  command => 'yum -y *update *fusioninventory-agent --enablerepo=*',
>  path => '/usr/bin',
>
> }
>
> package { 'fusioninventory-agent':
>  ensure => latest,
> require => Exec['fusioninventory-agent'],
> }
>
> What is the solution, an idea?
>
> Regards
>
>
>
>
>
> Le vendredi 13 septembre 2013 17:23:32 UTC+2, puppetstan a écrit :
>>
>> Hi
>>
>> I would like to use enablerepo option for activate repo and verify
>> package latest version
>>
>> my manifest :
>>
>> package { "fusioninventory-agent": ensure => latest, enablerepo => [
>> "epel", "remi" ]; }
>>
>> there this patch : 
>> http://projects.puppetlabs.**com/issues/2247
>> but it does not work in my configuration
>>
>> Can you have the same problem or an other solution to activate multiple
>> rpm repo with enablerepo command?
>> regards
>>
>  --
> 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/5ejsIE5EFww/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.
>

-- 
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 nodes unable to send report to Puppet Master running under Passenger

2013-09-23 Thread Forrie
I ran into similar problems before, which ended up being the permissions of 
the rack config.ru file -- it needs to be owned and readable by the puppet 
user -- check that?  Mine was in a path like 
/etc/puppet/rack/puppetmaster/config.ru.  

-- 
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] error when create database mysql with puppetlabs-mysql (v1.0.0)

2013-09-23 Thread Eduardo Terzella

Good evening, folks.

Using the module's puppet forge to create a database I get an error below.

Could you help me?

*puppetlabs-mysql (v1.0.0) *

*class mysql_default {*
*   
*
*mysql::db { 'mydb':*
*  user => 'root',*
*  password => '123456',*
*  host => 'localhost',*
*  grant=> ['SELECT', 'UPDATE'],*
*}*
*  *
*  *
*}*


Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Invalid parameter provider at 
/etc/puppet/environments/development/modules/mysql/manifests/db.pp:60 on 
node stfbsbpentaho02.dmz
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run




-- 
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] Announce: Puppet 3.3.1-rc1 Available

2013-09-23 Thread Moses Mendoza
**Release candidate:**

Puppet 3.3.1 has not yet been released; it entered its first release
candidate on September 23, 2013.

3.3.1 is to be a bug fix release in the Puppet 3.3 series. The focus
of the release is fixing backwards compatibility regressions that
slipped in via the YAML deprecations in 3.3.0.

**Upgrade Note**

The release of Puppet 3.3.1 will supersede the upgrade warning for
Puppet 3.3.0. As of 3.3.1, agent nodes will be compatible with all
Puppet 3.x masters with no extra configuration.


Puppet 3.3.1-rc1 Downloads
--
Source: https://downloads.puppetlabs.com/puppet/puppet-3.3.1-rc1.tar.gz

Available in native package format in the pre-release repositories at:
http://yum.puppetlabs.com and http://apt.puppetlabs.com

For information on how to enable the Puppet Labs pre-release repos, see:
http://docs.puppetlabs.com/guides/puppetlabs_package_repositories.html#enabling-the-prerelease-repos

Gems are available via rubygems at
https://rubygems.org/downloads/puppet-3.3.1.rc1.gem
  or by using `gem install --pre puppet`

Mac packages are available at
https://downloads.puppetlabs.com/mac/puppet-3.3.1-rc1.dmg

Windows packages are available at
https://downloads.puppetlabs.com/windows/puppet-3.3.1-rc1.msi

Please report feedback via the Puppet Labs Redmine site, using an
affected puppet version of 3.3.1-rc1:
https://projects.puppetlabs.com/projects/puppet/


Fixes for Backwards Compatibility Regressions in 3.3.0

## Issue 22535: puppet 3.3.0 ignores File ignore in recursive copy
## Issue 22608: filebucket (backup) does not work with 3.3.0 master
and older clients
## Issue 22530: Reports no longer work for clients older than 3.3.0
when using a 3.3.0 puppet master

New backward compatibility issues were discovered after the release of
3.3.0, so we changed our handling of deprecated wire formats.

Starting with 3.3.1, you do not need to set additional settings in
puppet.conf on your agent nodes in order to use newer agents with
puppet masters running 3.2.4 or earlier. Agents will work with all 3.x
masters, and they will automatically negotiate wire formats as needed.
This behavior supersedes the behavior described for 3.3.0; the
report_serialization_format setting is now unnecessary.

Additionally, this release fixes two situations where 3.3.0 masters
would do the wrong thing with older agents. (Reports would fail unless
the master had report_serialization_format set to yaml, which was not
intended, and remote filebucket backups would always fail.)


Miscellaneous Regression Fixes
---
## Issue 22384: Excessive logging for files not found

This was a regression in 3.3.0.

When using multiple values in an array for the file type's source
attribute, Puppet will check them in order and use the first one it
finds; whenever it doesn't find one, it will log a note at the "info"
log level, which is silent when logging isn't verbose. In 3.3.0, the
level was accidentally changed to the "notice" level, which was too
noisy.

## Issue 22529: apt package ensure absent/purged causes warnings on 3.3.0

This was a regression in 3.3.0. The apt package provider was logging
bogus warnings when processing resources with ensurevalues of absent
or purged.

## Issue 22493: Can't start puppet agent on non english Windows

This was a regression in 3.2.4, caused by a bug in one of the Ruby
libraries Puppet relies on. We submitted a fix upstream, and packaged
a fixed version of the gem into the Windows installer.


Fixes for Long-Standing Bugs
---
## Issue 19994: ParsedFile providers do not clear failed flush
operations from their queues

This bug dates to Puppet 2.6 or earlier.

The bug behavior was weird. Basically:

Your manifests include multiple ssh_authorized_key resources for
multiple user accounts.
One of the users has messed-up permissions for their authorized keys
file, and their resource fails because Puppet tries to write to the
file as that user.
All remaining key resources also fail, because Puppet tries to write
the rest of them to that same user's file instead of the file they
were supposed to go in.

## Issue 21975: Puppet Monkey patch 'def instance_variables' clashing
with SOAP Class...

This bug dates to 3.0.0. It was causing problems when using plugins
that use SOAP libraries, such as the types and providers in the
puppetlabs/f5 module.

## Issue 22474: --no-zlib flag doesn't prevent zlib from being
required in Puppet

This bug dates to 3.0.0, and caused Puppet to fail when running on a
copy of Ruby without zlib compiled in.

## Issue 22471: Malformed state.yaml causes puppet to fail runs with
Psych yaml parser

This bug dates to 3.0.0, and could cause occasional agent run failures
under Ruby 1.9 or 2.0.


Puppet 3.3.1-rc1 Contributors
--
Andrew Parker, Josh Cooper, Josh

Re: [Puppet Users] Using file and mount more efficiently

2013-09-23 Thread Forrie
I've been playing around with this code and have encountered several 
errors.   As noted below, there is going to be an issue with /home; 
however, I thought I could get around that by declaring that /first/, which 
won't work -- as it complains about duplicate declarations of /home.




class nfs_mounts_prod {

define nfs_mounts {

$server  = "ourserver.com"
$options = 
"tcp,rw,hard,intr,vers=3,tcp,rsize=32768,wsize=32768,bg"

# These needed to be defined here, it would not work 
outside of the class definition
$prod_mounts = [
'201301',
'201301pod',
]

file { "/home":
ensure => directory,
owner  => "root",
group  => "root",
mode   => "0755",
}

file { "/home/${name}":
ensure => directory,
owner  => "16326",
group  => "90",
mode   => "0755",
require => File["/home"],
} # file

mount { "/home/${name}":
device   => "${server}:/export/prod/${name}",
atboot   => yes,
fstype   => nfs,
options  => "${options}",
name => "/home/${name}",
ensure   => mounted,
remounts => true,
pass => "0",
require  => File["/home/${name}"],
} # mount

} # nfs_mounts

nfs_mounts { $prod_mounts: }

} # class nfs_mounts_prod


Can you tell me what's wrong -- or if this is even going to work :-)


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] augeas question

2013-09-23 Thread Greg Coit
Nathan,

Thanks for the response - I did not know about inifile.

I unfortunately seem to be having trouble with ini_setting - the following 
causes a new line to be added every time puppet gets run:

  ini_setting { 'anonymous_enable':
path=> '/etc/vsftpd/vsftpd.conf',
setting => 'anonymous_enable',
value   => 'NO',
ensure  => present,
  }

  ini_setting { 'chroot_local_user':
path=> '/etc/vsftpd/vsftpd.conf',
setting => 'chroot_local_user',
value   => 'YES',
ensure  => present,
  }

BTW, still playing with augeas too - the most recent code is:

  augeas { 'vsftpd.conf':
context   => '/files/vsftpd/vsftpd.conf',
incl  => '/etc/vsftpd/vsftpd.conf',
load_path => '/usr/share/augeas/lenses/dist/',
lens  => 'vsftpd',
changes   => [ 'set anonymous_enable NO', 'set chroot_local_user YES', 
],
  }

Turns out that augeas has an unwelcome behavior - it tries to load all 
files that match the lens - if any are non-standard, it errors out.  

Greg

On Monday, September 23, 2013 3:00:36 PM UTC-7, Nathan Valentine wrote:
>
> Greg, 
>
> I believe resource ini_setting would be appropriate here but I do 
> understand the desire to learn about Puppet + Augeas. 
>
> >   augeas { 'vsftpd.conf':
> > context => '/etc/vsftpd/vsftpd.conf',
> > changes => [ 'set anonymous_enable=NO', 'set chroot_local_user=YES', 
> ],
> > require => File['/etc/vsftpd/vsftpd.conf'],
> >   }
>
>
> context => '*/files*/vsftpd/vsftpd.conf',
>
> ?
>
> I'm lazy and haven't tested with a Puppet apply but I think this might 
> just be an issue of understanding the namespace-y Augeas stuff. You can 
> test like so with augtool:
>
> $ augtool ls */files*/vsftpd/vsftpd.conf
>
> -- 
> ---
> Nathan Valentine - nat...@puppetlabs.com 
> Puppet Labs Professional Services
> GV: 415.504.2173
> Skype: nrvale0
>

-- 
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] One node and several environments

2013-09-23 Thread Denmat
Hi,

In this case I would call puppet from cron and pass the environment var there.

There maybe better alternatives.

Den

On 24/09/2013, at 4:03, kay kay  wrote:

> I would like to use additional puppet environment for "fast response" 
> configuration and run it every minute. For that I've created new light 
> environment with only one module. But I don't know how to configure puppet 
> master manifests for one node with two environments? Is it possible?
> 
> I've found a manual 
> http://docs.puppetlabs.com/guides/environment.html#configuring-environments-for-agent-nodes
>  Is it what I need? I suppose that one node in several manifests could cause 
> an error.
> 
> P.S. Puppet 2.7
> -- 
> 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.

-- 
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] augeas question

2013-09-23 Thread Nathan Valentine
Greg,

I believe resource ini_setting would be appropriate here but I do
understand the desire to learn about Puppet + Augeas.

>   augeas { 'vsftpd.conf':
> context => '/etc/vsftpd/vsftpd.conf',
> changes => [ 'set anonymous_enable=NO', 'set chroot_local_user=YES',
],
> require => File['/etc/vsftpd/vsftpd.conf'],
>   }


context => '*/files*/vsftpd/vsftpd.conf',

?

I'm lazy and haven't tested with a Puppet apply but I think this might just
be an issue of understanding the namespace-y Augeas stuff. You can test
like so with augtool:

$ augtool ls */files*/vsftpd/vsftpd.conf

-- 
---
Nathan Valentine - nat...@puppetlabs.com
Puppet Labs Professional Services
GV: 415.504.2173
Skype: nrvale0

-- 
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] augeas question

2013-09-23 Thread Greg Coit
Hello,

I'm trying to learn how to use augeas in puppet.  One of the packages we 
have puppet installing is vsftpd.  Rather than putting the vsftpd conf file 
in puppet (in case the config file is updated by the upstream maintainers) 
I'd like to use augeas to make sure the correct lines exist in the config 
file.

Currently, the default vsftpd config file contains the following 21 lines 
(among others of course):

anonymous_enable=YES
#chroot_local_user=YES

I'd like to change this to:

anonymous_enable=NO
chroot_local_user=YES

I have the following in a module:

  #vsftpd
  package { 'vsftpd':
ensure => installed,
  }

  file { '/etc/vsftpd/vsftpd.conf':
ensure  => file,
mode=> 600,
require => Package['vsftpd'],
  }

  augeas { 'vsftpd.conf':
context => '/etc/vsftpd/vsftpd.conf',
changes => [ 'set anonymous_enable=NO', 'set chroot_local_user=YES', ],
require => File['/etc/vsftpd/vsftpd.conf'],
  }

But I'm having no luck changing either line.

Any suggestions are welcome - thanks!

Greg

-- 
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] Issue with starting puppetmaster service

2013-09-23 Thread Denmat
Hi,
Start puppet master in --nodaemonize mode

puppet master --nodaemonize --verbose (or --debug)

That might give you an idea of your problems.

Den

On 23/09/2013, at 3:32, V  wrote:

> 
> HI 
> 
> I have installed puppet on a RHEL 6.x machine.
> 
> When I try to start the puppet master service, it fails and when I check 
> status it says - "puppet dead but subsys locked".
> 
> [root@testvm init.d]# service puppet status
> puppet (pid  13304) is running...
> [root@testvm init.d]# service puppetmaster status
> puppet dead but subsys locked
> [root@testvm init.d]#
> 
> I can see that this error message is posted across the internet but unable to 
> find what the resolution would be to sort this out.
> 
> Any help would be much appreciated. Cheers
> 
> -- 
> 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.

-- 
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] I tried installing puppet on windows 7 32 bit machine but received an error as service 'puppet agent' (pe-puppet) failed to start.verify that you have sufficient privileges to start

2013-09-23 Thread Josh Cooper
On Mon, Sep 23, 2013 at 1:05 AM, Swetha Meti  wrote:

> hi,
>
> I tried installing puppet on windows 7 32 bit machine but received an
> error as service 'puppet agent' (pe-puppet) failed to start.verify that you
> have sufficient privileges to start the services
>
> --
> 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.
>

Are you running on a non en-us system? If so, this is
https://projects.puppetlabs.com/issues/22493. We will be releasing 3.3.1
RC1 soon, please give that a try and make sure it resolves the issue you
are seeing.

Josh

-- 
Josh Cooper
Developer, Puppet Labs

-- 
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: config print seems to be broken

2013-09-23 Thread John Julien


On Monday, September 23, 2013 10:02:18 AM UTC-5, Brandon Metcalf wrote:
>
> OK, thanks.  Based on the doc, it looks like if I have a host that acts as 
> a master and agent and the [master] and [agent] sections contain different 
> values for environment, then there is no way to get "puppet config print 
> environment" to print the value from the [agent] section.
>
>
> This actually used to works in 2.7.x by running "puppet config print 
environment --mode agent"

The --mode option was removed and replaced with --run_mode in 3.x
https://github.com/jjulien/puppet/commit/f4e229ee5a0a1d6a62735eb434eb2c284b7f517d#diff-022bd17388c88fcad57e6f36fff407fb
as a result of some concerns expressed in 
https://projects.puppetlabs.com/issues/16189

This does not appear to be working though, as an error is thrown when 
--run_mode is being specified and the bootstrapping of the run to a default 
of "agent" also does not appear to be functioning properly.

You may want to use an iniparser to gather this info until the bug can be 
fixed.  Another option is to use the following ruby code:

require 'puppet'
app = Puppet::Application::Agent.new()
app.preinit
Puppet.settings.parse
Puppet[:daemonize] = false
app.setup

# You can now access your [agent] config settings like so:
puts "Agent environment: #{Puppet[:environment]}"

This works fine on a normal functioning puppet client.  One bug that will 
cause an endless loop for you is if your certificate and private key don't 
match.  Probably quite the corner case for most, but I'm in the middle of 
some rigorous testing around Puppet monitoring and have come across that 
situation.



-- 
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: Using file and mount more efficiently

2013-09-23 Thread Forrie
If Puppet were to manage /home/something, an NFS mount, and ensure it's 
mounted... it would automatically look to see if both /home and / were also 
mounted?   

In most cases, on our older systems, /home is actually just on / -- a full 
partition that sits on a raid5 layer.   So, at best, Puppet would just get 
a standard error that / and /home are already present and mounted.

What I'm concerned about is:

- Ensuring the directories are present, with correct permissions and 
ownership

- Ensuring that the NFS mount is active and available  (possibly send out 
an error vis syslog if not)

- NOT causing some bizarre cascade of mount issues by Puppet repeatedly 
attempting to fix something it cannot, in the case of an error that 
requires manual intervention.

Our environment is growing substantially, to the point where manually 
editing fstab is becoming a real PITA, and also creates an environment for 
inconsistencies (and minor typos).   So I really need Puppet to manage 
those mounts.

I'm not sure I would need automounter for these.   



Thanks!




On Friday, September 20, 2013 9:30:35 AM UTC-4, jcbollinger wrote:
>
>
>
> On Thursday, September 19, 2013 1:43:07 PM UTC-5, Forrie wrote:
>>
>> This is something I've been concerned about -- and how to properly 
>> approach this.
>>
>> For example, we can use Puppet to ensure that the directories (mount 
>> points) exist and that the entries are present in /etc/fstab -- but I grow 
>> very concerned about automating the NFS-mount part of this.
>>
>> I don't think we'd want to use autofs, as the namespace isn't visible 
>> unless you "cd" directly into it.   We nixed this idea with /home, for 
>> example.
>>
>
>
> A nitpick: you don't specifically have to "cd" into an automounted 
> filesystem to get it mounted; any access at all to the mount point itself 
> or any child path will do ('ls', fopen(3), I/O redirection, etc.).  A child 
> path works to get the filesystem mounted even if it doesn't actually 
> correspond to a real file.
>
> In a few places I use symlinks to automounted directories.  The symlinks 
> provide visibility in the expected location, but I get all the goodness of 
> automounting (however much that may or may not be).
>
>  
>
>>
>> What would be the safest ideal way to approach this?
>>
>>
>
> It's not clear what exactly you hope to achieve.  Is it different from 
> what declaring a Mount with ensure => 'present' will do (which is to ensure 
> the fs is listed in fstab without managing whether it is mounted)?
>
> You cannot get around the fact that it is impossible to see or touch the 
> mount point directory underneath a mounted filesystem.  Any access to the 
> mount point path refers to the root of the mounted filesystem instead.  
> That is a matter of fundamental Unix architecture, quite outside Puppet's 
> scope.
>
>
> 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] Module team update: 2013-09-04 - 2013-09-23

2013-09-23 Thread Ashley Penney
I am terrible at getting these out on schedule.

Another busy month with a whole bunch of stuff going on, internally and
externally.  The main highlights of the month are the recently rewritten
puppetlabs-mysql and puppetlabs-postgresql modules.  Both have had huge
overhauls internally and are now (hopefully) vastly more useful for end
users.

*What did you guys do to my databases?*
*
*
I'm going to selfishly talk about puppetlabs-mysql first as I'm about to
refactor in my changes today.  Over the last month I've done two large
things for the MySQL module.

First, I've written replacement types and providers for the venerable mysql
providers that have been floating around for Puppet modules for years now.
 (First provider I ever modified for internal use, in the distant past)
 These replacements are called mysql_grant, mysql_user, and mysql_database
and hopefully represent a reasonable set of improvements.  The major thing
I wanted was to allow them to work with puppet resource so that from the
cli you can do:

# puppet resource mysql_user blah@host ensure=absent and have things work.
 This was mostly for selfish reasons as I can never remember the syntax to
add users.

Second, I've refactored the module substantially.  Previously we relied on
enormous numbers of parameters in an attempt to manage /etc/.my.cnf and we
constantly received pull requests to add new parameters.  The new module
blows all this away and allows you to do:

mysql::globals {
  override_options => { 'mysqld' => 'max_connections' => '256' }
}

You can feed it any my.cnf options you want and they will magically appear.
 It has some downsides in that we can't validate what you put into my.cnf
by allowing you to set any keys, but there's a few thousand possible
entries to my.cnf and it's not realistic for us to handle them all.

I'm thinking long term we'll pull certain key values out into parameters
like before and just merge those into the hash used to write out .my.cnf.

*And postgresql?*
*
*
Ken Barber completely rewrote this to be much more flexible than before and
to use a type/provider to build up the configuration, allowing you to just
drop in configuration resources easily.  I won't talk as much about this
here as I don't have a full a picture of it as I do for mysql but it's in
the master branch of puppetlabs-postgresql right now and available for
testing.

*What modules did you release since the last update?*
*
*
http://forge.puppetlabs.com/puppetlabs/ntp/2.0.1
http://forge.puppetlabs.com/puppetlabs/apache/0.9.0
http://forge.puppetlabs.com/puppetlabs/postgresql/2.5.0
http://forge.puppetlabs.com/puppetlabs/pe_upgrade/2.0.0
http://forge.puppetlabs.com/puppetlabs/git/0.0.3
http://forge.puppetlabs.com/puppetlabs/firewall/0.4.2
http://forge.puppetlabs.com/puppetlabs/apt/1.3.0

And some from other teams worth mentioning:

http://forge.puppetlabs.com/puppetlabs/reboot - a type/provider to schedule
reboots (windows only for now)
http://forge.puppetlabs.com/puppetlabs/registry/0.1.2
http://forge.puppetlabs.com/puppetlabs/java_ks/1.2.0

*What else are you guys up to?*
*
*
Lots of little things!  I've been working on documentation, understanding
data-in-modules, testing (updating the vcsrepo spec tests from rspec1 to
rspec2).  Hunter's working on a huge amount of stuff from beaker
(acceptance testing) to scaling guides to more work on the apache module.

I'm sure I've missed a bunch of stuff we're doing but as always swing by
#puppet and shout at ashp (or hunter) if you want anything module related
or just want to throw us your worst "I can't figure out how to.." problems.

Thanks,

-- 
Ashley Penney
ashley.pen...@puppetlabs.com
Module Engineer

*Join us at PuppetConf 2014, September 23-24 in San Francisco*

-- 
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] One node and several environments

2013-09-23 Thread kay kay
I would like to use additional puppet environment for "fast response" 
configuration and run it every minute. For that I've created new light 
environment with only one module. But I don't know how to configure puppet 
master manifests for one node with two environments? Is it possible?

I've found a manual 
http://docs.puppetlabs.com/guides/environment.html#configuring-environments-for-agent-nodes
 
Is it what I need? I suppose that one node in several manifests could cause 
an error.

P.S. Puppet 2.7

-- 
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 nodes unable to send report to Puppet Master running under Passenger

2013-09-23 Thread Ellison Marks
Anything showing up in your logs?

On Friday, September 20, 2013 2:17:32 PM UTC-7, F. Y. wrote:
>
> Hello all,
>
> I recently switched to running puppet master using Passenger. However, I 
> am seeing agents unable to send reports after a bunch of 'master' processes 
> starting to accumulate and eat all the RAM and swap space.
>
> Error: Could not send report: Error 500 on SERVER:  "-//IETF//DTD HTML 2.0//EN">
> 
> 500 Internal Server Error
> 
> Internal Server Error
> The server encountered an internal error or
> misconfiguration and was unable to complete
> your request.
> Please contact the server administrator,
>  [no address given] and inform them of the time the error occurred,
> and anything you might have done that may have
> caused the error.
> More information about this error may be available
> in the server error log.
> 
> Apache/2.2.22 (Ubuntu) Server at puppetmaster.example.com Port 
> 8140
> 
>
> These are the 'master' processes launched:
>
> root@puppetmaster:/etc/puppet# ps aufx | grep master
> root  4352  0.0  0.0   6504   616 pts/1S+   17:07   0:00  |   
> \_ grep --color=auto master
> puppet2100 14.5  7.2 4703940 1793068 ? D15:06  17:34 master   
> 
> 
> puppet2145  4.4  7.6 4434900 1893028 ? D15:08   5:17 master   
> 
> 
> puppet2156  3.4  8.0 7484288 1986164 ? D15:08   4:08 master   
> 
> 
> puppet2182  2.9  8.7 3612508 2169308 ? D15:08   3:29 master   
> 
> 
> puppet2191  4.0 10.7 4893500 2661364 ? D15:08   4:49 master   
> 
> 
> puppet2200 24.8 16.0 12025276 3953904 ?D15:08  29:39 master   
> 
> 
> puppet3585  0.1  0.3 178984 81944 ?S16:08   0:06 master   
> 
> 
> puppet3603  0.2  0.3 178892 88320 ?S16:08   0:07 master   
> 
> 
> puppet3612  0.1  0.3 178196 84316 ?S16:08   0:03 master 
>
> Puppet Master is running on Ubuntu 12.04, and is running Puppet 3.3.0.
>
> Can anyone please advise how to troubleshoot this? I am at my wit's end 
> here.
>
> Thanks.
>
> F.
>

-- 
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] module customization + using foreman 1.2 + puppet 3.0

2013-09-23 Thread shyam sundar Keshari
Hi All,

I have installed ssh module by command:

 puppet module install saz/ssh

and it's configured for production server .

But I am not able to configure sshd_config file for each host separately .

How can I define specific source file for specific host using foreman

Thanks in Advance

-- 
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] USing forman 1.2 + puppet 3.0

2013-09-23 Thread shyam sundar Keshari
Hi All,

I have install saz/ssh module .Now I have to use file like sshd_config to
configure

puppet client and issue is that I have to use different sshd_config for
each host

and similarly different ntp file for most of host .

In foreman I can see the option for example, force same configuration like
ntp to be configured to all connected puppet client from same common file
on puppet server .

Kindly guide me in this so that I can make copy of Puppet Agent original
config file like sshd_config  on master and implement individual from agent
to agent .

Thanks in Advance

-- 
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] questions about verifying template paths and variables with rspec

2013-09-23 Thread Ashley Gould
On Wed, Sep 18, 2013 at 09:52:27AM -0700, Corey Osman wrote:
> Hi,
> 
> How can I verify the template exists in the given path?  Example,
> 
> Given the following in my manifest:
> 
> if $somevar == 'true' {
>   $templatefile='mymodule/mytemplate.xml.erb'
> }
> else {
>   $templatefile='mymodule/mytemplate2.xml.erb'
> }
> file{"somefile.txt":
>   ensure => present,
>   content => template($templatefile)
> }
> 

I'm not sure how this would fit into rspec, but in my manifests I use a function
to verify templates.  Perhaps pieces of this could be adapted for your purpose.

$ cat is_template.rb
#
# adapted from has_template from https://github.com/windowsrefund/puppet-tools
#
Puppet::Parser::Functions::newfunction(
  :is_template,
  :type => :rvalue,
  :doc => "Returns true if argument translates to a valid template.") do |args|

  require 'rubygems'
  require 'puppet'

  if value = 
Puppet::Parser::Files.find_template(args[0],lookupvar('environment'))
return FileTest.exist?(value)
  end

  nil

end



> 
> How can I test that the template file exists in the given module path?
> 
> File.exists?("../../../#{templatefile}").should be_true ???
> 
> Additionally can I test if the variable $templatefile or $somevar is correct 
> and my logic is sane.  Is there a way to retrieve the manifest variables 
> within spec tests?
> 
> example:
> 
>   $somevar.should eq('true') ???
> 
> 
> 
> Corey
> 
> 
> -- 
> 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.

-- 

-ashley

If a new user has a bad time, IT'S A BUG!

-- 
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: Facter value at Catalog compilation

2013-09-23 Thread jcbollinger


On Thursday, September 19, 2013 4:23:15 PM UTC-5, Frederiko Costa wrote:
>
> Hi,
>
> I've got a facter shipped with a custom module. This factor returns the 
> version of a determined package. It returns nil if the package is not 
> installed yet.
>
> When running for the first time, assuming the package is not installed, 
> the facter will be still nil. When referring to that facter in the manifest 
> - for example in a file resource - it fails, because it has been compiled 
> with a nil value. When the package is already installed, it works great.
>
> Just out of curiosity, is there any workaround other than if/else 
> statements?
>
>

Like what?  Puppet has more conditional statements than just if/else, but 
I'm having trouble seeing how you imagine being able to handle a special 
case such as you describe without using any of them.

Were you also seeking advice about your bootstrapping problem?  If so, then 
it would be helpful to have some information about how your custom fact is 
used, and more generally what your module is trying to accomplish.


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] Re: config print seems to be broken

2013-09-23 Thread Dan White
It still works this way: 

[root ~]# puppet agent --configprint ssldir 
/var/lib/puppet/ssl 
[root ~]# puppet master --configprint ssldir 
/var/lib/puppet-master/ssl 

as opposed to: 

[root ~]# puppet config print ssldir 
/var/lib/puppet/ssl 


“Sometimes I think the surest sign that intelligent life exists elsewhere in 
the universe is that none of it has tried to contact us.” 
Bill Waterson (Calvin & Hobbes) 

- Original Message -
From: "John Julien"  
To: puppet-users@googlegroups.com 
Sent: Monday, September 23, 2013 12:03:08 PM 
Subject: [Puppet Users] Re: config print seems to be broken 




On Monday, September 23, 2013 10:02:18 AM UTC-5, Brandon Metcalf wrote: 


OK, thanks. Based on the doc, it looks like if I have a host that acts as a 
master and agent and the [master] and [agent] sections contain different values 
for environment, then there is no way to get "puppet config print environment" 
to print the value from the [agent] section. 






This actually used to works in 2.7.x by running "puppet config print 
environment --mode agent" 

The --mode option was removed and replaced with --run_mode in 3.x 

https://github.com/jjulien/puppet/commit/f4e229ee5a0a1d6a62735eb434eb2c284b7f517d#diff-022bd17388c88fcad57e6f36fff407fb
 
as a result of some concerns expressed in 
https://projects.puppetlabs.com/issues/16189 

This does not appear to be working though, as an error is thrown when 
--run_mode is being specified and the bootstrapping of the run to a default of 
"agent" also does not appear to be functioning properly. 

You may want to use an iniparser to gather this info until the bug can be 
fixed. Another option is to use the following ruby code: 

require 'puppet' 
app = Puppet::Application::Agent.new() 
app.preinit 
Puppet.settings.parse 
Puppet[:daemonize] = false 
app.setup 

# You can now access your [agent] config settings like so: 
puts "Agent environment: #{Puppet[:environment]}" 

This works fine on a normal functioning puppet client. One bug that will cause 
an endless loop for you is if your certificate and private key don't match. 
Probably quite the corner case for most, but I'm in the middle of some rigorous 
testing around Puppet monitoring and have come across that situation. 





-- 
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 . 

-- 
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] 3.3.0 bug? Could not prefetch package provider/UTF-8

2013-09-23 Thread jcbollinger


On Saturday, September 21, 2013 4:30:53 AM UTC-5, Robin Powell wrote:
>
>
> No, although I appreciate the attempt! 
>
> [rlpowell@shell01 puppet3]$ find . -type f -name '*.pp' | xargs grep -P 
> '[^\s\t!-~]' 
> [rlpowell@shell01 puppet3]$ 
>
> (that range covers all of visible ASCII, plus space and tab) 
>
> In fact, the only file that matches that that isn't obviously binary 
> is ./modules/stdlib/lib/puppet/parser/functions/shuffle.rb 
>
> Fixing that file does not fix the problem. 
>
> Any further ideas, anybody? 
>
>

Perhaps you have an installed package with a non-ASCII character in its 
name, version code, or release code.


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: config print seems to be broken

2013-09-23 Thread Brandon Metcalf
OK, thanks.  Based on the doc, it looks like if I have a host that acts as 
a master and agent and the [master] and [agent] sections contain different 
values for environment, then there is no way to get "puppet config print 
environment" to print the value from the [agent] section.


On Monday, September 23, 2013 4:47:45 AM UTC-5, Rahul Khengare wrote:
>
> Hi Brandon,
> puppet config print option print the environment variable of [main] 
> section only it is not overridden by another config block.
> Check the config block of environment variable present in puppet.conf file.
>
> Read following documentation of puppet on environment,
> http://docs.puppetlabs.com/guides/environment.html
>   
> Thanks and Regards,
> Rahul Khengare,
> NTT DATA OSS Center, Pune, India.
>
>
> On Saturday, September 21, 2013 2:44:41 AM UTC+5:30, Brandon Metcalf wrote:
>>
>> Am I missing something or is this behavior broken:
>>
>> $ puppet -V
>> 3.2.3
>> $ grep environment /etc/puppet/puppet.conf
>> environment = bmetcalf
>> $ puppet config print environment
>> production
>>
>> 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.


[Puppet Users] Re: Copy a "/a/path/foo" file from node1 to node2 in "/another/path/bar"

2013-09-23 Thread jcbollinger


On Friday, September 20, 2013 10:10:13 PM UTC-5, François Lafont wrote:
>
> Just one precision... 
>
> Le 21/09/2013 04:27, François Lafont wrote : 
>
> > Is it possible with Puppet to copy the file: 
> > 
> > /a/path/foo# <-- in node-source 
> > 
> > from "node-source" to "node-destination", but with a different path.



The "different path" bit is not really a differentiator here.  The issue is 
the same whether the local and remote paths are the same or different.

 

> By example: 
> > 
> > /another/path/bar  # <-- in node-destination 
> > 
> > I know it's possible with exported files when the path is the same in 
> node-source and node-destination but here the paths are different. 
>
>

No, it's not possible with exported File resources.

 

> I thought this code could work: 
>
> For node-source 
>
> @@file {'/another/path/bar': 
>   path   => "/another/path/bar", 
>   source => "/a/path/foo", 
>   tag=> "exported", 
>   #... 
> } 
>
> and for node-destination 
>
> File <<| tag == "exported" |>> 
>
> but it doesn't work because [source => "/a/path/foo"] uses the 
> "/a/path/foo" file of node-destination (if exists), not the /a/path/foo 
> file of note-source. 
>


Yes.  "Exported resources" are more precisely described as exported 
resource *declarations*.  They do not capture any actual resource.  Under 
some circumstances, an exported resource might still be a viable tool for 
this task, but not the particular one you tried to use.

There is a fundamental design question that you must settle straight off: 
do you intend that the destination node(s) obtain the fail directly from 
the source node (in which case you will need to use an Exec resource), or 
indirectly via the master (in which case you will use a File)?

Next, you must consider whether the destination node needs any information 
that can only be obtained (semi-)dynamically from the source node.  For 
instance, will the file's source path vary depending on the source node's 
facts?  Is the imperative for the target node to have a copy of the file at 
all dependent on the source node?  These questions will help you determine 
whether you need an exported resource or whether an ordinary one would be 
sufficient.  Only if the resource parameters or the simple existence of a 
declaration at all depend in some way on the source node's facts do you 
need an exported resource.  Under all other circumstances an ordinary 
resource is viable and preferable.

Third, you should be mindful that Puppet is a state management service, not 
a script engine.  As such, it is much to your advantage to frame your 
objective in terms of the state you want Puppet to achieve and maintain: 
that the destination file is a duplicate of the source file.  In 
particular, it is to your advantage to avoid doing any unnecessary 
copying.  You will get that for free if you can use a File resource, but 
you may need to work for it if you have to use an Exec.  Getting this right 
can have broader impact than just the efficiency of your Puppet runs.

There are two many variables here for me to give you a specific solution 
that I am confident will fit your needs, but here's an example.  I suppose 
that your list of source nodes is difficult or impossible for the master to 
determine directly, so that exported resources are appropriate; that it is 
desirable for the master to mediate the file exchange, so that the type of 
the exported resource will be File; and that the content of each of the 
files involved is small.  In that case, you could do this:

   - Create a custom fact 'foo_content' with which nodes will report the 
   contents of /a/path/foo to the master
   - Have the relevant source nodes export appropriate file resources, like 
   so:

@@file { "/another/path/${::hostname}":
  ensure  => file,
  content => ${::foo_content},
  tag => 'foo_files',
  # other parameters as appropriate
}

   - Have the destination node(s) import the results.

That's pretty close to what you were trying; most of the other alternatives 
diverge more.


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: Copy a "/a/path/foo" file from node1 to node2 in "/another/path/bar"

2013-09-23 Thread jcbollinger


On Monday, September 23, 2013 10:01:45 AM UTC-5, jcbollinger embarrassed 
himself with:
>
>
> do you intend that the destination node(s) obtain the fail directly from 
> the source node
>


I mean the "file" of course.



> There are two many variables [...]
>
>

Ugh.  "too many", naturally.


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: symlink creation using facter, but facter is nil at first run.

2013-09-23 Thread jcbollinger


On Friday, September 20, 2013 10:30:46 PM UTC-5, Frederiko Costa wrote:
>
> Hi all,
>
> I'm trying to find a better way to implement this, but I can't think of. I 
> have a jdk module that requires to create a symlink to whatever version is 
> the one installed. Say I install jdk-6u35, it will create something like 
> /usr/java/jdk_1.6.35. I would like to create a symlink /usr/java/jdk whose 
> target would be /usr/java/jdk_1.6.35.
>
> The point here isn't to ask how to create the symlink - that's 
> straightforward. I'm in a chicken-egg problem. I'm sure there's got a 
> better and easier way to do this that I can't think of. 
>
> I wrote a facter to report the jdk version running. Based on the string 
> returned by the facter, it works great. However, I jdk is not installed, 
> this facter returns nil - the catalog is compiled and the value was nil at 
> compilation time - and the file resource, property target, fails. I bypass 
> this with an if clause and everything runs fine because jdk is already 
> there and the symlink will be created. I know I could tell my facter to 
> return something else (actually I create a link to latest, and that works, 
> but it's a poor's man solution).
>
> Have any you run into this situation? Any suggestion? Not convinced if 
> facter is the way to go in this particular case.
>
>

Facts are THE way to communicate information about the current state of 
your nodes to the master to inform catalog compilation.  If you have a 
chicken & egg problem then it is not facter's fault, it is yours: your 
custom fact is not suitable for the use to which you are trying to put it.  
Evidently, it determines the JDK version by a mechanism that depends on the 
symlink you described, and clearly such a fact cannot be used to direct the 
form of the symlink.

You have at least two options:

   1. Come up with a better way to determine which JDK is installed.  For 
   example, if you are installing the JDK via your system's packaging system 
   (yum / apt / etc.) then your custom fact could querythe package manager to 
   extract the information you want.
   2. Instead of inquiring which JDK version is installed, you could choose 
   what version you want to be installed, and have Puppet make it so.


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] Re: Puppet calls the ENC twice for some nodes.

2013-09-23 Thread jcbollinger


On Friday, September 20, 2013 12:05:17 PM UTC-5, Greg Sutcliffe wrote:
>
> Is this puppet3? As I recall, in puppet3, the master makes a separate call 
> to the enc to determine the environment the should authoritatively be in. 
> Once that's established, it makes a second call to get the classes and 
> parameters.
>

Not exactly, but that may well be the right track.  It would be pointless 
for the master to run the ENC more than once for catalog compilation, for 
it would have no reason to expect that the ENC's output would change.  
HOWEVER, the master's file server may need to run the ENC again to 
determine the environment from which to serve 'source'd files.


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: Execute Mono exe that depends on an environment variable

2013-09-23 Thread jcbollinger


On Friday, September 20, 2013 3:18:20 PM UTC-5, Derek Strickland wrote:
>
> I have a script that I execute to run a mono exe during a setup process. 
>  I would like to automate that with puppet but the exe depends on an 
> environment variable being set or it will fail.  My setup.sh file looks 
> like this.  
>
> export MY_ENV_VAR=$HOME/target_dir
> /usr/mono/bin/mono $HOME/path_to_exe/Setup.exe
>
> this fails because well $HOME is meaningless in a puppet context.  Here's 
> is what I would like to do.
>
> exec { 'myscript':
> command => "/bin/sh /some_path/scripts/setup.sh", 
> }
>
> I can't change the mono exe to not rely on special environment variable. 
>  That isn't an option.  
>
> So in summary I need to be able to set a special env variable for the exec 
> context and I have to be able to dynamically change the path to the exe 
> because each users home directory will be different.  I searched for a 
> while but now my eyes are just crossed. 
>
> Any ideas?
>
>

This is what the "environment" parameter of the Exec resource type is for.


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] Vagrant+Puppet using RVM to install Apache2+Passenger fails

2013-09-23 Thread Christian
Hi all,

hope to be on the right place here..

I'm playing with Vagrant and Puppet for a small Apache2+Passenger Server 
above ubuntu-precise-32. I like to get this working for a small group of 
developers.

I confess, I didn't read the whole documentation about puppet, but I've 
browsed the whole Internet twice! ...about this problem. I only want to 
get this small environment working at the moment, so I don't want to spend 
much time in reading and coding examples. Maybe some of you can help me a 
bit.

The manifest is working so far, but the Installation of passenger fails 
with this error:

notice: 
/Stage[main]/Rvm::Passenger::Apache::Ubuntu::Post/File[/etc/apache2/mods-enabled/passenger.load]/ensure:
 
created
err: /Stage[main]/Apache::Service/Service[httpd]: Failed to call refresh: 
Could not start Service[httpd]: Execution of '/etc/init.d/apache2 start' 
returned 1:  at /tmp/vagrant-puppet/modules-0/apache/manifests/service.pp:28
notice: 
/Stage[main]/Install-rvm/Rvm_gem[ruby-1.9.3-p448@mygemset/ruby-hmac]/ensure: 
created
notice: /Stage[main]/Postconfig/Exec[use-rubyver]/returns: executed 
successfully
notice: /Stage[main]/Postconfig/Exec[gemset-use]/returns: executed 
successfully
err: /Stage[main]/Postconfig/Exec[passenger-install-apache]/returns: change 
from notrun to 0 failed: rvm gemset use mygemset && 
passenger-install-apache2-module --auto returned 1 instead of one of [0] at 
/tmp/vagrant-puppet/manifests/development.pp:62

The passenger-install-apache2-module command runs smoothly if I fire it in 
a shell on the vagrant box. I think thats the problem for the first error. 
Apache cannot start because of the missing module.

The manifest I use is this:
http://pastie.org/private/xcsmy8b6lwivymegeqcrrw

Thanks in advance!

Chris


-- 
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: enablerepo option

2013-09-23 Thread puppetstan
Hi

This configuration is not good if fusioninventory-agent is installed and 
puppet want to verify the latest version because yum command option is 
"install" and not "update" . This configuration is only good if 
fusioninventory-agent is not installed.

exec { 'fusioninventory-agent':
 command => 'yum -y *install *fusioninventory-agent --enablerepo=*',
 path => '/usr/bin',
}

package { 'fusioninventory-agent':
 ensure => latest,
require => Exec['fusioninventory-agent'],
}



This configuration is not good if fusioninventory-agent is not installed 
and puppet want to verify fusioninventory-agent is present  because yum 
command option is "update" and not "install" . This configuration is only 
good  if fusioninventory-agent is installed.

exec { 'fusioninventory-agent':
 command => 'yum -y *update *fusioninventory-agent --enablerepo=*',
 path => '/usr/bin',
}

package { 'fusioninventory-agent':
 ensure => latest,
require => Exec['fusioninventory-agent'],
}

What is the solution, an idea?

Regards




Le vendredi 13 septembre 2013 17:23:32 UTC+2, puppetstan a écrit :
>
> Hi
>
> I would like to use enablerepo option for activate repo and verify package 
> latest version
>
> my manifest :
>
> package { "fusioninventory-agent": ensure => latest, enablerepo => [ 
> "epel", "remi" ]; }
>
> there this patch : http://projects.puppetlabs.com/issues/2247 but it does 
> not work in my configuration
>
> Can you have the same problem or an other solution to activate multiple 
> rpm repo with enablerepo command?
> 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.


Re: [Puppet Users] leiningen version for PuppetDB

2013-09-23 Thread Ken Barber
Hi Ankit,

> Can i use leiningen 1.7 for puppetDB.

I don't think so, at the very least we use profiles (not available in
1.7.x) and we have long since moved into the 2.x major revision for
most of our development work. We are generally working against
Leiningen 2.2.0 or greater these days, so I'd recommend at least that
version - but its not uncommon for us to introduce without much
fan-fare features in our project.clj that require a new version of
leiningen. So my general recommendation would be to stick with the
latest revision.

This is a build and development tool after-all, not something required
for running the PuppetDB application on a production host (ie. we
certainly don't ship it or require it for package installation
dependencies) so we are not as strict about its version as other parts
of our toolset. Not to mention its a fast moving tool and we often
want to leverage its new features.

ken.

-- 
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: config print seems to be broken

2013-09-23 Thread Rahul Khengare
Hi Brandon,
puppet config print option print the environment variable of [main] 
section only it is not overridden by another config block.
Check the config block of environment variable present in puppet.conf file.

Read following documentation of puppet on environment,
http://docs.puppetlabs.com/guides/environment.html
  
Thanks and Regards,
Rahul Khengare,
NTT DATA OSS Center, Pune, India.


On Saturday, September 21, 2013 2:44:41 AM UTC+5:30, Brandon Metcalf wrote:
>
> Am I missing something or is this behavior broken:
>
> $ puppet -V
> 3.2.3
> $ grep environment /etc/puppet/puppet.conf
> environment = bmetcalf
> $ puppet config print environment
> production
>
> 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.


[Puppet Users] I tried installing puppet on windows 7 32 bit machine but received an error as service 'puppet agent' (pe-puppet) failed to start.verify that you have sufficient privileges to start the

2013-09-23 Thread Swetha Meti
hi,

I tried installing puppet on windows 7 32 bit machine but received an error 
as service 'puppet agent' (pe-puppet) failed to start.verify that you have 
sufficient privileges to start the services

-- 
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] leiningen version for PuppetDB

2013-09-23 Thread Ankit Mittal
Dear All,

Can i use leiningen 1.7 for puppetDB.

Thanks
Ankit

-- 
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.