Re: [Puppet Users] puppet module repository w/ self signed ssl?

2018-06-05 Thread Josh Cooper
On Tue, Jun 5, 2018 at 8:52 AM, Sean  wrote:

> Hello,
>
> I'm wanting to use the module_repository setting in puppet.conf on my
> puppet5 master.  The local repo mirror we've setup requires SSL, but has a
> self-signed cert.  Is there a way to make puppet trust that cert?
>
> Mostly, I want to be able to use puppet module search as a convenience
> since the environment is not internet connected.  We use control repos and
> r10k to deploy from the same repo and it works well.
>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/puppet-users/0e37e66d-469e-4a61-a6da-46e546ec62d9%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

You should be able to follow the workaround in
https://tickets.puppetlabs.com/browse/PUP-8889, but longer term we want to
make it easier to support third-party CA certs for things like file
sources, etc.

Josh

-- 
Josh Cooper | Software Engineer
j...@puppet.com | @coopjn

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


Re: [Puppet Users] Style (syntax?) question

2018-06-05 Thread Ramin K

On 6/5/2018 6:01 AM, jcbollinger wrote:



On Monday, June 4, 2018 at 1:06:52 PM UTC-5, Ramin K wrote:

On 6/4/18 8:25 AM, Peter Berghold wrote:
 > I was looking at someone else's code one day last week and saw a
pattern
 > I've not seen before. Maybe that's what I get for developing
Puppet code
 > in a vacuum. :-)
 >
 > class someclass (
 >      $parm1 = $::someclass::params::parm1,
 >      $parm2 = $::someclass::params::parm2       # so far I get it.
 > ) inherits someclass::params {             # ok, I get it
 >
 >       class{'someclass::package': }        # OK
 >       -> class('someclass::configure':}    # right...
 >       -> Class{'someclass':}                    #  HUH?  What
does that do?
 > }
 >
 > Is that last step necessary and why?


The last step was fairly common in Puppet 2.7 code before Anchors.



Are you sure about that, Ramin?  I've been around Puppet since well 
before v2.7, and to the best of my knowledge, Class{'someclass':} (with 
capital 'C') is and always has been syntactically invalid.  I'm prepared 
to learn something new today, but you'll need to point me to some docs 
to support your assertion.


Myself, I'm inclined to guess that it's a simple typo, that an ordinary 
resource-style class declaration (with lowercase 'c') is what was intended.


"I was looking at someone else's code one day last week and saw a 
pattern I've not seen before." seems clear enough to me. Was pseudo code 
and I didn't think to look at the syntax. Jumped straight to the 
confusing part, a resource chain that ends on the class. I've answered 
the same question several times in support of our Puppet system at work. 
And then moved the module to contain... which generated more questions 
about include vs require vs contain. No winning some days.


Ramin

--
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/850a1e8d-58ab-7186-878d-9ef32f8d4e6c%40badapple.net.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] puppet module repository w/ self signed ssl?

2018-06-05 Thread Sean
Hello,

I'm wanting to use the module_repository setting in puppet.conf on my 
puppet5 master.  The local repo mirror we've setup requires SSL, but has a 
self-signed cert.  Is there a way to make puppet trust that cert?

Mostly, I want to be able to use puppet module search as a convenience 
since the environment is not internet connected.  We use control repos and 
r10k to deploy from the same repo and it works well.

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/0e37e66d-469e-4a61-a6da-46e546ec62d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Style (syntax?) question

2018-06-05 Thread Arnau
2018-06-05 15:01 GMT+02:00 jcbollinger :

>
>
> On Monday, June 4, 2018 at 1:06:52 PM UTC-5, Ramin K wrote:
>>
>> On 6/4/18 8:25 AM, Peter Berghold wrote:
>> > I was looking at someone else's code one day last week and saw a
>> pattern
>> > I've not seen before. Maybe that's what I get for developing Puppet
>> code
>> > in a vacuum. :-)
>> >
>> > class someclass (
>> >  $parm1 = $::someclass::params::parm1,
>> >  $parm2 = $::someclass::params::parm2   # so far I get it.
>> > ) inherits someclass::params { # ok, I get it
>> >
>> >   class{'someclass::package': }# OK
>> >   -> class('someclass::configure':}# right...
>> >   -> Class{'someclass':}#  HUH?  What does that
>> do?
>> > }
>> >
>> > Is that last step necessary and why?
>>
>>
>> The last step was fairly common in Puppet 2.7 code before Anchors.
>
>
>
> Are you sure about that, Ramin?  I've been around Puppet since well before
> v2.7, and to the best of my knowledge, Class{'someclass':} (with capital
> 'C') is and always has been syntactically invalid.  I'm prepared to learn
> something new today, but you'll need to point me to some docs to support
> your assertion.
>

