[Puppet Users] What is wrong with this code?

2014-08-19 Thread Marc
Hi all,

The code snippet below is an isolation of the problem I am facing.
I don't understand why this produces a duplicate declaration.
Can anyone give an explanation?

*$ cat test.pp *
*class foo { contain foo::bar }*
*class foo::bar { class { 'bar': } }*
*class bar { notify { 'hello': } }*
*include foo*

*$ puppet apply test.pp*
*Error: Duplicate declaration: Class[Foo::Bar] is already declared; cannot 
redeclare at /home/marc/test.pp:2 on node carbon.demo.lan*
*Error: Duplicate declaration: Class[Foo::Bar] is already declared; cannot 
redeclare at /home/marc/test.pp:2 on node carbon.demo.lan*

Thank you!
Marc

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/5a4b1b8f-09bf-4595-9a48-70090682fe5c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] What is wrong with this code?

2014-08-19 Thread Craig Dunn
On Tue, Aug 19, 2014 at 12:33 PM, Marc  wrote:

Hi all,
>
> The code snippet below is an isolation of the problem I am facing.
> I don't understand why this produces a duplicate declaration.
> Can anyone give an explanation?
>
> *$ cat test.pp *
> *class foo { contain foo::bar }*
> *class foo::bar { class { 'bar': } }*
> *class bar { notify { 'hello': } }*
> *include foo*
>
>
Within class foo::bar "bar" is being found in local scope (eg: it's
declaring itself).  Thats why fully qualified is always a good way to go to
be explicit about these things.  You need to explicitly require ::bar, not
bar...

class foo::bar { class { '::bar': } }

Craig


-- 
*Enviatics *| Automation and configuration management
http://www.enviatics.com | @Enviatics
Puppet Training http://www.enviatics.com/training/

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CACxdKhHbYp8M2Z%2BUXCwVXnGHRFzcb9A8E0R-wEas24feAGSFVQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] What is wrong with this code?

2014-08-19 Thread Marc
Hi Craig,

That makes sense. In fact, now I remember this is not the first time it 
bites me.
I'll stick a post-it in my forehead.

Thank you!

On Tuesday, August 19, 2014 12:55:53 PM UTC+2, Craig Dunn wrote:
>
>
>
>
> On Tue, Aug 19, 2014 at 12:33 PM, Marc 
> > wrote:
>
> Hi all,
>>
>> The code snippet below is an isolation of the problem I am facing.
>> I don't understand why this produces a duplicate declaration.
>> Can anyone give an explanation?
>>
>> *$ cat test.pp *
>> *class foo { contain foo::bar }*
>> *class foo::bar { class { 'bar': } }*
>> *class bar { notify { 'hello': } }*
>> *include foo*
>>
>>
> Within class foo::bar "bar" is being found in local scope (eg: it's 
> declaring itself).  Thats why fully qualified is always a good way to go to 
> be explicit about these things.  You need to explicitly require ::bar, not 
> bar...
>
> class foo::bar { class { '::bar': } }
>
> Craig
>  
>
> -- 
> *Enviatics *| Automation and configuration management
> http://www.enviatics.com | @Enviatics
> Puppet Training http://www.enviatics.com/training/
>
>  

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/9b641d21-c2ca-4115-a3bd-e630927359a9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Module with smart class parameter

2014-08-19 Thread jcbollinger


On Monday, August 18, 2014 4:32:50 PM UTC-5, huhm4n wrote:
>
> Hi, I am trying to create a module with smart class parameter. Actually, 
> the simple one like
>
> user { "$users":
>ensure => "present",
>uid => "$uid",
>gid => "$gid",
>}
>
>
> I want to edit these functions via gui before pushing it out. What can be 
> the solution? or can anyone give me link to the documentation on this one? 
> Thanks in advance
>


I'm not clear on what you mean by a "smart" class parameter.  Moreover, the 
example you provide is of a resource declaration, not a class definition.  
Perhaps, though, you should look into Puppet's provisions for automatic 
class parameter binding via Hiera.  You could create a GUI for your Hiera 
data, and maybe that would serve your purpose.


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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/9e2dc41d-a0ed-4619-bc60-1489fd2296d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] windows groups - append

2014-08-19 Thread Helen Paterson
Hi,

The windows agent is running puppet 3.4.2.

Thanks for letting me know, its a known issue 



