[Puppet Users] Running puppet agent --test times out on puppet vm tutorial

2014-06-05 Thread Dennis Gearon
I was running the puppet vm inside Ubuntu/VirtualBox VM. It times out 
running that command.

I am putitng this here, with the answer, to help others.

The fix for me was to go to THREE Gigabytes of memory and 2 processors. The 
ducumentation says to use at least 2 gigabytes, and never said anything 
about more than one processor.

Again, for Puppet VM tutorial:
-
Use:
  3+ Gigabytes of RAM
  2+ processors

-- 
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/fe933edf-511a-4dfa-9604-e7ba49ded319%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Problems with starting service

2014-06-05 Thread Dennis Gearon
I tried EVERY possible version to restart ssh(d) on Ubuntu, Service, 
Upstart, init.d.

I could not get any of them to acknowledge that there was an ssh daemon. 
But SSH works, and changes to /etc/ssh/ssh_config have effect.

Weird.

On Thursday, March 15, 2012 1:51:44 PM UTC-7, Gary Larizza wrote:
>
> Are you trying to start 'ssh' or 'sshd' as a service ( you 
> have $ssh_service_name = 'ssh' in your params class)?
>
>
> On Fri, Mar 16, 2012 at 12:23 AM, Luis Festas Matos  > wrote:
>
>> Hi all, I've been following the Puppet Pro book and trying to do a 
>> configuration of a ssh module like it's told in the book. I'm on Ubuntu 
>> 10.10.
>>
>> The files I have are the following:
>>
>> on /etc/puppet/modules/ssh/manifests I have the config.pp  init.pp 
>>  install.pp  params.pp  service.pp files
>>
>> they're quite small so I'm including them in the end of the post.
>>
>> The problem that is happening is that if I stop the ssh service manually 
>> (i.e. with service ssh stop), I would like to see puppet starting the 
>> service again.
>> What I do is: stop the service, run the puppet client and wait. Nothing 
>> happens. I see puppet doing other things but it doesn't do anything with 
>> the ssh service.
>> Here's the relevant part of the client log. It runs with no errors.
>> debug: /Stage[main]/Ssh::Service/Service[ssh]/require: requires 
>> Class[Ssh::Config]
>> debug: /Stage[main]/Ssh::Config/File[/etc/ssh/sshd_config]/require: 
>> requires Class[Ssh::Install]
>> debug: /Stage[main]/Ssh::Config/File[/etc/ssh/sshd_config]/notify: 
>> subscribes to Class[Ssh::Service]
>>
>> So I see that it recognizes my module, but it won't start the ssh service 
>> when I turn it down. Any help would be appreciated.
>>
>>
>>
>>
>>
>> file init.pp
>>
>> class ssh {
>> include ssh::params, ssh::install, ssh::config, ssh::service
>> }
>>
>> file params.pp
>> class ssh::params {
>>   case $operatingsystem {
>>  ...
>> /(Ubuntu|Debian)/: {
>>   $ssh_package_name = 'openssh-server'
>>   $ssh_service_config = '/etc/ssh/sshd_config'
>>   $ssh_service_name = 'ssh'
>> }
>>   }
>> }
>>
>> file install.pp
>> class ssh::install {
>>   package { $ssh::params::ssh_package_name:
>>  ensure => present,
>>   }
>> }
>>
>> file config.pp
>>
>> class ssh::config {
>>   file { $ssh::params::ssh_service_config:
>> ensure => present,
>> owner => 'root',
>> group => 'root',
>> mode  => 0644,
>> source => "puppet:///modules/ssh/sshd_config",
>> require => Class["ssh::install"],
>> notify => Class["ssh::service"],
>>   }
>> }
>>
>> file service.pp
>>
>> class ssh::service {
>>   service { $ssh::params::ssh_service_name:
>> ensure => running,
>> hasstatus => true,
>> hasrestart => true,
>> enable => true,
>> require => Class["ssh::config"]
>>   }
>> }
>>  
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Puppet Users" group.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msg/puppet-users/-/Ruv4rv8TAgQJ.
>> To post to this group, send email to puppet...@googlegroups.com 
>> .
>> To unsubscribe from this group, send email to 
>> puppet-users...@googlegroups.com .
>> For more options, visit this group at 
>> http://groups.google.com/group/puppet-users?hl=en.
>>
>
>
>
> -- 
>
> Gary Larizza
> Professional Services Engineer
> 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/b00fb8e4-eebe-4f88-ac97-b624825f7b1d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: trying out puppet vm

2014-06-05 Thread Dennis Gearon
@kwambe

Without having password enabled locally on the client ssh configuration, 
your 'ssh-copy-id' doesn't work. It's probably almost identical to scp, 
which also does't work.

So the only fix is for the local client to have it's config changed. And . 
. ., I haven't seen a config file in my ~/.ssh directory, so so far, that 
config has to be changed system wide on my box.

And yes, I'm a learner. Been one for 55 years.

On Wednesday, June 4, 2014 9:31:32 PM UTC-7, Dennis Gearon wrote:
>
> I'm running the centos puppet enterprise vm in Virtualbox on Ubuntu. I've 
> got it running and I can contact it via SSH from the host. 
>
> I did say contact, not log in. It's supposed to allow/prompt for password 
> according the the FM (Effin Manual).Wrong. I enabled clipboard sharing to 
> copy a public key for passwordless SSH, restarted the VM, and I can't paste 
> into the window using  or V. Supposedly, according to 
> something I just read on setting up new CentOS VMs, I should be able to SCP 
> a file to the box and then use the screen to turn that file into 
> $JOME/.ssh/authorized_keys WRONG.
>
> So the only way I'm left with getting into the box is to HAND type the 
> public key in, all 256 or so characters. 
>
> Any ideas here on how to avoid that? 
>
> PS, also modified /etc/ssh/ssh_config with 'allow_passwords yes', 
> restarted the sshd daemon, DID NOT PROMPT for a password.
>
>

-- 
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/353ae4e2-0aa8-4e58-afe0-805f18b2dcd2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: trying out puppet vm

2014-06-05 Thread Dennis Gearon
@ Kwame, My two words of CAPS were obivously frustration, not yelling. 
Sorry if you took it as yelling.

The problem was with my understanding of SSH. I thought that the TARGET 
machine (CAPS for emphasis) would be the one qualifying whether password 
could be used. But it's actually the CLIENT (CAPS for emphasis) machine 
that has to have the configuration to allow password usage. So I changed 
the config on my host and could ssh into the virtual machine.

The guys at puppet labs helped me with that.

BTW, anybody know a group out there for just getting help for the tutorial 
puppet vm? (I have another problem) Yes, i searched google and google 
groups. I also just wrote puppet labs about it also.

