Re: [Puppet Users] access variable inside module which was declared at inside profile

2017-01-23 Thread Martin Alfke
You can access other modules variables by using the namespace of the variable 
as long as the class with the referring variable is known to the catalog 
compilation (has been included or declared).

e.g.
# modules/abc/manifests/init.pp
class abc {
  $var = ‘foo’
}

# site/profile/manifests/abc.pp
class profile::abc {
  include abc
  $var = $abc::var
  notify { $var: }
}

puppet apply -e ‘include profile::abc’
will return notify ‘foo’


> On 23 Jan 2017, at 23:21, java.frea...@gmail.com wrote:
> 
> Hi Everyone,
> 
>  Am very new to puppet. Can any one please help me to fix this issue 
> !!
> I need to access $var1 at inside module folder actually which 
> declared at profile.
>   
>   
> #
>  /etc/puppetlabs/puppet/environment/dev/site/profile/manifest/abc.pp
> 
>   class profile::abc($var1 = '5' ) 
> {
>  --- // some code here // 
> 
> }
> ###
> /etc/puppetlabs/puppet/environment/dev/module/abc/manifest/abc.pp
> I need to access $var1 in this file :- /module/abc/manifest/abc.pp
> class abc($var1 = undef)
> {
>   // I want to access $var1 in this class. How I can access    // 
> -
> }
> 
> -- 
> 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/ac7cfed8-3526-4df5-97c0-107fb05b4231%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/C69CE134-46E8-4FB0-983B-F90C6336F317%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] access variable inside module which was declared at inside profile

2017-01-23 Thread java . freak4u
Hi Everyone,

 Am very new to puppet. Can any one please help me to fix this 
issue !!
I need to access $var1 at inside module folder actually which 
declared at profile.
  
  
#
 /etc/puppetlabs/puppet/environment/dev/site/profile/manifest/abc.pp

  class profile::abc($var1 = '5' ) 
{
 --- // some code here // 

}
###
/etc/puppetlabs/puppet/environment/dev/module/abc/manifest/abc.pp
I need to access $var1 in this file :- /module/abc/manifest/abc.pp
class abc($var1 = undef)
{
  // I want to access $var1 in this class. How I can access    
// -
}

-- 
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/ac7cfed8-3526-4df5-97c0-107fb05b4231%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Using notify with concat module...

2017-01-23 Thread Sean
Hello,

I was reading over several threads regarding the use of concat modules and 
subscribe capabilities.  It seems everyone is subscribe from another 
resource instead of notify with a concat resource.  My preference is to use 
notify, as I think it makes the code read better for documentation 
purposes.  One thread implied that subscribe and notify are interchangeable 
as long as refreshonly=true.  Is that correct in the case of using notify 
with concat?  Is it sufficient to use one notify statement inside the main 
concat resource for a file, or do I need to notify from each 
concat::fragment resource?  I am hoping someone can clear up a bit of 
confusion I've developed reading through the threads.  

For background, I'm using puppet to configure Gnome using dconf.  I've 
written a simple Exec resource that runs dconf-update, refreshonly => true. 
 A concat resource might manage a file that collects several Gnome options 
that relate to each other, where each concat::fragment resource corresponds 
to a single Gnome option...like a fragment for enabling the screensaver, 
and another fragment for the idle-delay.  If the file is updated, 
dconf-update needs to be run and should only be run once at the end of a 
puppet run.

Thanks for your thoughts.

-- 
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/09321e9b-9161-433a-8dcc-364a27af3220%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] RHEL-7 rspec-puppet

2017-01-23 Thread Adriano Vieira
Hi Guys!

I'm having problem when I try to run mymodule tests on RHEL-7

rspec (rake spec) can't find any classes defined by mymodule.

- .fixtures.yml
fixtures:
  forge_modules:
stdlib: "puppetlabs/stdlib"
concat: "puppetlabs/concat"
sysctl: "fiddyspence/sysctl"
  symlinks:
mymodule: "#{source_dir}"

- running tests
rake spec