On Monday, August 11, 2014 9:18:14 PM UTC+1, Rob Reynolds wrote:
>
>
>
>
> On Mon, Aug 11, 2014 at 3:01 AM, Helen Paterson  > wrote:
>
>> Hi,
>>
>> I would like puppet to add additional users to the "administrators" 
>> group, however it currently replaces the membership ( removing existing 
>> users).  How can i change this ?
>>
>>
>> class win_local_admin {
>>
>> group { 'Administrators':
>>   ensure   => present,
>>   members  => ['Administrator',
>>'domain\tc-service-account',
>>'domain\Developers',
>>'domain\puppet-sa-test',],
>>   attribute_membership => minimum;
>> }
>>
>
> It appears that PUP-2628[1] is what you are currently experiencing?  What 
> version of Puppet are you using on the windows agent(s) in question?
>
> [1]: https://tickets.puppetlabs.com/browse/PUP-2628
>  
>
>>  -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/puppet-users/7beb168a-e194-4076-ab47-c941506148c1%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Rob Reynolds
> Developer, Puppet Labs
>
> *Join us at PuppetConf 2014 , September 
> 20-24 in San Francisco*
> *Register by September 8th to take advantage of the Final Countdown 
> 
>  *
> *—**save $149!*
>  

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/b1d01b0c-f893-4d33-ba0e-d4b68e013e1e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] file_line match with spaces

2014-08-19 Thread Helen Paterson
Hi,