On Wednesday, June 4, 2014 9:31:32 PM UTC-7, Dennis Gearon wrote:
>
> I'm running the centos puppet enterprise vm in Virtualbox on Ubuntu. I've 
> got it running and I can contact it via SSH from the host. 
>
> I did say contact, not log in. It's supposed to allow/prompt for password 
> according the the FM (Effin Manual).Wrong. I enabled clipboard sharing to 
> copy a public key for passwordless SSH, restarted the VM, and I can't paste 
> into the window using  or V. Supposedly, according to 
> something I just read on setting up new CentOS VMs, I should be able to SCP 
> a file to the box and then use the screen to turn that file into 
> $JOME/.ssh/authorized_keys WRONG.
>
> So the only way I'm left with getting into the box is to HAND type the 
> public key in, all 256 or so characters. 
>
> Any ideas here on how to avoid that? 
>
> PS, also modified /etc/ssh/ssh_config with 'allow_passwords yes', 
> restarted the sshd daemon, DID NOT PROMPT for a password.
>
>

-- 
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/418e81f1-6a75-4a0d-8120-089733649291%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: unable to execute shell script through non root user

2014-06-05 Thread Spencer Krum
Also,

This project exists:

https://github.com/arildjensen/cis-puppet/

It's not perfect but is an interesting project and it would be great to get
more help with it.

Thanks,
Spencer



On Thu, Jun 5, 2014 at 6:47 AM, jcbollinger 
wrote:

>
>
> On Wednesday, June 4, 2014 10:33:55 AM UTC-5, Supriya Uppalapati wrote:
>>
>> Hi,
>>
>> I am trying to run shell script through non root user in puppet facts.
>>
>> Here is my code.
>>
>>
>> * $cat cis_rhel6_check.rbrequire 'facter'*
>>
>>
>>
>>
>>
>> *Facter.add("cis_rhel6_check") do  setcode do %x[ sh
>> /tmp/cis_rhel6_check.sh ]  endend*
>> the shell script is in
>>
>> *drwxrwxrwt. 178 root   root tmp*
>>
>> *ls -ls /tmp/cis_rhel6_check.sh44 -rwxrwxrwx 1 root pe-puppet 43916 May
>> 19 15:28 /tmp/cis_rhel6_check.sh*
>>
>>
>
> This - seems to be contradicted by
>
>
>>
>> *The issue was:*
>> *sh: /tmp/cis_rhel6_check.sh: No such file or directory*
>>
>>
>
> this .
>
> Can you, as that same non-root user, successfully execute the script both
> immediately before and immediately after eliciting that message from Facter
> (all on the same machine)?  Note in particular that the Puppet agent syncs
> custom facts and evaluates them (along with all the other facts) before
> requesting a catalog, so you cannot rely on the agent to put the script in
> place for you where the fact expects it to be before the fact is evaluated.
>
> If it's a simple, 1st-party script then it might be a good approach to
> just rewrite it in Ruby in the fact body.
>
> Alternatively, you could also consider turning it into an external fact
> .
>
>
> 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/b18bf7db-ccae-4687-9244-7d695ad5501e%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Spencer Krum
(619)-980-7820

-- 
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/CADt6FWOmo34KH5%3D6oA0sM9dQoTMOZuydqfVAus-YE4uVVno7aQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] service config file validation?

2014-06-05 Thread Matt Zagrabelny
What is the community's opinion/experience with performing some sort
of validation check before puppet drives out a config and restarts a
service?

I'm thinking of things like ISC DHCP where you can test the
correctness of a config:

dhcpd -t -q -cf /etc/dhcp/dhcpd.conf && cp
/some/staging/area/dhcpd.conf /etc/dhcp/dhcpd.conf

Thanks for any hints!

-mz

-- 
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/CAOLfK3XP9NpGs8NMPR7AeLybfTpfSjud3HaCi8s1%2B-zozsQD9g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppetdb puppet-terminus and updated ruby version

2014-06-05 Thread jcbollinger


On Thursday, June 5, 2014 10:37:46 AM UTC-5, JuanBrein wrote:
>
> I see, it is a gap in the installation though...
>


For a non-recommended installation path.

 

> I mean you can install ruby through RVM,
>


... but you shouldn't ...


then puppet as a gem,
>


... but you shouldn't ...

 

> but you can't install puppetdb-terminus
>


... which is but one reason why not to do that.

 

> so you can't use it with puppetdb...
>
> I did a quick:
>
>   Rvm_gem<||> -> exec { "Install puppetdb-terminus":
> command => "mkdir util/puppetdb;dpkg -L puppetdb-terminus|grep 
> rb|while read a;do cp $a `echo $a|cut -d'/' -f7-`;done",
> cwd => 
> "/usr/local/rvm/gems/ruby-2.0.0-p451/gems/puppet-3.3.2/lib/puppet",
> path=> "/usr/bin:/bin",
> refreshonly => true,
> subscribe   => Package['puppetdb-terminus'],
>   }
>
>
> But it hurt my eyes each time I see it ... 
>
> Suggestions?
>


Install your whole Puppet stack, from Ruby through Puppet to Puppet DB, via 
your distro's native package management system.  PuppetLabs hosts package 
repositories for many current systems, including, I think, Ubuntu 12.04.  
But be sure to avoid having the same thing installed as gem and native 
package.


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/7d7351bc-3f69-4135-86e7-8ca80d0b5697%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Connection refused on cloned host

2014-06-05 Thread jcbollinger


On Thursday, June 5, 2014 7:10:50 AM UTC-5, Harold Thurnstein wrote:
>
>
> Hi,
>
> I have just cloned a VM and on the cloned VM I have changed the hostname 
> and ip address. I have cleaned out /etc/puppet/ssl on the host, run a 
> puppetca --clean 'new hostname' and have restarted the puppet master on the 
> server. However when I run puppet  on the cloned host I get a connection 
> refused. Is there some other file I should be removing as well? The version 
> of puppet that we are running is 2.7.x and  the os is Red Hat 6. Thanks for 
> any advice.
>
>