I've been using that syntax in 3.8 for a long time:

  contain ::soge::install
  contain ::soge::configure
  contain ::soge::service

  Class ['::soge::install'] ->
  Class ['::soge::configure'] ~>
  Class ['::soge::service']

Maybe this ->
https://blog.mayflower.de/4573-The-Puppet-Anchor-Pattern-in-Practice.html

I remeber start using it when the contain function was released...

( fun fact: https://groups.google.com/forum/#!topic/puppet-users/T1cIUuKBU0E
isn't this you using "Class"? or am I missing something?

Best,
Arnau


>

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


Re: [Puppet Users] Style (syntax?) question

2018-06-05 Thread R.I.Pienaar



On Tue, 5 Jun 2018, at 15:01, jcbollinger wrote:
> 
> 
> On Monday, June 4, 2018 at 1:06:52 PM UTC-5, Ramin K wrote:
> >
> > On 6/4/18 8:25 AM, Peter Berghold wrote: 
> > > I was looking at someone else's code one day last week and saw a pattern 
> > > I've not seen before. Maybe that's what I get for developing Puppet code 
> > > in a vacuum. :-) 
> > > 
> > > class someclass ( 
> > >  $parm1 = $::someclass::params::parm1, 
> > >  $parm2 = $::someclass::params::parm2   # so far I get it. 
> > > ) inherits someclass::params { # ok, I get it 
> > > 
> > >   class{'someclass::package': }# OK 
> > >   -> class('someclass::configure':}# right... 
> > >   -> Class{'someclass':}#  HUH?  What does that 
> > do? 
> > > } 
> > > 
> > > Is that last step necessary and why? 
> >
> >
> > The last step was fairly common in Puppet 2.7 code before Anchors.
> 
> 
> 
> Are you sure about that, Ramin?  I've been around Puppet since well before 
> v2.7, and to the best of my knowledge, Class{'someclass':} (with capital 
> 'C') is and always has been syntactically invalid.  I'm prepared to learn 
> something new today, but you'll need to point me to some docs to support 
> your assertion.
> 
> Myself, I'm inclined to guess that it's a simple typo, that an ordinary 
> resource-style class declaration (with lowercase 'c') is what was intended.
> 

class{'someclass::package': } 
-> class('someclass::configure':}
-> Class["someclass"] # or -> Class[$name]

Is the correct version of this.  It's a "soft" version of the anchor pattern, 
because:

   package{"foo": require => Class["someclass"]}

will have the inner classes completed before it without any crazy extra 
resources and stuff and it handles the case most people actually care for - but 
this is not a full contained class like contain() makes, you should probably 
use contain() today.

-- 
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/1528204221.2225351.1397064328.7404B769%40webmail.messagingengine.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Style (syntax?) question

2018-06-05 Thread jcbollinger


On Monday, June 4, 2018 at 1:06:52 PM UTC-5, Ramin K wrote:
>
> On 6/4/18 8:25 AM, Peter Berghold wrote: 
> > I was looking at someone else's code one day last week and saw a pattern 
> > I've not seen before. Maybe that's what I get for developing Puppet code 
> > in a vacuum. :-) 
> > 
> > class someclass ( 
> >  $parm1 = $::someclass::params::parm1, 
> >  $parm2 = $::someclass::params::parm2   # so far I get it. 
> > ) inherits someclass::params { # ok, I get it 
> > 
> >   class{'someclass::package': }# OK 
> >   -> class('someclass::configure':}# right... 
> >   -> Class{'someclass':}#  HUH?  What does that 
> do? 
> > } 
> > 
> > Is that last step necessary and why? 
>
>
> The last step was fairly common in Puppet 2.7 code before Anchors.