on CEntOS-7 it runs without problems (finds all mymodule classes and all 
tests are well excuted), but on Redhat-7 it didn't find any of mymodule 
classes.


Could you point me some light to solve this mistery?

-- 
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/0fdfdf24-0f64-45bf-97d1-36ae26512746%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Could not generate DH keypair

2017-01-23 Thread Fabricio Cruz
Hi ,

I was able to solve :

1- openssl dhparam 1024
2- add this block of code to /etc/puppetlabs/puppet/ssl/certs/mycert.pem
 ---  in my client puppet

Thank you!!

2017-01-20 0:21 GMT-02:00 Fabricio Cruz :

> Thanks for replying, I do not have satelite server, I have:
>
> Ubuntu server 16.04
> Puppet and Foreman
>
> Thanks!
>
>
> 2017-01-19 11:21 GMT-02:00 rvlinden :
>
>> Run openssl to create a 1024 DH keypair
>> # openssl dhparam 1024
>>
>> and add this block of code (incl BEGIN DH PARAMETERS and END DH
>> PARAMETERS to your /etc/katello/certs/katello-apache.crt on your
>> satellite server
>>
>> Hope this helps
>>
>> Rene
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Puppet Users" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>> pic/puppet-users/nfmqGBGr3yY/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> puppet-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/puppet-users/5e85a2bb-dd7d-4599-a9a0-3dddfc0fb3b9%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/CAPav1BsuBcFE-44iGiVH0jjFGetdHh6KSnkrTcdk_uta9y%2BMXg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] My Array and Hash datatype getting treated as simple string.

2017-01-23 Thread Henrik Lindberg

On 22/01/17 07:59, Arun Kumar wrote:

Hi Guys,

I am very new to Puppet and installed 3.8. I tried creating template
using array type variable but I got output as string.

My sample code as below:

init.pp
---
$servers = ['facter', 'hiera', 'mco', 'puppet', 'puppetserver'],

config.pp
--
$servers = "$::apache::servers",


That line interpolates the array into a string. Change this to

  $servers = $::apache::servers

- henrik


file {"/root/welcome":
ensure => present,
content => template('apache/hello.erb'),


hello.erb
--
<% @servers.each do |val| -%>
Welcome <%= val %>
<% end -%>


output as :
==

cat /root/welcome
Welcome facterhieramcopuppetpuppetserver

Any help will be appreciated.

Thanks,
Arun

--
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/e04f554b-1329-4b4b-afa4-1ca445838490%40googlegroups.com
.
For more options, visit https://groups.google.com/d/optout.



--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

--
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/6ed9ae7f-1984-0f25-9cf7-7820986e124e%40puppet.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: puppet ruby code documentation needed

2017-01-23 Thread Ryan Vande
I believe Puppet is snooping my data ! ;-)
They released these documents the day after my post ;-)
I believe this will help me to get started on the right footing.
I also bought two ruby books off amazon learning ruby 2007 edition , it was 
suggested and ruby cookbook,and this newly released info 

https://puppet.com/blog/unit-testing-rspec-puppet-for-beginners?ls=social-media=integrated-pe=facebook=701G001BZCK_medium=social-media_campaign=integrated-pe_source=facebook_content=blog-post-pe




On Sunday, January 22, 2017 at 3:23:30 PM UTC-5, Ryan Vande wrote:
>
> I posted this before with a subject line that was vague, i will repost 
> with a more detailed subject line
>
> I need some good documentation on ruby code for putting together puppet 
> rake beaker tests.. 
> I need to add some code for my acceptance class rb script. Is there 
> documents out there that anyone can provide. I'm not even sure the right 
> technical words to use to phrase my question.
>
> Ruby is a new language to me, I just need to know how to structure the 
> code.
>
> I.E. I need to add ruby code to allow my acceptance testing (rake beaker) 
> to include classes that are not directly already incorporated in my main 
> modules that get called. I just need to add other classes specifically for 
> testing. I don't know where to start.
>
> Thank you , 
>

-- 
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/e6e8c4a9-dce2-4ef2-b1d3-17e9cab62af4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.