I don't think this is an SSL issue.  For one thing, if you exactly clone a 
VM, including its Puppet certificate, then it has a certificate that the 
master will accept.  Change the hostname / IP / whatever is not relevant to 
that.  The clone will impersonate the original to the master, so you 
generally don't want to leave it like that, but its hostname does not need 
to match the certificate name (that's a feature).

Connection refusal is more likely happening at the firewall or at the rack 
host.  The exact error message might shed some light on the specifics.


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/8b792886-702d-45bd-a910-81d2a45d65a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Puppet Dashboard port

2014-06-05 Thread Don Dorman
I almost have it figured out, and of course I will share the information

On Thursday, June 5, 2014 11:55:35 AM UTC-4, Kwame Bahena wrote:
>
> Ah,
>
> Can you please then share your config and the steps you are following?
>
>
> Cheers!
>
>
> On Thu, Jun 5, 2014 at 10:15 AM, Don Dorman  > wrote:
>
>> Thanks so much for the link, but I am testing the opensource version of 
>> Puppet. A lot of the directory structure is much different.
>>
>>
>>
>> On Thursday, June 5, 2014 10:27:56 AM UTC-4, Don Dorman wrote:
>>>
>>> Good morning Everyone.
>>>
>>> I have been struggling to change the default port for Dashboard access 
>>> from port 3000 to use SSL port 443. My Dashboard version is 1.2.34 if I 
>>> am not mistaken.
>>>
>>> My OS is RHEL 6.4, Puppet Master 3.42-1
>>>
>>> Any directions would be great.
>>>
>>  -- 
>> 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/85a2e004-f502-4c73-a74e-8226d111d730%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/ceedf7c7-e0d9-4b93-afe8-3e32fe826d99%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Puppet Dashboard port

2014-06-05 Thread Kwame Bahena
Ah,

Can you please then share your config and the steps you are following?


Cheers!


On Thu, Jun 5, 2014 at 10:15 AM, Don Dorman  wrote:

> Thanks so much for the link, but I am testing the opensource version of
> Puppet. A lot of the directory structure is much different.
>
>
>
> On Thursday, June 5, 2014 10:27:56 AM UTC-4, Don Dorman wrote:
>>
>> Good morning Everyone.
>>
>> I have been struggling to change the default port for Dashboard access
>> from port 3000 to use SSL port 443. My Dashboard version is 1.2.34 if I
>> am not mistaken.
>>
>> My OS is RHEL 6.4, Puppet Master 3.42-1
>>
>> Any directions would be great.
>>
>  --
> 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/85a2e004-f502-4c73-a74e-8226d111d730%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/CANtpaPpb2A6OQ8EgCsuX-h6pkM-EoHPp0xkWV9yxCr4E_zE4og%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] I can't read registry key with facter

2014-06-05 Thread Rob Reynolds
Nicolas,
 It is possible. Have a look at this recent write up I did -
http://puppetlabs.com/blog/how-avoid-common-windows-gotchas-puppet (it even
has a code example to do EXACTLY what you are asking).


On Thu, Jun 5, 2014 at 10:07 AM, nicolas boquet 
wrote:

> Hello,
>
> I've a problem with the module "facter/util/registry"...
>
> i want to read key / value from registry. On windows x86, it's OK but in
> on windows x64, i've this error:
> ERROR: The system was unable to find the specified registry key or value.
>
>
> i 've create a fact to know the version of ocs inventory and the version
> of fusioninventory-agent:
> this line work
> Facter::Util::Registry.hklm_read('SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\OCS
> Inventory Agent', 'DisplayVersion')
> but this line doesn't work
> Facter::Util::Registry.hklm_read('SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent',
> 'DisplayVersion')
>
>
>
> for exemple, in cmd.exe, i can do:
> C:\Windows\System32\reg.exe export
> "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent"
> "C:\Uninstall.reg"
> => it's ok, i've my file uninstall.reg with my key FusionInventory-Agent
>
> [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent]
> "DisplayName"="FusionInventory Agent 2.3.6 (x64 edition)"
> "DisplayVersion"="2.3.6"
> 
>
> but with facter:
> Facter::Util::Resolution.exec('C:\Windows\System32\reg.exe export
> "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent"
> "C:\Uninstall.reg"')
>  ERROR: The system was unable to find the specified registry key or value.
>
> In fact, i want to know if it's possible with facter to read a 64 bit
> registry from facter...
>
> Thank you and sorry for my english...
>
> --
> 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/ae7676cb-94df-46d3-8c5e-e8e800abb940%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 June 5th to take advantage of the Early Adopter discount
 **--**save $349!*

-- 
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/CAMJiBK4LEB8SJx2VaBQ-avA1SQkBpBouf25Z-xEpozQPc9pbyw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppetdb puppet-terminus and updated ruby version

2014-06-05 Thread JuanBrein
I see, it is a gap in the installation though... I mean you can install 
ruby through RVM, then puppet as a gem, but you can't install 
puppetdb-terminus so you can't use it with puppetdb...

I did a quick:

  Rvm_gem<||> -> exec { "Install puppetdb-terminus":
command => "mkdir util/puppetdb;dpkg -L puppetdb-terminus|grep 
rb|while read a;do cp $a `echo $a|cut -d'/' -f7-`;done",
cwd => 
"/usr/local/rvm/gems/ruby-2.0.0-p451/gems/puppet-3.3.2/lib/puppet",
path=> "/usr/bin:/bin",
refreshonly => true,
subscribe   => Package['puppetdb-terminus'],
  }


But it hurt my eyes each time I see it ... 

Suggestions?

On Thursday, June 5, 2014 3:44:54 PM UTC+1, Ken Barber wrote:
>
> So we (as in the developers of PDB) don't manage the gem that was put 
> onto rubygems, someone else did this - pretty anti-social but alas 
> thats the way rubygems works :-). 
>
> In fact we normally don't promote ruby gems as a way of installing 
> this software (or puppet for that matter) but if you insist, someone 
> has provided a gemspec in our source tree, that you can build a gem 
> from: https://github.com/puppetlabs/puppetdb/blob/master/Gemfile. 
>
> ken. 
>
> On Thu, Jun 5, 2014 at 1:09 PM, JuanBrein  > wrote: 
> > HI guys, 
> > On Ubuntu 12.04 using ruby 2.0 and puppet 3.3.2 through gem installation 
> I 
> > can't find puppetdb-terminus . There is a 1.0 version but is empty 
> available 
> > in rubygems.Does anybody know if there is an easy way to add this files 
> to 
> > my puppet installation rather than just copy them over from the 
> > puppetdb-terminus deb package or source code? 
> > 
> > Cheers 
> > 
> > Juan 
> > 
> > -- 
> > 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/e50b7fde-3a94-451a-aa07-6e9b375f5a9d%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/40166f93-f11d-47d7-8b3f-5e81878e9810%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] I can't read registry key with facter

2014-06-05 Thread nicolas boquet
Hello,
 
I've a problem with the module "facter/util/registry"...
 