I cannot get the regex to work in puppet for "file_line" it work in a regex 
tool


 file_line { "applicationHost.config":
ensure  =>  'present',
path=> 
 'c:/windows/sysnative/inetsrv/config/applicationHost.config',
match   =>  '\s{1,12}  '',

however below works if i remove spaces from the file for testing

 file_line { "applicationHost.config":
ensure  =>  'present',
path=> 
 'c:/windows/sysnative/inetsrv/config/applicationHost.config',
match   =>  '  '',

the file has 12 spaces in front of the text.


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/3f4376c4-d0aa-4c73-9364-1e64483f944c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: If else statement if file exists

2014-08-19 Thread Eugene Sapozhnikov
Basicly I am looking for the syntax to use as a conditional in the if 
statement for a file exists check.

On Monday, August 18, 2014 2:45:23 PM UTC-7, Eugene Sapozhnikov wrote:
>
>
>
> I am trying to figure out a way to use a if statement to run multiple sets 
> of commands depending if one file exists, but I am unable to find any good 
> documented ways of doing this.
>
> Basic rough layout of what i would like to achieve is this:
>
> Any help on getting the correct syntax for the if statement would be 
> appreciated 
>
>
>
> if file /volumes/vol1 exists { *exec { generate_loopback_tor: command => 
> "/sbin/losetup /dev/loop6 /volumes/tor", unless => "/sbin/losetup -a| 
> /bin/grep \"/volumes/tor\"", } *
>
> *exec { generate_encrypt_tor:command => " /sbin/cryptsetup create tor 
> ",unless => "/usr/bin/test -e /dev/mapper/tor", }exec { 
> generate_mount_tor: command => "/bin/mount /dev/mapper/tor /usr/local/tor", 
> unless => "/bin/mount | /bin/grep \"/usr/local/tor\"", } }* else { exec { 
> generate_empty_file_tor: command => "/bin/dd of=/volumes/tor bs=256M 
> count=0 seek=1", unless => "/usr/bin/test -e /volumes/tor", } exec { 
> generate_loopback_tor: command => "/sbin/losetup /dev/loop6 /volumes/tor", 
> unless => "/sbin/losetup -a| /bin/grep \"/volumes/tor\"", } exec { 
> generate_encrypt_tor: command => "/bin/echo \XX\" | 
> /sbin/cryptsetup create tor /dev/loop6 -", unless => "/usr/bin/test -e 
> /dev/mapper/tor", } exec { generate_zero_tor: command => "/bin/dd 
> if=/dev/zero of=/dev/mapper/tor count=512 bs=1024", unless => "/sbin/fdisk 
> -lu | /bin/grep \"/dev/mapper/tor\"", } exec { generate_mkfs_tor: command 
> => "/sbin/mke2fs -j -O dir_index /dev/mapper/tor ", onlyif => "/sbin/parted 
> -l | /bin/grep \"Error: /dev/mapper/tor: unrecognised disk label\"", } exec 
> { generate_mount_tor: command => "/bin/mount /dev/mapper/tor 
> /usr/local/tor", unless => "/bin/mount | /bin/grep \"/usr/local/tor\"", }
>  
>
> }
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/c6c3d29f-2b80-4f8a-8547-258839c65f30%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Module with smart class parameter

2014-08-19 Thread Yanis Guenane
I've come across the word 'Smart Class' only when dealing with Foreman.

And typically Foreman would totally do what you seem to be asking for.
Take a look http://theforeman.org/

--
Yanis Guenane

On 08/18/2014 05:32 PM, huhm4n wrote:
> Hi, I am trying to create a module with smart class parameter. 
> Actually, the simple one like
> 
> user { "$users": ensure => "present", uid => "$uid", gid => "$gid",
> }
> 
> 
> I want to edit these functions via gui before pushing it out. What 
> can be the solution? or can anyone give me link to the 
> documentation on this one? 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/53F37601.6020100%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] file_line match with spaces

2014-08-19 Thread Christopher Wood
On Tue, Aug 19, 2014 at 08:01:40AM -0700, Helen Paterson wrote:
>Hi,
>I cannot get the regex to work in puppet for "file_line" it work in a
>regex tool
> file_line { "applicationHost.config":
>            ensure  =>  'present',
>            path    =>
> 'c:/windows/sysnative/inetsrv/config/applicationHost.config',
>            match   =>  '\s{1,12}            line    =>  'startMode="AlwaysRunning" managedRuntimeVersion="v4.0">',

Your line here doesn't include spaces at the start of the line. Your regex 
wants minimum 1 and maximum 12 spaces to match. The regex will never find the 
line after replacing it once, if I read this correctly.

>however below works if i remove spaces from the file for testing
> file_line { "applicationHost.config":
>            ensure  =>  'present',
>            path    =>
> 'c:/windows/sysnative/inetsrv/config/applicationHost.config',
>            match   =>  '            line    =>  'startMode="AlwaysRunning" managedRuntimeVersion="v4.0">',
>            
>the file has 12 spaces in front of the text.

If you're able to manage a single line with this string in a file with no other 
lines, that may help show what's going on?

This may assist with regexes in puppet:

https://docs.puppetlabs.com/puppet/latest/reference/lang_datatypes.html#regular-expressions

And this manifest:

if ' ' =~ /\s/ {
  notice('matches #1!')
}

if ' ' =~ /\s{1,12}/ {
  notice('matches #2!')
}

if '<' =~ /\s{1,12}/ {
  notice('matches #3!')
}

For me it only prints about the match for 1 and 2, not 3.

>--
>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 [1]puppet-users+unsubscr...@googlegroups.com.
>To view this discussion on the web visit
>
> [2]https://groups.google.com/d/msgid/puppet-users/3f4376c4-d0aa-4c73-9364-1e64483f944c%40googlegroups.com.
>For more options, visit [3]https://groups.google.com/d/optout.
> 
> References
> 
>Visible links
>1. mailto:puppet-users+unsubscr...@googlegroups.com
>2. 
> https://groups.google.com/d/msgid/puppet-users/3f4376c4-d0aa-4c73-9364-1e64483f944c%40googlegroups.com?utm_medium=email&utm_source=footer
>3. https://groups.google.com/d/optout

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/20140819160639.GA11203%40iniquitous.heresiarch.ca.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: If else statement if file exists

2014-08-19 Thread Yanis Guenane
If your file `/volumes/vol1` could be managed by Puppet somehow, you
could use if defined(File['/volumes/vol1']) as a condition.

Not sure if it is possible in your case,

--
Yanis Guenane

On 08/19/2014 12:04 PM, Eugene Sapozhnikov wrote:
> Basicly I am looking for the syntax to use as a conditional in the
> if statement for a file exists check.
> 
> On Monday, August 18, 2014 2:45:23 PM UTC-7, Eugene Sapozhnikov
> wrote:
>> 
>> 
>> 
>> I am trying to figure out a way to use a if statement to run
>> multiple sets of commands depending if one file exists, but I am
>> unable to find any good documented ways of doing this.
>> 
>> Basic rough layout of what i would like to achieve is this:
>> 
>> Any help on getting the correct syntax for the if statement would
>> be appreciated
>> 
>> 
>> 
>> if file /volumes/vol1 exists { *exec { generate_loopback_tor:
>> command => "/sbin/losetup /dev/loop6 /volumes/tor", unless =>
>> "/sbin/losetup -a| /bin/grep \"/volumes/tor\"", } *
>> 
>> *exec { generate_encrypt_tor:command => " /sbin/cryptsetup
>> create tor ",unless => "/usr/bin/test -e /dev/mapper/tor",
>> }exec { generate_mount_tor: command => "/bin/mount
>> /dev/mapper/tor /usr/local/tor", unless => "/bin/mount |
>> /bin/grep \"/usr/local/tor\"", } }* else { exec { 
>> generate_empty_file_tor: command => "/bin/dd of=/volumes/tor
>> bs=256M count=0 seek=1", unless => "/usr/bin/test -e
>> /volumes/tor", } exec { generate_loopback_tor: command =>
>> "/sbin/losetup /dev/loop6 /volumes/tor", unless => "/sbin/losetup
>> -a| /bin/grep \"/volumes/tor\"", } exec { generate_encrypt_tor:
>> command => "/bin/echo \XX\" | /sbin/cryptsetup create tor
>> /dev/loop6 -", unless => "/usr/bin/test -e /dev/mapper/tor", }
>> exec { generate_zero_tor: command => "/bin/dd if=/dev/zero
>> of=/dev/mapper/tor count=512 bs=1024", unless => "/sbin/fdisk -lu
>> | /bin/grep \"/dev/mapper/tor\"", } exec { generate_mkfs_tor:
>> command => "/sbin/mke2fs -j -O dir_index /dev/mapper/tor ",
>> onlyif => "/sbin/parted -l | /bin/grep \"Error: /dev/mapper/tor:
>> unrecognised disk label\"", } exec { generate_mount_tor: command
>> => "/bin/mount /dev/mapper/tor /usr/local/tor", unless =>
>> "/bin/mount | /bin/grep \"/usr/local/tor\"", }
>> 
>> 
>> }
>> 
>> 
> 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/53F376E1.30802%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Q: execute a working manifest with modules

2014-08-19 Thread Frans Thamura
hi all

i have a working puppet modules with init , run well on vagrant

now i want to run the modules inside my ubuntu box

and try puppet apply --modulepath=/vagrant/data/puppet/modules/ 
manifest/init.pp

but got this error
Warning: Could not retrieve fact fqdn
Error: Failed to parse template 
/vagrant/puppet/modules/tomcat/templates/tomcat-users.xml.erb:
  Filepath: /usr/lib/ruby/vendor_ruby/puppet/parser/templatewrapper.rb
  Line: 100
  Detail: No such file or directory - 
/vagrant/puppet/modules/tomcat/templates/tomcat-users.xml.erb
 at /vagrant/data/puppet/modules/tomcat/manifests/init.pp:24 on node 
vagrant-ubuntu-trusty-64


can help me?

the puppet modele are in github.com/meruvian/vagrant-puppet

i want to make exactly apps installer in my ubuntu box, same as in vagrant 
box


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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/ea9ad4d5-4aad-4310-b55c-9b46b7ec2a74%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: If else statement if file exists

2014-08-19 Thread Eugene Sapozhnikov
Yeah sadly in this case the vol1 gets created as one part of the else 
statement, so my goal is on the second run to determine if it exists to 
just encrypt it and mount it instead of going through the whole build 
procedure.

On Tuesday, August 19, 2014 9:10:26 AM UTC-7, Yanis Guenane wrote:
>
> If your file `/volumes/vol1` could be managed by Puppet somehow, you 
> could use if defined(File['/volumes/vol1']) as a condition. 
>
> Not sure if it is possible in your case, 
>
> -- 
> Yanis Guenane 
>
> On 08/19/2014 12:04 PM, Eugene Sapozhnikov wrote: 
> > Basicly I am looking for the syntax to use as a conditional in the 
> > if statement for a file exists check. 
> > 
> > On Monday, August 18, 2014 2:45:23 PM UTC-7, Eugene Sapozhnikov 
> > wrote: 
> >> 
> >> 
> >> 
> >> I am trying to figure out a way to use a if statement to run 
> >> multiple sets of commands depending if one file exists, but I am 
> >> unable to find any good documented ways of doing this. 
> >> 
> >> Basic rough layout of what i would like to achieve is this: 
> >> 
> >> Any help on getting the correct syntax for the if statement would 
> >> be appreciated 
> >> 
> >> 
> >> 
> >> if file /volumes/vol1 exists { *exec { generate_loopback_tor: 
> >> command => "/sbin/losetup /dev/loop6 /volumes/tor", unless => 
> >> "/sbin/losetup -a| /bin/grep \"/volumes/tor\"", } * 
> >> 
> >> *exec { generate_encrypt_tor:command => " /sbin/cryptsetup 
> >> create tor ",unless => "/usr/bin/test -e /dev/mapper/tor", 
> >> }exec { generate_mount_tor: command => "/bin/mount 
> >> /dev/mapper/tor /usr/local/tor", unless => "/bin/mount | 
> >> /bin/grep \"/usr/local/tor\"", } }* else { exec { 
> >> generate_empty_file_tor: command => "/bin/dd of=/volumes/tor 
> >> bs=256M count=0 seek=1", unless => "/usr/bin/test -e 
> >> /volumes/tor", } exec { generate_loopback_tor: command => 
> >> "/sbin/losetup /dev/loop6 /volumes/tor", unless => "/sbin/losetup 
> >> -a| /bin/grep \"/volumes/tor\"", } exec { generate_encrypt_tor: 
> >> command => "/bin/echo \XX\" | /sbin/cryptsetup create tor 
> >> /dev/loop6 -", unless => "/usr/bin/test -e /dev/mapper/tor", } 
> >> exec { generate_zero_tor: command => "/bin/dd if=/dev/zero 
> >> of=/dev/mapper/tor count=512 bs=1024", unless => "/sbin/fdisk -lu 
> >> | /bin/grep \"/dev/mapper/tor\"", } exec { generate_mkfs_tor: 
> >> command => "/sbin/mke2fs -j -O dir_index /dev/mapper/tor ", 
> >> onlyif => "/sbin/parted -l | /bin/grep \"Error: /dev/mapper/tor: 
> >> unrecognised disk label\"", } exec { generate_mount_tor: command 
> >> => "/bin/mount /dev/mapper/tor /usr/local/tor", unless => 
> >> "/bin/mount | /bin/grep \"/usr/local/tor\"", } 
> >> 
> >> 
> >> } 
> >> 
> >> 
> > 
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/92d21a45-52e4-497c-9992-301fc9e3b726%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] puppet dashboard not processing reports after https is enabled and shows this error message: Report processor failed: undefined method `+' for nil:NilClass

2014-08-19 Thread Juan Sierra Pons
Hi

I have been using puppet-dashboard for a long time over http without problem
Today I have configured the https creating the ssl certificate, etc.

puppetmaster, dashboard and workers have been restarted

Also I have already changed the reporturl to https on the puppet.conf
reporturl = https//dashboard.example.org:443/reports/upload

The dashboard works as expected BUT the reports are not being processed.

On the puppetmaster logs the following can be seen:
"
Aug 19 18:20:38 server3 puppet-agent[11671]: Stored state in 0.09 seconds
Aug 19 18:20:38 server3 puppet-agent[11671]: Finished catalog run in
8.66 seconds
Aug 19 18:20:40 server3 puppet-master[10313]: Report processor failed:
undefined method `+' for nil:NilClass
"
 And on the apache+passenger+puppetmaster logs the following appears:
"
server3.example.org:8140 X.X.X.X - - [19/Aug/2014:18:20:37 +0200] "GET
/production/file_metadata/modules/puppetdb/routes.yaml?links=manage&source_permissions=use
HTTP/1.1" 200 6181 "-" "-"
server3.example.org:8140 X.X.X.X - - [19/Aug/2014:18:20:39 +0200] "PUT
/production/report/server3.example.org HTTP/1.1" 200 5865 "-" "-"
"

So as far as i know the report is been pushed to the puppetmaster but
the dashboard is not able to process it

puppetmaster and puppet-dashboard are the same server with aliases:
server3.example.org
puppet -> server3.example.org
dashboard-> server3.example.org

Any idea what am I missing?

Thanks for your time

Best regards

--
Juan Sierra Pons j...@elsotanillo.net
Linux User Registered: #257202
Web: http://www.elsotanillo.net Git: http://www.github.com/juasiepo
GPG key = 0xA110F4FE
Key Fingerprint = DF53 7415 0936 244E 9B00  6E66 E934 3406 A110 F4FE
--

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CABS%3Dy9sGgtDLKcmakHYPVpUm018%2BGkG4LdEyFbVxAra-0c%2BWcw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: puppet dashboard not processing reports after https is enabled and shows this error message: Report processor failed: undefined method `+' for nil:NilClass

2014-08-19 Thread Juan Sierra Pons
2014-08-19 18:40 GMT+02:00 Juan Sierra Pons :
> Hi
>
> I have been using puppet-dashboard for a long time over http without problem
> Today I have configured the https creating the ssl certificate, etc.
>
> puppetmaster, dashboard and workers have been restarted
>
> Also I have already changed the reporturl to https on the puppet.conf
> reporturl = https//dashboard.example.org:443/reports/upload
>
> The dashboard works as expected BUT the reports are not being processed.
>
> On the puppetmaster logs the following can be seen:
> "
> Aug 19 18:20:38 server3 puppet-agent[11671]: Stored state in 0.09 seconds
> Aug 19 18:20:38 server3 puppet-agent[11671]: Finished catalog run in
> 8.66 seconds
> Aug 19 18:20:40 server3 puppet-master[10313]: Report processor failed:
> undefined method `+' for nil:NilClass
> "
>  And on the apache+passenger+puppetmaster logs the following appears:
> "
> server3.example.org:8140 X.X.X.X - - [19/Aug/2014:18:20:37 +0200] "GET
> /production/file_metadata/modules/puppetdb/routes.yaml?links=manage&source_permissions=use
> HTTP/1.1" 200 6181 "-" "-"
> server3.example.org:8140 X.X.X.X - - [19/Aug/2014:18:20:39 +0200] "PUT
> /production/report/server3.example.org HTTP/1.1" 200 5865 "-" "-"
> "
>
> So as far as i know the report is been pushed to the puppetmaster but
> the dashboard is not able to process it
>
> puppetmaster and puppet-dashboard are the same server with aliases:
> server3.example.org
> puppet -> server3.example.org
> dashboard-> server3.example.org
>
> Any idea what am I missing?
>
> Thanks for your time
>
> Best regards
>
> --
> Juan Sierra Pons j...@elsotanillo.net
> Linux User Registered: #257202
> Web: http://www.elsotanillo.net Git: http://www.github.com/juasiepo
> GPG key = 0xA110F4FE
> Key Fingerprint = DF53 7415 0936 244E 9B00  6E66 E934 3406 A110 F4FE
> --

Hi

I have also checked that the yaml reports are being created on the
filesystem without any problem

Best regards

--
Juan Sierra Pons j...@elsotanillo.net
Linux User Registered: #257202
Web: http://www.elsotanillo.net Git: http://www.github.com/juasiepo
GPG key = 0xA110F4FE
Key Fingerprint = DF53 7415 0936 244E 9B00  6E66 E934 3406 A110 F4FE
--

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CABS%3Dy9v0EZjFM3OuM-2WrfCMVqWdqGxR2o0NXj_Qes-9wSjjuw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Q: execute a working manifest with modules

2014-08-19 Thread Yanis Guenane
Hi Frans,

--modulepath should not specify the init.pp, but the path where all the
modules reside

>From the doc :

  *nix (open source)$confdir/modules:/usr/share/puppet/modules

So in your case it would be --modulepath=/vagrant/data/puppet/modules.

Hope it helps,

--
Yanis Guenane

On 08/19/2014 12:34 PM, Frans Thamura wrote:
> hi all
> 
> i have a working puppet modules with init , run well on vagrant
> 
> now i want to run the modules inside my ubuntu box
> 
> and try puppet apply --modulepath=/vagrant/data/puppet/modules/ 
> manifest/init.pp
> 
> but got this error
> Warning: Could not retrieve fact fqdn
> Error: Failed to parse template 
> /vagrant/puppet/modules/tomcat/templates/tomcat-users.xml.erb:
>   Filepath: /usr/lib/ruby/vendor_ruby/puppet/parser/templatewrapper.rb
>   Line: 100
>   Detail: No such file or directory - 
> /vagrant/puppet/modules/tomcat/templates/tomcat-users.xml.erb
>  at /vagrant/data/puppet/modules/tomcat/manifests/init.pp:24 on node 
> vagrant-ubuntu-trusty-64
> 
> 
> can help me?
> 
> the puppet modele are in github.com/meruvian/vagrant-puppet
> 
> i want to make exactly apps installer in my ubuntu box, same as in vagrant 
> box
> 
> 
> 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/53F39010.7030305%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] How can we find out the directory presence?

2014-08-19 Thread Yanis Guenane
Jorge,

This is wrong. unless is not a parameter of the file resource

https://docs.puppetlabs.com/references/latest/type.html#file

unless applies only to the exec resource.

--
Yanis Guenane

On 08/18/2014 05:21 PM, Flamarion Jorge wrote:
> File { " /etc/puppet/test":
> ensure => "directory",
> unless => 'test -d /etc/puppet/test'
> }
> 
> Flamarion Jorge
> Sent from my mobile
> Em 18/08/2014 09:05, "Satish Katuru"  escreveu:
> 
> Hi ,
> 
> I wanted to find out whether the directory exists or not in the machine.How
> can I do it?
> 
> if I do it as below it will create a directory:
> 
> File { " /etc/puppet/test":
> ensure => "directory",
> 
> }
> 
> 
> 
>  --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/6f8d03fb-8d97-4832-a3b7-70868132c451%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
> 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/53F3912C.50504%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Could not connect via HTTPS to https://forgeapi.puppetlabs.com when downloading a module

2014-08-19 Thread RITU JAIN
Hi Rafael,

Did you find answer to this question? I am facing the same issue.

Regards,
Ritu

On Tuesday, July 1, 2014 8:58:39 PM UTC-4, triceras wrote:
>
> Hi All,
>
>   Has anyone ever experienced any ssl certificate problems when trying to 
> download a puppet module form https://forgeapi.puppetlabs.com ?
>
>   [root@hx689 httpd]# puppet module search ssh
> Notice: Searching https://forgeapi.puppetlabs.com ...
> Error: Could not connect via HTTPS to https://forgeapi.puppetlabs.com
>   Unable to verify the SSL certificate
> The certificate may not be signed by a valid CA
> The CA bundle included with OpenSSL may not be valid or up to date
> Error: Try 'puppet help module search' for usage
>
>
>   I have installed Puppet open source version 3.6.2 on RHEL 6.5. When I 
> tried to curl the URL I am getting the following:
>  
>
> [root@hx689 httpd]# curl https://forgeapi.puppetlabs.com
> curl: (60) Peer certificate cannot be authenticated with known CA 
> certificates
> More details here: http://curl.haxx.se/docs/sslcerts.html
>
> curl performs SSL certificate verification by default, using a "bundle"
>  of Certificate Authority (CA) public keys (CA certs). If the default
>  bundle file isn't adequate, you can specify an alternate file
>  using the --cacert option.
> If this HTTPS server uses a certificate signed by a CA represented in
>  the bundle, the certificate verification probably failed due to a
>  problem with the certificate (it might be expired, or the name might
>  not match the domain name in the URL).
> If you'd like to turn off curl's verification of the certificate, use
>  the -k (or --insecure) option.
>
>
> Any help is really appreciate. 
>
> Best Regards,
>
> Rafael
>
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/32dae128-856a-4316-b3cd-e944ed4faa38%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Could not connect via HTTPS to https://forgeapi.puppetlabs.com when downloading a module

2014-08-19 Thread Christopher Wood
Both of you may need the ca-certificates rpm. When I unpack this I can verify 
the cert on the other end:

$ pwd
/tmp/zz
$ rpm2cpio ~/files/downloads/ca-certificates-2013.1.94-65.0.el6.noarch.rpm | 
cpio -id

Then this gives me "Verify return code: 0 (ok)" (faking the directory since 
it's a Debian host):

openssl s_client -CApath /tmp/zz/etc/pki/tls/certs -showcerts -connect 
forgeapi.puppetlabs.com:443

Then when you install the ca-certificates rpm you would:

openssl s_client -CApath /etc/pki/tls/certs -showcerts -connect 
forgeapi.puppetlabs.com:443

I'm testing this on a Debian host hence no ca-certificates rpm available the 
usual way.

If that doesn't work also check your server time, ssl issues are often symptoms 
of unsync'ed clocks.

On Tue, Aug 19, 2014 at 11:20:15AM -0700, RITU JAIN wrote:
>Hi Rafael,
>Did you find answer to this question? I am facing the same issue.
>Regards,
>Ritu
> 
>On Tuesday, July 1, 2014 8:58:39 PM UTC-4, triceras wrote:
> 
>  Hi All,
>    Has anyone ever experienced any ssl certificate problems when trying
>  to download a puppet module form [1]https://forgeapi.puppetlabs.com ?
> 
>  [root@hx689 httpd]# puppet module search ssh
>Notice: Searching [2]https://forgeapi.puppetlabs.com ...
>Error: Could not connect via HTTPS to
>[3]https://forgeapi.puppetlabs.com
>  Unable to verify the SSL certificate
>    The certificate may not be signed by a valid CA
>    The CA bundle included with OpenSSL may not be valid or up to date
>Error: Try 'puppet help module search' for usage
> 
>    I have installed Puppet open source version 3.6.2 on RHEL 6.5. When I
>  tried to curl the URL I am getting the following:
>   
> 
>[root@hx689 httpd]# curl [4]https://forgeapi.puppetlabs.com
>curl: (60) Peer certificate cannot be authenticated with known CA
>certificates
>More details here: [5]http://curl.haxx.se/docs/sslcerts.html
>curl performs SSL certificate verification by default, using a
>"bundle"
> of Certificate Authority (CA) public keys (CA certs). If the default
> bundle file isn't adequate, you can specify an alternate file
> using the --cacert option.
>If this HTTPS server uses a certificate signed by a CA represented in
> the bundle, the certificate verification probably failed due to a
> problem with the certificate (it might be expired, or the name might
> not match the domain name in the URL).
>If you'd like to turn off curl's verification of the certificate, use
> the -k (or --insecure) option.
> 
>  Any help is really appreciate. 
>  Best Regards,
>  Rafael
> 
>--
>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 [6]puppet-users+unsubscr...@googlegroups.com.
>To view this discussion on the web visit
>
> [7]https://groups.google.com/d/msgid/puppet-users/32dae128-856a-4316-b3cd-e944ed4faa38%40googlegroups.com.
>For more options, visit [8]https://groups.google.com/d/optout.
> 
> References
> 
>Visible links
>1. https://forgeapi.puppetlabs.com/
>2. https://forgeapi.puppetlabs.com/
>3. https://forgeapi.puppetlabs.com/
>4. https://forgeapi.puppetlabs.com/
>5. http://curl.haxx.se/docs/sslcerts.html
>6. mailto:puppet-users+unsubscr...@googlegroups.com
>7. 
> https://groups.google.com/d/msgid/puppet-users/32dae128-856a-4316-b3cd-e944ed4faa38%40googlegroups.com?utm_medium=email&utm_source=footer
>8. https://groups.google.com/d/optout

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/20140819184539.GA12171%40iniquitous.heresiarch.ca.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] How can we find out the directory presence?

2014-08-19 Thread Flamarion Jorge
Ok. I'm sorry.  Here other way.

exec { "create dir":

command => 'mkdir -p /etc/puppet/test'
unless => 'test -d /etc/puppet/test'
..
}

Now your directory will be created if it doesn't exist.

Flamarion Jorge
Sent from my mobile
Em 19/08/2014 15:02, "Yanis Guenane"  escreveu:

> Jorge,
>
> This is wrong. unless is not a parameter of the file resource
>
> https://docs.puppetlabs.com/references/latest/type.html#file
>
> unless applies only to the exec resource.
>
> --
> Yanis Guenane
>
> On 08/18/2014 05:21 PM, Flamarion Jorge wrote:
> > File { " /etc/puppet/test":
> > ensure => "directory",
> > unless => 'test -d /etc/puppet/test'
> > }
> >
> > Flamarion Jorge
> > Sent from my mobile
> > Em 18/08/2014 09:05, "Satish Katuru"  escreveu:
> >
> > Hi ,
> >
> > I wanted to find out whether the directory exists or not in the
> machine.How
> > can I do it?
> >
> > if I do it as below it will create a directory:
> >
> > File { " /etc/puppet/test":
> > ensure => "directory",
> >
> > }
> >
> >
> >
> >  --
> > 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 view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/puppet-users/6f8d03fb-8d97-4832-a3b7-70868132c451%40googlegroups.com
> > <
> https://groups.google.com/d/msgid/puppet-users/6f8d03fb-8d97-4832-a3b7-70868132c451%40googlegroups.com?utm_medium=email&utm_source=footer
> >
> > .
> > For more options, visit https://groups.google.com/d/optout.
> >
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/53F3912C.50504%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CA%2Bx2bU2YrnETEGqZeGzWQs_DjwtG0r0Xjp-fOVpj031C%2BL6_HA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Custom fact working, but not on the puppetmaster

2014-08-19 Thread Jeff Fuller
I encountered the same problem while trying to deploy custom facts. The 
solution that I have used is the assign a definite *certname* in 
puppet.conf under both the [agent] and [master] sections of the file, 
giving it the certname puppetmaster. After this, you need to deactivate the 
node as it was previously named (probably its fqdn), accept any SSL 
certificates it requested, then restart the puppet agent service. That 
allowed the backend (PuppetDB) to sync the puppetmaster's facts when the 
agent was re-run for me.

Good luck

On Tuesday, April 15, 2014 10:09:46 AM UTC-4, Bob Hoekstra wrote:
>
> This has me confused - please advise. Using open source puppet on AWS 
> instances. Info is dumped into user-data at creation of the instances, and 
> a custom fact reads this so that puppet can configure the instance 
> depending on the content. So far so good. The fact:
>
> # cat /etc/puppet/modules/useful_utils/lib/facter/ud_purpose.rb
> require 'facter/util/ec2'
> require 'open-uri'
>
> Facter.add("ud_purpose") do
>   setcode do
> if Facter::Util::EC2.userdata.match(/ud_purpose=(\S+)/)
>   $1
> else
>  'notfound'
> end
>   end
> end
>
> On first puppet run, I see the fact bein installed and after this I can 
> see the fact with "facter -p ud_purpose" on the command line (including the 
> puppetmaster host). All good. Then I can check the logs. I have a line in 
> site.pp
>notify{"PURPOSE: ${::ud_purpose}" : }
> that works perfectly on all host except the puppet master. For this host I 
> see
> ...: PURPOSE:
> ...: (/Stage[main]/Main/Node[purpose]/Notify[PURPOSE: ]/message) defined 
> 'message' as 'PURPOSE: '
> where I expect to see:
> ... : PURPOSE: PUPPET-0
> as I can see (on the command line):
> # facter -p ud_purpose
> PUPPET-0
>
> Is there anything I am doing wrong? The puppet.conf file is pretty similar 
> between master and agents, though the master has a few additional lines to 
> do with puppetdb and environments.
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/012c9100-3aab-4a10-b99b-9abd3ed9c3f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Remove java from path - Windows

2014-08-19 Thread Rob Reynolds
On Mon, Aug 18, 2014 at 6:24 PM, badgerious  wrote:

> On Monday, August 18, 2014 10:51:35 AM UTC-5, Rob Reynolds wrote:
>>
>> This works great as long as the registry key is of type REG_EXPAND_SZ[1]
>> value, but the key for Path[2] is set to REG_SZ.
>>
>
> Interesting; all the systems I looked at were REG_EXPAND_SZ. It looks like
> if you insert a %variable% via the GUI, Windows will change it from REG_SZ
> to REG_EXPAND_SZ for you (and back again if you remove all the
> %variables%).
>

Interesting, I didn't realize that. :)


> I wonder if the windows_env puppet module should do that?
>
> I've done the %variable% in path before without issue and did a quick test
> before posting, but some further curiosity fueling googling suggests there
> may be gotchas that I was not previously aware of. To the OP: I'd be
> interested to hear if you have any such issues.
>
> Eric
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/46ffe10b-d5f3-4d01-ab1f-86208de831ee%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Rob Reynolds
Developer, Puppet Labs

*Join us at PuppetConf 2014 , September
20-24 in San Francisco*
*Register by September 8th to take advantage of the Final Countdown

*
*--**save $149!*

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAMJiBK52%3DvcoY44RtDrpv6pYw-E9-KSCB-BaUfHZif2_m%3DOc7w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: puppet dashboard not processing reports after https is enabled and shows this error message: Report processor failed: undefined method `+' for nil:NilClass

2014-08-19 Thread Juan Sierra Pons
Hi

Finally I've found the bug... between the keyboard and the seat :)
 A missing ":" between https and //
reporturl = https://dashboard.example.org:443/reports/upload

Regards
--
Juan Sierra Pons j...@elsotanillo.net
Linux User Registered: #257202
Web: http://www.elsotanillo.net Git: http://www.github.com/juasiepo
GPG key = 0xA110F4FE
Key Fingerprint = DF53 7415 0936 244E 9B00  6E66 E934 3406 A110 F4FE
--

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CABS%3Dy9uyp4Vy_jSc2aoiREdK-LgjfWLPK%2B8vr%2BkgRn5FWmGFUw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] augeas and multiple values attribute

2014-08-19 Thread Vadym Chepkov
Hi,

How can I use puppet's augeas type to configure parameters with multiple values?
For instance, sshd_config can have multiple HostKeys parameters:

augtool> print /files/etc/ssh/sshd_config/HostKey
/files/etc/ssh/sshd_config/HostKey[1] = "/etc/ssh/ssh_host_rsa_key"
/files/etc/ssh/sshd_config/HostKey[2] = "/etc/ssh/ssh_host_dsa_key"

How would puppet's manifest look like to have only two HostKey and configured 
the way shown?

Thanks,
Vadym

smime.p7s
Description: S/MIME cryptographic signature