Are you sure about that, Ramin?  I've been around Puppet since well before 
v2.7, and to the best of my knowledge, Class{'someclass':} (with capital 
'C') is and always has been syntactically invalid.  I'm prepared to learn 
something new today, but you'll need to point me to some docs to support 
your assertion.

Myself, I'm inclined to guess that it's a simple typo, that an ordinary 
resource-style class declaration (with lowercase 'c') is what was intended.

 

> [...]
>
>  

> By adding that -> Class{'someclass':} to the end you create a chain that 
> requires all classes to completed before 'someclass' is completed.
>


I don't think it's the chain operators that have Salty confused.  He says 
he's ok with a previous line that also uses one.  I'd be confused, too, if 
someone demonstrated that example code to compile successfully.


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/2afa8ebb-0357-47a7-9256-1478b65c5e35%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] How to have init.pp in a module run some function whenever any class in the module is called.

2018-06-05 Thread Martin Alfke
Hi Dan,

variables in classes are always local variables.
You can reference variables from other classes by adding the namespace 
(classname) to the variable.
Referencing variables from other classes is only possible when the class 
containing the variables has been declared:

class adduser::user_ray {
  require adduser::config
  user { 'bob':
ensure  => 'present',
comment  => 'Bob User',
gid=> $adduser::config::staffgid,
home=> '/home/bob',
password => '*',
shell => $adduser::config::tcsh,
uid   => '20049',
managehome => true
  }
}



> On 4. Jun 2018, at 23:24, Dan Mahoney  wrote:
> 
> Hey all,
> 
> We have a simple adduser module, with an init.pp like so:
> 
> class adduser::config {
>case $facts['operatingsystem'] {
>  'Debian': {
>$bash = '/bin/bash'
>$tcsh = '/bin/csh'
>$sh = '/bin/sh'
>$staffgid = '50'
>$wheelgroups = ['adm', 'sudo']
>$rootgroup = 'root'
>  }
>  default: {
>$bash = '/usr/local/bin/bash'
>$csh = '/bin/csh'
>$tcsh = '/bin/csh'
>$sh = '/bin/sh'
>$staffgid = '20'
>$wheelgroups = ['wheel']
>$rootgroup = 'wheel'
>  }
>}
> }
> 
> This code *was* in the main "adduser" class, but we found that when we called 
> a user directly, it didn't run.
> 
> All our users have stanzas like this one:
> 
> class adduser::user_ray {
> require adduser::config
>   user { 'bob':
> ensure   => 'present',
> comment  => 'Bob User',
> gid  => $staffgid,
> home => '/home/bob',
> password => '*',
> shell=> $tcsh,
> uid  => '20049',
> managehome => true
>   }
> }
> 
> Even with the direct require of adduser::config we still see errors like this 
> in the puppetserver log:
> 
> 2018-06-04 03:27:24,369 WARN  [qtp1220040994-783] [puppetserver] Puppet 
> Unknown variable: 'tcsh'. at 
> /usr/local/etc/puppet/code/environments/production/modules/adduser/manifests/init.pp:249:17
> 2018-06-04 03:27:24,377 WARN  [qtp1220040994-783] [puppetserver] Puppet 
> Unknown variable: 'staffgid'. at 
> /usr/local/etc/puppet/code/environments/production/modules/adduser/manifests/init.pp:460:17
> 2018-06-04 03:27:24,380 WARN  [qtp1220040994-783] [puppetserver] Puppet 
> Unknown variable: 'wheelgroups'. at 
> /usr/local/etc/puppet/code/environments/production/modules/adduser/manifests/init.pp:461:17
> 2018-06-04 03:27:24,382 WARN  [qtp1220040994-783] [puppetserver] Puppet 
> Unknown variable: 'bash'. at 
> /usr/local/etc/puppet/code/environments/production/modules/adduser/manifests/init.pp:464:17
> 
> What's the proper way to do this inheritance?  And the proper way to name 
> variables so they scope right?
> 
> Thanks in advance,
> 
> -Dan 
> 
> -- 
> 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/801c1a76-75e0-4cc7-a7ee-8c7262c3ca70%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/EC2CB0E7-DB25-4413-B38F-01D4623C0B12%40gmail.com.
For more options, visit https://groups.google.com/d/optout.