i want to read key / value from registry. On windows x86, it's OK but in on 
windows x64, i've this error:
ERROR: The system was unable to find the specified registry key or value.
 
  
i 've create a fact to know the version of ocs inventory and the version of 
fusioninventory-agent:
this line work
Facter::Util::Registry.hklm_read('SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\OCS
 
Inventory Agent', 'DisplayVersion')
but this line doesn't work
Facter::Util::Registry.hklm_read('SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent',
 
'DisplayVersion')
 
 
 
for exemple, in cmd.exe, i can do:
C:\Windows\System32\reg.exe export 
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent"
 
"C:\Uninstall.reg"
=> it's ok, i've my file uninstall.reg with my key FusionInventory-Agent 
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent]
"DisplayName"="FusionInventory Agent 2.3.6 (x64 edition)"
"DisplayVersion"="2.3.6"

 
but with facter:
Facter::Util::Resolution.exec('C:\Windows\System32\reg.exe export 
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent"
 
"C:\Uninstall.reg"')
 ERROR: The system was unable to find the specified registry key or value.
 
In fact, i want to know if it's possible with facter to read a 64 bit 
registry from facter...
 
Thank you and sorry for my english...

-- 
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/ae7676cb-94df-46d3-8c5e-e8e800abb940%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Puppet Dashboard port

2014-06-05 Thread Don Dorman
Thanks so much for the link, but I am testing the opensource version of 
Puppet. A lot of the directory structure is much different.


On Thursday, June 5, 2014 10:27:56 AM UTC-4, Don Dorman wrote:
>
> Good morning Everyone.
>
> I have been struggling to change the default port for Dashboard access 
> from port 3000 to use SSL port 443. My Dashboard version is 1.2.34 if I 
> am not mistaken.
>
> My OS is RHEL 6.4, Puppet Master 3.42-1
>
> Any directions would be great.
>

-- 
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/85a2e004-f502-4c73-a74e-8226d111d730%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] what is actually "undefined method 'include?' for nil:NilClass on node" error?

2014-06-05 Thread jcbollinger


On Thursday, June 5, 2014 5:47:44 AM UTC-5, Sans wrote:
>
> No such ENC (other than Hiera).
> There is also no "static" node declaration in Puppet; that comes from 
> Hiera. But again, rest of the 50-odd nodes are running just fine the very 
> same way.
>
>

The exception is being thrown by this statement in puppet/node.rb (of 
Puppet 2.7.23):

names += split_name(name) if name.include?(".")

Combined with the exception detail message, that shows the node object 
having a nil 'name' attribute, which is consistent with the odd log message 
Ellison pointed out.  Just how this particular node might have a nil name 
is unclear, particularly given that the Puppet::Node class's initializer 
has a specific guard against that.

I would scrutinize the affected node's certificate, especially in 
comparison with those of other nodes that do not experience this problem.  
Perhaps there is something odd with the name it bears.

If that yields no fruit then my next guess would be that there is some 
custom component -- a custom type or function, or perhaps even a template 
-- taking inappropriate liberties with Puppet's internals.  That sort of 
thing could be data dependent, which might explain why only one node is 
affected (so far).


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/2395c1c1-3d5e-4990-9e1e-de9405d1f9d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet Dashboard port

2014-06-05 Thread Kwame Bahena
Hi Don,

You might want to take a look at this url

http://docs.puppetlabs.com/pe/latest/console_config.html#changing-the-consoles-port

Cheers!


On Thu, Jun 5, 2014 at 9:27 AM, Don Dorman  wrote:

> Good morning Everyone.
>
> I have been struggling to change the default port for Dashboard access
> from port 3000 to use SSL port 443. My Dashboard version is 1.2.34 if I
> am not mistaken.
>
> My OS is RHEL 6.4, Puppet Master 3.42-1
>
> Any directions would be great.
>
> --
> 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/521a1a3f-7ec4-424d-860a-d54704d19019%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/CANtpaPp_W-kcJ8J3PEAWpu015CmTFXap3iZNOHQPFqYs5eA54A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] trying out puppet vm

2014-06-05 Thread Kwame Bahena
Hi,

This is a question more related to the usage of the VM in virtualbox and
not puppet itself.
The fact that you cannot copy from your host to the VM it's an issue with
your ubuntu/virtualbox setup, not a problem with puppet.
The method of "select text, copy it, go to another place and attempt to
paste it" is very windows like ;-)
If you want to do this the right way, use ssh-copy-id

ssh-copy-id -i ~/.ssh/id_rsa.pub remote-host

>From what you write seems that you have little experience with linux and
administering your system, so I would stay away from modifying sshd_config
parameters.
Using ssh-copy-id should do what you need/want.

Now you have 2 options:

1. Undo all the changes you did to your VM and just use ssh-copy-id
2. Get a clean puppetlabs VM and use ssh-copy-id

cheers!

p.s.
Remember that netiquette mentions that when you write in CAPS it's the same
as YELLING. And afaik you don't go asking for help yelling at people.



On Wed, Jun 4, 2014 at 11:31 PM, Dennis Gearon  wrote:

> I'm running the centos puppet enterprise vm in Virtualbox on Ubuntu. I've
> got it running and I can contact it via SSH from the host.
>
> I did say contact, not log in. It's supposed to allow/prompt for password
> according the the FM (Effin Manual).Wrong. I enabled clipboard sharing to
> copy a public key for passwordless SSH, restarted the VM, and I can't paste
> into the window using  or V. Supposedly, according to
> something I just read on setting up new CentOS VMs, I should be able to SCP
> a file to the box and then use the screen to turn that file into
> $JOME/.ssh/authorized_keys WRONG.
>
> So the only way I'm left with getting into the box is to HAND type the
> public key in, all 256 or so characters.
>
> Any ideas here on how to avoid that?
>
> PS, also modified /etc/ssh/ssh_config with 'allow_passwords yes',
> restarted the sshd daemon, DID NOT PROMPT for a password.
>
>  --
> 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/9808ebc7-6776-4aba-9629-1de24ce13488%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/CANtpaPp9GJ0GyJL%2BLeMxPR6PMeWE28PbuUwf5tdS7%2Bh209fRQg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppetdb puppet-terminus and updated ruby version

2014-06-05 Thread Ken Barber
So we (as in the developers of PDB) don't manage the gem that was put
onto rubygems, someone else did this - pretty anti-social but alas
thats the way rubygems works :-).

In fact we normally don't promote ruby gems as a way of installing
this software (or puppet for that matter) but if you insist, someone
has provided a gemspec in our source tree, that you can build a gem
from: https://github.com/puppetlabs/puppetdb/blob/master/Gemfile.

ken.

On Thu, Jun 5, 2014 at 1:09 PM, JuanBrein  wrote:
> HI guys,
> On Ubuntu 12.04 using ruby 2.0 and puppet 3.3.2 through gem installation I
> can't find puppetdb-terminus . There is a 1.0 version but is empty available
> in rubygems.Does anybody know if there is an easy way to add this files to
> my puppet installation rather than just copy them over from the
> puppetdb-terminus deb package or source code?
>
> Cheers
>
> Juan
>
> --
> 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/e50b7fde-3a94-451a-aa07-6e9b375f5a9d%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/CAE4bNTknNY-uTHNJWOO0npJWUVDSLvTbDAyVzRHmG8QDVVn_Fg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Puppet Dashboard port

2014-06-05 Thread Don Dorman
Good morning Everyone.

I have been struggling to change the default port for Dashboard access from 
port 3000 to use SSL port 443. My Dashboard version is 1.2.34 if I am 
not mistaken.

My OS is RHEL 6.4, Puppet Master 3.42-1

Any directions would be great.

-- 
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/521a1a3f-7ec4-424d-860a-d54704d19019%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] trying out puppet vm

2014-06-05 Thread Felix Frank
Hi,

are you aware of the ssh-copy-id command?

On 06/05/2014 06:31 AM, Dennis Gearon wrote:
> I'm running the centos puppet enterprise vm in Virtualbox on Ubuntu.
> I've got it running and I can contact it via SSH from the host.
> 
> I did say contact, not log in. It's supposed to allow/prompt for
> password according the the FM (Effin Manual).Wrong. I enabled clipboard
> sharing to copy a public key for passwordless SSH, restarted the VM, and
> I can't paste into the window using  or V. Supposedly,
> according to something I just read on setting up new CentOS VMs, I
> should be able to SCP a file to the box and then use the screen to turn
> that file into $JOME/.ssh/authorized_keys WRONG.
> 
> So the only way I'm left with getting into the box is to HAND type the
> public key in, all 256 or so characters.
> 
> Any ideas here on how to avoid that?
> 
> PS, also modified /etc/ssh/ssh_config with 'allow_passwords yes',
> restarted the sshd daemon, DID NOT PROMPT for a password.

-- 
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/539078D6.5080900%40alumni.tu-berlin.de.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Connection refused on cloned host

2014-06-05 Thread Felix Frank
Hi,

that error message is a bit confusing.

Can you share the complete puppet agent --test output?

Note that SSL data usually resides in /var/lib/puppet/ssl, not /etc.

Thanks,
Felix

On 06/05/2014 02:10 PM, Harold Thurnstein wrote:
> 
> Hi,
> 
> I have just cloned a VM and on the cloned VM I have changed the hostname
> and ip address. I have cleaned out /etc/puppet/ssl on the host, run a
> puppetca --clean 'new hostname' and have restarted the puppet master on
> the server. However when I run puppet  on the cloned host I get a
> connection refused. Is there some other file I should be removing as
> well? The version of puppet that we are running is 2.7.x and  the os is
> Red Hat 6. Thanks for any advice.
> 
> Harold.

-- 
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/53907931.7080608%40alumni.tu-berlin.de.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Connection refused on cloned host

2014-06-05 Thread Harold Thurnstein

Hi,

I have just cloned a VM and on the cloned VM I have changed the hostname 
and ip address. I have cleaned out /etc/puppet/ssl on the host, run a 
puppetca --clean 'new hostname' and have restarted the puppet master on the 
server. However when I run puppet  on the cloned host I get a connection 
refused. Is there some other file I should be removing as well? The version 
of puppet that we are running is 2.7.x and  the os is Red Hat 6. Thanks for 
any advice.

Harold.

-- 
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/b84852e4-4643-42de-9eef-06902bb27af0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] trying out puppet vm

2014-06-05 Thread Dennis Gearon
I'm running the centos puppet enterprise vm in Virtualbox on Ubuntu. I've 
got it running and I can contact it via SSH from the host. 

I did say contact, not log in. It's supposed to allow/prompt for password 
according the the FM (Effin Manual).Wrong. I enabled clipboard sharing to 
copy a public key for passwordless SSH, restarted the VM, and I can't paste 
into the window using  or V. Supposedly, according to 
something I just read on setting up new CentOS VMs, I should be able to SCP 
a file to the box and then use the screen to turn that file into 
$JOME/.ssh/authorized_keys WRONG.

So the only way I'm left with getting into the box is to HAND type the 
public key in, all 256 or so characters. 

Any ideas here on how to avoid that? 

PS, also modified /etc/ssh/ssh_config with 'allow_passwords yes', restarted 
the sshd daemon, DID NOT PROMPT for a password.

-- 
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/9808ebc7-6776-4aba-9629-1de24ce13488%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: unable to execute shell script through non root user

2014-06-05 Thread jcbollinger


On Wednesday, June 4, 2014 10:33:55 AM UTC-5, Supriya Uppalapati wrote:
>
> Hi,
>  
> I am trying to run shell script through non root user in puppet facts.
>  
> Here is my code.
>  
>
> * $cat cis_rhel6_check.rbrequire 'facter'*
>
>
>
>
>
> *Facter.add("cis_rhel6_check") do  setcode do %x[ sh 
> /tmp/cis_rhel6_check.sh ]  endend*
> the shell script is in 
>  
> *drwxrwxrwt. 178 root   root tmp*
>
> *ls -ls /tmp/cis_rhel6_check.sh44 -rwxrwxrwx 1 root pe-puppet 43916 May 19 
> 15:28 /tmp/cis_rhel6_check.sh*
>  
>

This - seems to be contradicted by
 

>  
> *The issue was:*
> *sh: /tmp/cis_rhel6_check.sh: No such file or directory*
>  
>

this .

Can you, as that same non-root user, successfully execute the script both 
immediately before and immediately after eliciting that message from Facter 
(all on the same machine)?  Note in particular that the Puppet agent syncs 
custom facts and evaluates them (along with all the other facts) before 
requesting a catalog, so you cannot rely on the agent to put the script in 
place for you where the fact expects it to be before the fact is evaluated.

If it's a simple, 1st-party script then it might be a good approach to just 
rewrite it in Ruby in the fact body.

Alternatively, you could also consider turning it into an external fact 
.


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/b18bf7db-ccae-4687-9244-7d695ad5501e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Pattern for Associating Module versions with Nodes

2014-06-05 Thread Jason Antman
I can think of 2 ways of doing this, none of which are terribly nice:
1) use a separate Environment with the new version of the module, and start
running nodes against that. Once you get them all moved over to the new
environment, roll out the new module version to the production environment,
and switch them all back to that.
2) Simply disable runs on the nodes that you don't want on the new module
version, and then re-enable as you go.

That being said, trying to deploy Puppet modules like this is a bit of a
kludge. Personally, I'm an advocate of separating nodes into logical groups
and running each in an environment, or on a separate master.

In my current setup, we have N groups of "development" systems (on one
master, one Environment each), about N/10 groups of "test/QA" systems (on a
second master, one environment each) and a whole bunch of production
systems (on a third master, all in the production environment). For module
upgrades, we deploy it to one of the dev environments, test it, deploy it
to one of the test/QA environments, test it, and then merge it back to
master, and deploy it to production and everywhere else.

-Jason


On Tue, May 27, 2014 at 12:24 AM, Nitin Sharma 
wrote:

> Hi Abbas,
>
> I am wondering if you have found a solution for the requirement yet and if
> so, could you please share it.
>
> On Friday, March 8, 2013 9:43:24 AM UTC+11, Mohamed Abbas wrote:
>>
>>  On 3/7/13 1:51 PM, Nan Liu wrote:
>>
>> On Thu, Mar 7, 2013 at 12:42 PM, Mohamed Abbas 
>> wrote:
>>
>>> I'm wondering what is the canonical way of associating "specific"
>>> versions of a module to a node? Is there a way of doing this in puppet? Let
>>> me explain a "Use Case" of what I'm trying to accomplish:
>>>
>>> Say we have created a puppet model called apache to manage and configure
>>> apache webserver.
>>> We have the apache module under version control and there are several
>>> versions.
>>> We use puppet to apply apache-1.0.3 across an entire "environment"
>>> We want to be able to do a rolling upgrade across that entire
>>> environment, where some nodes in the environment have apache-1.0.3 and
>>> other have apache-1.1.2.
>>>
>>> From what I understand of puppet, there is no way of associating a
>>> specific version of a module to a specific node. The only way of doing that
>>> would be to "embed" a version tag in the module/class name. However that is
>>> ugly and does not work well with version control systems.
>>>
>>> Any suggestions of to accomplish this using puppet?
>>>
>>
>>  Github's boxen project powered by librarian-puppet, or r10k:
>> https://github.com/adrienthebo/r10k are good examples using Puppetfile
>> for module version control.
>>
>>
>> Thanks Nan. I looked at both and they address a different defined-problem
>> than the one I'm trying to address. What librarian-puppet and the boxen and
>> r10k solution you mentioned allow you to do is(per my understanding and
>> experience with using librarian-puppet):
>>
>>- To populate a modules sub-directory dynamically by using a
>>"Puppetfile" where you can pull different modules from different sources
>>and being able to specify which version to pull in. Once the modules
>>directory is populated, what is available to you to use in Puppet is still
>>a *single *version of that module.
>>
>> The defined-problem I'm trying to see if puppet addresses or create a new
>> solution to address it:
>>
>>- Having multiple instances of a module of different version number
>>available in the modules sub-directory where I can freely associate
>>different 2 different nodes to differing versions of the same module.
>>
>>
>> Thanks,
>> Mohamed Abbas
>>
>  --
> 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/aadf2f46-5b83-4b2c-8a78-bb6123d9bd2b%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/CAFt4V4mx8QinqaZM0r51miwJtEx4ZdiQ%2BzaTRxaig%2BgLR8ORQA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] How to create different types from the same hiera data

2014-06-05 Thread jcbollinger


On Wednesday, June 4, 2014 10:34:11 AM UTC-5, Vadym Chepkov wrote:
>
>
>
> On Wednesday, June 4, 2014 9:52:44 AM UTC-4, Felix.Frank wrote:
>>
>> Hi, 
>>
>> On 06/04/2014 03:32 PM, Vadym Chepkov wrote: 
>> > File[ensure=>directory] -> Mount[type=nfs,ensure=>mounted] 
>> > 
>> > Is this possible or I have to maintain two sets of data? 
>>
>> no, that is fine. The 'puppet magic' you are looking for is a defined 
>> type that accepts all the parameters you want to declare in your data. 
>> The implementation of the define should then "translate" them into the 
>> file and mount resources you want. 
>>
>> See 
>> http://docs.puppetlabs.com/puppet/latest/reference/lang_defined_types.html 
>>
>> HTH, 
>> Felix 
>>
>
> Thank you, that is indeed what I need.
>
> I have one more related question though. Is it possible to create the 
> whole path, similar to mkdir -p for the mount points using File resource?
> i.e. I will use /apps/oracle as a mount point. I want puppet to create 
> /apps for me. since /apps is not going to be a mount point, I would have to 
> track it separately and I would like to avoid it.
> I suppose I can create yet another attribute, like "is_mount: false", but 
> I wonder if there is a better way to accomplish it?
>
>

Puppet does not directly support automatic declaration of parent 
directories, but it should not be too hard to implement using (again) a 
defined type.  Something along these lines could probably be made to work:

define mymodule::recursive_file ($ensure => 'directory') {
  $parent = regsubst($title, '^(.*)/[^/]+$', '\1')

  file { $title: ensure => $ensure }

  if $parent {
mymodule::recursive_file { $parent: }
  }
}

You then use it in any class or definition, like so:

mymodule::recursive_file { '/grandparent/parent/file':
  ensure => 'file'
}

That could be gussied up with additional attributes (mode, owner, etc.).  
The problem with that is it easily lends itself to creating duplicate 
declarations.  Consider:

file { '/etc': ensure => 'directory' }
mymodule::recursive_file { '/etc/somepackage/somepackage.conf':
  ensure => 'file'
}

You end up with File['/etc'] being declared twice, which Puppet will not 
accept.

Using an Exec to run 'mkdir -p' is in some ways better, but in other ways 
worse.  It reduces your exposure to duplicate declaration issues, but at 
the price of exposing you to the possibility of an inconsistent catalog.  
Consider this, for example:

exec { 'mkdir -p /etc/somepackage':
  creates => '/etc/somepackage'
}
->
file { '/etc/somepackage/somepackage.conf':
  ensure => file
}

[... somewhere else ...]

file { '/etc/somepackage':
  ensure => 'absent'
}

That *still* suffers from the problem that you are attempting to manage the 
same physical resource (directory /etc/somepackage) via two different 
Puppet resources, but Puppet can no longer recognize the problem because 
you have disguised it.  Your catalog will be compiled, but Puppet cannot 
reliably apply it because it is internally inconsistent.

If you are careful to avoid inconsistencies then you can nevertheless make 
something like that work for you, but in that case you are on your own.

The alternative, and in many respects the true Puppet way, is to explicitly 
manage those files and directories you intend to manage, and only those.  
Remember always that building Puppet manifests is an exercise in modeling, 
not in scripting.


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/e4bd79b9-751d-4d7c-b180-5f4f499c87ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] how to use variables elsewhere that's defined in a define() type?

2014-06-05 Thread Felix Frank
On 06/05/2014 03:07 PM, Sans wrote:
> 
> w.r.t. inline_templates, what else would you suggest? The hiera hash
> that I'm using here is something like this:

That looks nice. Why don't you structure your define zpack_installer()
so that you can use

create_resources('zpack_installer', $hash)

As for variable value reuse - you should rethink your requirements. The
class cannot require resources it declares itself.

As for the yumrepos, that makes more sense (I guess?) but for that you
want to
 1. create a custom function that consumes your hash and returns the
repo names
 2. write that to a variable (which stores an array value then) so that
you can
 3. require Yumrepo[$my_repo_list]

HTH,
Felix

-- 
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/53906DE9.4050208%40alumni.tu-berlin.de.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] how to use variables elsewhere that's defined in a define() type?

2014-06-05 Thread Sans
Thanks Felix, for the heads up!
I was also thinking along the line that variables define() type variables 
are not accessible from elsewhere. 

w.r.t. inline_templates, what else would you suggest? The hiera hash that 
I'm using here is something like this:

zpack_four::zpack_core:
> zenpack-apachemonitor:
> ver: latest
> repo: "zenpack-four-%{environment}"
> req: zenpack-apachemonitor
> zenpack-digmonitor:
> ver: latest
> repo: "zenpack-four-%{environment}"
> rqed: zenpack-apachemonitor
>


-San

-- 
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/a07dbdba-5cf2-473c-bece-e4a163173ea0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] how to use variables elsewhere that's defined in a define() type?

2014-06-05 Thread Sans
Thanks Felix, for the heads up!
I was also thinking along the line that variables define() type variables 
are not accessible from elsewhere. 

w.r.t. inline_templates, what else would you suggest? The hiera hash that 
I'm using here is something like this:

zpack_four::zpack_core:
> zenpack-apachemonitor:
> ver: latest
> repo: "zenoss-four-%{environment}"
> req: zenpack-apachemonitor
> zenpack-digmonitor:
> ver: latest
> repo: "zenoss-four-%{environment}"
> rqed: zenpack-apachemonitor
>


-San


On Thursday, June 5, 2014 12:47:32 PM UTC+1, Felix.Frank wrote:
>
> On 06/05/2014 01:06 PM, Sans wrote: 
> > Later in my module, how can I use any of the variables (e.g. $zp_repo) 
> > that are already defined in the zpack_installer? 
>
> I strongly disbelieve that this can work. 
>
> You can access variables defined in classes, but I would be mildly 
> disturbed if there was a similar feature for accessing interna of 
> defined type instances. 
>
> If you have Hiera, you likely want to have your data in structured hiera 
> values, so that you can look them up from all parts of your manifest. 
>
> As an aside - inline_templates in defined types can be performance 
> sinks, evaluating them is rather costly for the compiler. 
>
> HTH, 
> Felix 
>

-- 
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/64f98cc6-0d80-43b7-9c88-c75285bcef28%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] puppetdb puppet-terminus and updated ruby version

2014-06-05 Thread JuanBrein
HI guys,
On Ubuntu 12.04 using ruby 2.0 and puppet 3.3.2 through gem installation I 
can't find puppetdb-terminus . There is a 1.0 version but is empty 
available in rubygems.Does anybody know if there is an easy way to add this 
files to my puppet installation rather than just copy them over from the 
puppetdb-terminus deb package or source code?

Cheers

Juan

-- 
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/e50b7fde-3a94-451a-aa07-6e9b375f5a9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] how to use variables elsewhere that's defined in a define() type?

2014-06-05 Thread Felix Frank
On 06/05/2014 01:06 PM, Sans wrote:
> Later in my module, how can I use any of the variables (e.g. $zp_repo)
> that are already defined in the zpack_installer?

I strongly disbelieve that this can work.

You can access variables defined in classes, but I would be mildly
disturbed if there was a similar feature for accessing interna of
defined type instances.

If you have Hiera, you likely want to have your data in structured hiera
values, so that you can look them up from all parts of your manifest.

As an aside - inline_templates in defined types can be performance
sinks, evaluating them is rather costly for the compiler.

HTH,
Felix

-- 
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/539058C9.6080405%40alumni.tu-berlin.de.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] rspec - Unable to find class ::logstash

2014-06-05 Thread Johan De Wit

On 05/06/14 11:56, Felix Frank wrote:

On 06/04/2014 11:04 PM, Johan De Wit wrote:

And that is what you should check in your rspec file.

In your manifests, you need indeed the scoping, in your spec, you don't

Humm, unfortunate.

Doesn't that (in theory) open you up for regressions in the form of
"does no longer include the properly scoped class, gets resolved to the
wrong class" like Brian described?


this is something to be tested I believe ...

TBC


--
Johan De Wit

Open Source Consultant

Red Hat Certified Engineer  (805008667232363)
Puppet Certified Professional 2013/2014 (PCP006)
_
 
Open-Future Phone +32 (0)2/255 70 70

Zavelstraat 72  Fax   +32 (0)2/255 70 71
3071 KORTENBERG Mobile+32 (0)474/42 40 73
BELGIUM http://www.open-future.be
_
 


Next Events:
Puppet Advanced Training | 
https://www.open-future.be/puppet-advanced-training-10-till-12th-june
Puppet Introduction Course | 
https://www.open-future.be/puppet-introduction-course-13th-june
Linux Training | https://www.open-future.be/linux-training-16-till-20th-june
Subscribe to our newsletter | http://eepurl.com/BUG8H

--
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/53905191.2080802%40open-future.be.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] how to use variables elsewhere that's defined in a define() type?

2014-06-05 Thread Sans

I have a class something like this, where I'm passing a [hiera] hash (
zpack_hash) to it:

class installer::zenpack($zpack_hash) {
>
> define zpack_installer($sure='present', $inst='false') {
>
> $z_pack  = $installer::zenpack::zpack_hash[$name]
> $zp_ver  = inline_template("<%= @z_pack['ver'].to_s.chomp %>")
> $zp_repo = inline_template("<%= @z_pack['rep'].to_s.chomp %>")
> $zp_rqed = inline_template("<%= @z_pack['req'].to_s.chomp %>")
>
> package { $name:
> ensure => $sure ? { present => $zp_ver, default => $sure },
> notify => Exec[ 'refresh_zenpack_daemons', 
> 'create_default_conf' ],
> require=> [
> File[ '/opt/zenpack/etc/global.conf' ],
> Yumrepo[ $zp_repo ],
>   ];
> }
> }
> $my_zpack_list = keys($zpack_hash)
> zpack_installer { $my_zpack_list: }
> }
>
 
Later in my module, how can I use any of the variables (e.g. $zp_repo) that 
are already defined in the zpack_installer? I tried something like this:

class packages::zenpacks::core {
> $hr_zenoss_zpack_core = hiera_hash('zenoss_four::zpack_core', 
> undef)
>
> class { 'installer::zenpack':
> zpack_hash => $hr_zenoss_zpack_core,
> require=> [
> Yumrepo[ 
> $installer::zenpack::zpack_installer::zp_repo 
> ],
> File[ '/opt/zenoss/etc/global.conf' ],
> Installer::Zenpack::Zpack_installer[ $installer::
> zenpack::zpack_installer::zp_rqed ],
>   ];
> }
> }
>

but that's not working; throwing in errors like:


err: Failed to apply catalog: Could not find dependency Yumrepo[undef] for 
> Class[Installer::Zenpack]
>


on the lines that marked in red. It works just fine if I comment out these 
two lines. any help/suggestion from any one?

-- 
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/f11a912b-4157-4cab-bcad-ddb004c33a21%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] what is actually "undefined method 'include?' for nil:NilClass on node" error?

2014-06-05 Thread Sans
No such ENC (other than Hiera).
There is also no "static" node declaration in Puppet; that comes from 
Hiera. But again, rest of the 50-odd nodes are running just fine the very 
same way.

-San 



On Monday, June 2, 2014 3:33:12 PM UTC+1, jcbollinger wrote:
>
>
> Is there an ENC involved?
> Is there a node declaration matching the affected node?
>
>
> 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/507cf84f-ada2-4b85-be16-ac0deb17bc7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] How to use variables elsewhere that defined in a define() type?

2014-06-05 Thread Sans
I have a class something like this, where I'm passing a [hiera] hash (
zpack_hash) to it:

class installer::zenpack($zpack_hash) {
>
> define zpack_installer($sure='present', $inst='false') {
>
> $z_pack  = $installer::zenpack::zpack_hash[$name]
> $zp_ver  = inline_template("<%= @z_pack['ver'].to_s.chomp %>")
> $zp_repo = inline_template("<%= @z_pack['rep'].to_s.chomp %>")
> $zp_rqed = inline_template("<%= @z_pack['req'].to_s.chomp %>")
>
> package { $name:
> ensure => $sure ? { present => $zp_ver, default => $sure },
> notify => Exec[ 'refresh_zenpack_daemons', 
> 'create_default_conf' ],
> require=> [
> File[ '/opt/zenpack/etc/global.conf' ],
> Yumrepo[ $zp_repo ],
>   ];
> }
> }
> $my_zpack_list = keys($zpack_hash)
> zpack_installer { $my_zpack_list: }
> }
>
 
Later in my module, how can I use any of the variables (e.g. $zp_repo) that 
are already defined in the zpack_installer? I tried something like this:

class zenoss_four::packages::zenpacks::core {
> $hr_zenoss_zpack_core = hiera_hash('zenoss_four::zpack_core', 
> undef)
>
> class { 'installer::zenpack':
> zpack_hash => $hr_zenoss_zpack_core,
> require=> [
> Yumrepo[ 
> $installer::zenpack::zpack_installer::zp_repo 
> ],
> File[ '/opt/zenoss/etc/global.conf' ],
> Zenoss_four::Installer::Zenpack::Zpack_installer[ 
> $installer::zenpack::zpack_installer::zp_rqed ],
>   ];
> }
> }
>

but that's not working; throwing in errors like:


err: Failed to apply catalog: Could not find dependency Yumrepo[undef] for 
> Class[Installer::Zenpack]
>


on the lines that marked in red. It works just fine if I comment out these 
two lines. any help/suggestion from any one?

-- 
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/1058b3d0-f3c9-4da8-8e1f-4eacd7eff9e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] rspec - Unable to find class ::logstash

2014-06-05 Thread Felix Frank
On 06/04/2014 11:04 PM, Johan De Wit wrote:
> 
> And that is what you should check in your rspec file. 
> 
> In your manifests, you need indeed the scoping, in your spec, you don't

Humm, unfortunate.

Doesn't that (in theory) open you up for regressions in the form of
"does no longer include the properly scoped class, gets resolved to the
wrong class" like Brian described?

-- 
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/53903EE3.6020809%40alumni.tu-berlin.de.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Ability to "wait" for dotnet to complete installation

2014-06-05 Thread Stephen Wallace
Thank you all for the great suggestions.

Josh was right on the money with prepending "*cmd.exe* /c start /wait".

I also confess to being very lazy reusing someone else's brilliance with 
the Execs. We do know that Package resources are sweet, shiny, and will 
assure you def get through the Pearly Gates when your time arrives!

I think that They are right in saying that the longest way between two 
points, is usually the shortcut!

Anon :)

On Wednesday, 4 June 2014 16:15:24 UTC+10, Stephen Wallace wrote:
>
> Hi all,
>
> Interesting timing challenge around installing dotnet on Windows 2008 R2 
> Data Cente. 
>
> In essence, when we run the following command, it appears to complete in a 
> few seconds. The reality is that it spawns multiple new msiexecs to install 
> and configure itself over the next 5 mins or so.
>
> dotNetFx40_Full_x86_x64.exe /q /norestart
>
> This causes an obvious issue if we need to install a bit of software with 
> dotnet as a dependancy, unless, we can "wait" until dotnet has finished 
> it's 5 min dance.
>
> From command line, this issue is resolved by adding a "start /wait" to the 
> above command. The next challenge is how to get the correct syntax for my 
> exec statement;
>
> command   => "start /wait 
> ${dotnet::params::deployment_root}\\dotNetFx40_Full_x86_x64.exe 
> /q /norestart",
>  
> Without the "start /wait", the above command "works". 
>
> With the "start /wait", it complains as follows...
>
> /Stage[main]//Dotnet[dotnet45]/Exec[install-dotnet-45]/returns:
>
> Error: start /wait 
>  
> C:\ProgramData\PuppetLabs\puppet\etc\modules\dotnet\files\dotNetFx40_Full_x86_x64.exe
>  
> /q /norestart returned 1 instead of one of [0]
>
>  Short of writing a new function called "go for a cup of tea" feeding it 
> the required number of sleep seconds(!), does anybody have any experiences 
> or ideas around this one??
> -- 
> Regs,
>
> Stephen J Wallace
> M +61 (0)415 306731
> http://au.linkedin.com/in/stephenwallace
>  

-- 
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/b0d27120-db15-40fa-b5bf-09803b5614d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Could not request certificate: Error 405 on SERVER

2014-06-05 Thread Steve Kilduff


I found this page when searching for a solution to errors like “403 
Forbidden error” and error 405 “The requested method PUT is not allowed for 
the URL /production/”

I searched all the permissions, all the dir layouts, but nothing was 
fixing. Quickly put, my solution was to downgrade the latest passenger gem 
from 4.0.44 to 3.0.21. Maybe other versions work, but I was happy to see a 
working system and left it alone. 

Passenger 4 release seems to coincide with puppet 3.5/3.6 releases, and for 
anyone doing an upgrade, maybe their passenger version stays the same, but 
for anyone doing a new install, maybe it pulls all the latest versions.

Centos 6.5, puppet-server 3.6.1, httpd-2.2, passenger 3.0.21

Hope this helps someone not loose 2 hours like I did.


On Thursday, February 13, 2014 12:39:30 PM UTC+1, Catalin Panaite wrote:
>
> I was getting that error but I manage to solve it doing this:
>
> *cp /usr/share/puppet/ext/rack/files/config.ru  
> /usr/share/puppet/rack/puppetmasterd/ *
>
> Give Puppet correct permission to access the Rack config:
>
> *chown puppet:puppet /usr/share/puppet/rack/puppetmasterd/config.ru 
>  *
>
> ref: 
> http://www.tomhayman.co.uk/linux/install-puppet-passenger-centos-6-part/
>

-- 
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/564d7306-6af6-487f-9e30-b9e42a150bfc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.