Re: [Puppet Users] How does Puppet Push Model works

2016-08-16 Thread Dirk Heinrichs
Am 17.08.2016 um 05:14 schrieb megha sharma:

> How does puppet push model works for application deployment. It should
> be done in such a way that deployment happens only when required and
> the same should be initiated from puppet master.

It's not really push. Puppet agent runs on each node and connects to the
master every 30 minutes (default), asking for its configuration. So you
need to change the nodes configuration on the master, so that it gets it
next time it connects.

To simulate a push, you'd need to setup mcollective on both master and
nodes. You can then initiate an agent run remotely, from the master.

HTH...

Dirk
-- 

*Dirk Heinrichs*, Senior Systems Engineer, Engineering Solutions
*Recommind GmbH*, Von-Liebig-Straße 1, 53359 Rheinbach
*Tel*: +49 2226 159 (Ansage) 1149
*Email*: d...@recommind.com 
*Skype*: dirk.heinrichs.recommind
www.recommind.com 

-- 
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/4ac46dcb-9957-0d14-93f2-72775868e45a%40recommind.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] How does Puppet Push Model works

2016-08-16 Thread megha sharma
Hello,

How does puppet push model works for application deployment. It should be 
done in such a way that deployment happens only when required and the same 
should be initiated from puppet master.

Thanks,
Megha

-- 
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/5cdf7601-3b05-4a96-8d04-90312d9e7403%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: how to ensure LVM created before installing postgres

2016-08-16 Thread Alex Samad
HI

So got this to work 

volume_group { 'vg_pgdata':
  ensure => present,
  physical_volumes => '/dev/sdc1'
}

logical_volume { 'lv_pgdata92':
  ensure => present,
  volume_group => 'vg_pgdata',

  require => Volume_Group['vg_pgdata'],

}


Also found out that I can't have spaces between File and [

so 
File[ is difference from File [

Not sure I fully understand the [] and the difference between 
{ '':}

A


On Wednesday, 17 August 2016 09:44:42 UTC+10, Alex Samad wrote:
>
> Hi
>
> Just tried this
>
>
> logical_volume { 'lv_pgdata92':
>   ensure => present,
>   volume_group => 'vg_pgdata',
>
>   requires => volume_group { 'vg_pgdata':
>   ensure => present,
>   physical_volumes => '/dev/sdc1'
> }
>
> Got this 
> Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
> Evaluation Error: Error while evaluating a Resource Statement, Syntax error 
> at '{' at 
> /etc/puppetlabs/code/environments/testing/site/profile/manifests/ybpostgresql92.pp:51:32
>  
> on node bitbucket.yieldbroker.com
> W
>
>
> On Wednesday, 17 August 2016 09:27:29 UTC+10, Alex Samad wrote:
>>
>> Okay
>>
>> that sounds okay, how do I add fatal call to it to stop it processing any 
>> more 
>>
>> Alex
>>
>> On Tuesday, 16 August 2016 17:53:33 UTC+10, Gavin Williams wrote:
>>>
>>> Alex
>>>
>>> You're looking for 'Requires' - See 
>>> https://docs.puppet.com/puppet/latest/reference/lang_relationships.html
>>>
>>> Basically, you can add "requires => Logical_Volume['lv_pgdata']" to the 
>>> 'postgresql::server' class, and if the Logical_Volume resource fails for 
>>> whatever reason, then the 'postgresql::server' class will be skipped... 
>>>
>>> HTH
>>>
>>> Gav
>>>
 [snip]

>>>

-- 
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/b6ea0bad-ef0b-4e5b-85af-3bd6bbba7b03%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: how to ensure LVM created before installing postgres

2016-08-16 Thread Alex Samad
Hi

Just tried this


logical_volume { 'lv_pgdata92':
  ensure => present,
  volume_group => 'vg_pgdata',

  requires => volume_group { 'vg_pgdata':
  ensure => present,
  physical_volumes => '/dev/sdc1'
}

Got this 
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Evaluation Error: Error while evaluating a Resource Statement, Syntax error 
at '{' at 
/etc/puppetlabs/code/environments/testing/site/profile/manifests/ybpostgresql92.pp:51:32
 
on node bitbucket.yieldbroker.com
W


On Wednesday, 17 August 2016 09:27:29 UTC+10, Alex Samad wrote:
>
> Okay
>
> that sounds okay, how do I add fatal call to it to stop it processing any 
> more 
>
> Alex
>
> On Tuesday, 16 August 2016 17:53:33 UTC+10, Gavin Williams wrote:
>>
>> Alex
>>
>> You're looking for 'Requires' - See 
>> https://docs.puppet.com/puppet/latest/reference/lang_relationships.html
>>
>> Basically, you can add "requires => Logical_Volume['lv_pgdata']" to the 
>> 'postgresql::server' class, and if the Logical_Volume resource fails for 
>> whatever reason, then the 'postgresql::server' class will be skipped... 
>>
>> HTH
>>
>> Gav
>>
>> On Tuesday, 16 August 2016 02:16:48 UTC+1, Alex Samad wrote:
>>>
>>> Hi
>>>
>>> I would like to setup my LVM first 
>>> PV
>>> VG
>>> PV 
>>> mount that in /var/lib/pgsql/9.2/data and then use
>>>
>>> # default
>>> class { 'postgresql::globals':
>>>   manage_package_repo => false,
>>>   version => '9.2',
>>> }->
>>>   class { 'postgresql::server':
>>>   }
>>>
>>>
>>> now for testing I haven't installed /dev/sdc which is my phys disk for 
>>> the vg..
>>>
>>> I would like the install of postgress to fail
>>>
>>>
>>>
>>> # predefined mounts
>>> # not done via lvm - can't do labels !
>>>
>>> # setup PG Data directory first
>>> file { '/var/lib/pgsql':
>>>   ensure   => 'directory',
>>>   group=> '26',
>>>   mode => '0700',
>>>   owner=> '26',
>>> }
>>>
>>> file { '/var/lib/pgsql/9.2/':
>>>   ensure   => 'directory',
>>>   group=> '26',
>>>   mode => '0700',
>>>   owner=> '26',
>>> }
>>>
>>> # incuded as part of the postgres module
>>> #file { '/var/lib/pgsql/9.2/data':
>>> #  ensure   => 'directory',
>>> #  group=> '26',
>>> #  mode => '0700',
>>> #  owner=> '26',
>>> #}
>>>
>>> filesystem { '/dev/vg_pgdata/lv_pgdata':
>>>   ensure => 'present',
>>>   fs_type => 'ext4',
>>>   options => '-L ybPGData',
>>> }
>>>
>>> mount { '/var/lib/pgsql/9.2/data':
>>>   ensure  => 'mounted',
>>>   device  => 'LABEL=ybPGData',
>>>   dump=> '1',
>>>   fstype  => 'ext4',
>>>   options => 'defaults',
>>>   pass=> '2',
>>>   target  => '/etc/fstab',
>>> }
>>>
>>> volume_group { 'vg_pgdata':
>>>   ensure => present,
>>>   physical_volumes => '/dev/sdc1'
>>> }
>>>
>>> logical_volume { 'lv_pgdata':
>>>   ensure => present,
>>>   volume_group => 'vg_pgdata',
>>>   size => '20G',
>>> }
>>>
>>>
>>>
>>> #
>>> # latest postgres rpm
>>> #
>>> package { 'pgdg-centos92-repo':
>>>   name => 'pgdg-centos92',
>>>   ensure => 'installed',
>>>   provider => 'rpm',
>>>   source => '
>>> https://download.postgresql.org/pub/repos/yum/9.2/redhat/rhel-6-x86_64/pgdg-centos92-9.2-7.noarch.rpm
>>> ',
>>>   install_options => [
>>> '--httpproxy',
>>> 'proxyyb',
>>> '--httpport',
>>> '3128',
>>>   ]
>>> }
>>>
>>> # have to overwrite the repo file
>>> file { 're_pgdg-centos92':
>>>   ensure => present,
>>>   path => '/etc/yum.repos.d/pgdg-92-centos.repo',
>>>   content => file('profile/ybpostgresql92/pgdg-92-centos.repo'),
>>>   owner => 'root',
>>>   group => 'root',
>>>   mode => 'u=rw,g=r,o=r',
>>> }
>>>
>>>
>>> # default
>>> class { 'postgresql::globals':
>>>   manage_package_repo => false,
>>>   version => '9.2',
>>> }->
>>>   class { 'postgresql::server':
>>>   }
>>>
>>>
>>>

-- 
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/ae190c4f-88e5-47b5-bc23-87966d42b227%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Noop metaparameter in class not working as expected

2016-08-16 Thread Julio Guevara
All puppet agent have on puppet.conf
noop = true

I need to make sure that some classes (like the class that configure the 
puppet-agents or mcollective) can run regardless of noop setting.

Following documentation for puppet 4.5.3 i found that 
https://docs.puppet.com/puppet/4.5/reference/metaparameter.html#noop 

and
https://docs.puppet.com/puppet/4.5/reference/lang_classes.html#using-resource-like-declarations

I changed corresponding include for resource like declaration of those 
classes, but resources contained inside that class still acted normally.
It seems to be that resources contained within a class will behave 
according to configuration set on puppet.conf even if the class has set 
noop to a different value.

Code i used to test this issue:
class foo {
  notify { '1.Resource noop true' :
noop => true,
  }
  notify { '2.Resource noop false' :
noop => false,
  }
  notify { "3.Class noop ${noop}" : }
  notify { "4.Client noop ${clientnoop}" : }
}


class { 'foo' :
  noop => true,
}

What I expected:
  Notify 1 should print as no-op regardless of other configuration.
  Notify 2 should print as yes-op regardless of other configuration.
  Notify 3 would print as no-op because of class having noop => true.
  Notify 4 would print as no-op because of class having noop => true.

What I'm seeing:
  Notify 1 prints as expected
  Notify 2 prints as expected
  Notify 3 prints as yes-op, not expected
  Notify 4 prints as yes-op, not expected

Output from 
# puppet apply test.pp
Notice: Compiled catalog for xxx in environment production in 0.06 
seconds
Notice: /Stage[main]/Foo/Notify[1.Resource noop true]/message: 
current_value absent, should be 1.Resource noop true (noop)
Notice: 2.Resource noop false
Notice: /Stage[main]/Foo/Notify[2.Resource noop false]/message: defined 
'message' as '2.Resource noop false'
Notice: 3.Class noop true
Notice: /Stage[main]/Foo/Notify[3.Class noop true]/message: defined 
'message' as '3.Class noop true'
Notice: 4.Client noop false
Notice: /Stage[main]/Foo/Notify[4.Client noop false]/message: defined 
'message' as '4.Client noop false'
Notice: Applied catalog in 0.14 seconds

I don't think I have misunderstood the documentation from puppet, but i 
could be crazy.
Also, what happens with classes inside classes, those they get the noop 
from the parent class or from the configuration

Thanks
Julio

-- 
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/1f35f5f7-5822-4480-af65-1ca649224d4d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: how to ensure LVM created before installing postgres

2016-08-16 Thread Alex Samad
Okay

that sounds okay, how do I add fatal call to it to stop it processing any 
more 

Alex

On Tuesday, 16 August 2016 17:53:33 UTC+10, Gavin Williams wrote:
>
> Alex
>
> You're looking for 'Requires' - See 
> https://docs.puppet.com/puppet/latest/reference/lang_relationships.html
>
> Basically, you can add "requires => Logical_Volume['lv_pgdata']" to the 
> 'postgresql::server' class, and if the Logical_Volume resource fails for 
> whatever reason, then the 'postgresql::server' class will be skipped... 
>
> HTH
>
> Gav
>
> On Tuesday, 16 August 2016 02:16:48 UTC+1, Alex Samad wrote:
>>
>> Hi
>>
>> I would like to setup my LVM first 
>> PV
>> VG
>> PV 
>> mount that in /var/lib/pgsql/9.2/data and then use
>>
>> # default
>> class { 'postgresql::globals':
>>   manage_package_repo => false,
>>   version => '9.2',
>> }->
>>   class { 'postgresql::server':
>>   }
>>
>>
>> now for testing I haven't installed /dev/sdc which is my phys disk for 
>> the vg..
>>
>> I would like the install of postgress to fail
>>
>>
>>
>> # predefined mounts
>> # not done via lvm - can't do labels !
>>
>> # setup PG Data directory first
>> file { '/var/lib/pgsql':
>>   ensure   => 'directory',
>>   group=> '26',
>>   mode => '0700',
>>   owner=> '26',
>> }
>>
>> file { '/var/lib/pgsql/9.2/':
>>   ensure   => 'directory',
>>   group=> '26',
>>   mode => '0700',
>>   owner=> '26',
>> }
>>
>> # incuded as part of the postgres module
>> #file { '/var/lib/pgsql/9.2/data':
>> #  ensure   => 'directory',
>> #  group=> '26',
>> #  mode => '0700',
>> #  owner=> '26',
>> #}
>>
>> filesystem { '/dev/vg_pgdata/lv_pgdata':
>>   ensure => 'present',
>>   fs_type => 'ext4',
>>   options => '-L ybPGData',
>> }
>>
>> mount { '/var/lib/pgsql/9.2/data':
>>   ensure  => 'mounted',
>>   device  => 'LABEL=ybPGData',
>>   dump=> '1',
>>   fstype  => 'ext4',
>>   options => 'defaults',
>>   pass=> '2',
>>   target  => '/etc/fstab',
>> }
>>
>> volume_group { 'vg_pgdata':
>>   ensure => present,
>>   physical_volumes => '/dev/sdc1'
>> }
>>
>> logical_volume { 'lv_pgdata':
>>   ensure => present,
>>   volume_group => 'vg_pgdata',
>>   size => '20G',
>> }
>>
>>
>>
>> #
>> # latest postgres rpm
>> #
>> package { 'pgdg-centos92-repo':
>>   name => 'pgdg-centos92',
>>   ensure => 'installed',
>>   provider => 'rpm',
>>   source => '
>> https://download.postgresql.org/pub/repos/yum/9.2/redhat/rhel-6-x86_64/pgdg-centos92-9.2-7.noarch.rpm
>> ',
>>   install_options => [
>> '--httpproxy',
>> 'proxyyb',
>> '--httpport',
>> '3128',
>>   ]
>> }
>>
>> # have to overwrite the repo file
>> file { 're_pgdg-centos92':
>>   ensure => present,
>>   path => '/etc/yum.repos.d/pgdg-92-centos.repo',
>>   content => file('profile/ybpostgresql92/pgdg-92-centos.repo'),
>>   owner => 'root',
>>   group => 'root',
>>   mode => 'u=rw,g=r,o=r',
>> }
>>
>>
>> # default
>> class { 'postgresql::globals':
>>   manage_package_repo => false,
>>   version => '9.2',
>> }->
>>   class { 'postgresql::server':
>>   }
>>
>>
>>

-- 
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/af895f2a-3bf7-4e93-86cb-d6a9db877c4a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] R10k Deploy single module first time

2016-08-16 Thread Christopher Wood
You can incrementally check r10k syntax with:

r10k
r10k deploy
(etc.)

In your case maybe one of these? Try it and see, I never use these.

r10k deploy module modulename
r10k deploy module --environment myenv modulename

On Tue, Aug 16, 2016 at 08:14:14AM -0700, broncosd183 wrote:
>Hello,
> 
>Is there a way to deploy a single module from a puppetfile the first time
>it is added to an environment's puppetfile without deploying other
>modules? Normally when we add a module from the forge or git we add it to
>the puppetfile and then run r10k deploy environment -pv. That deploys all
>the modules and can be somewhat time consuming. I know r10k deploy module
>exists, but it looks like that doesn't deploy a module if it was just
>added to the puppetfile... 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 [1]puppet-users+unsubscr...@googlegroups.com.
>To view this discussion on the web visit
>
> [2]https://groups.google.com/d/msgid/puppet-users/e775d602-ce6e-4de4-a3fd-be2989aceae9%40googlegroups.com.
>For more options, visit [3]https://groups.google.com/d/optout.
> 
> References
> 
>Visible links
>1. mailto:puppet-users+unsubscr...@googlegroups.com
>2. 
> https://groups.google.com/d/msgid/puppet-users/e775d602-ce6e-4de4-a3fd-be2989aceae9%40googlegroups.com?utm_medium=email_source=footer
>3. https://groups.google.com/d/optout

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/20160816160522.GA2006%40iniquitous.heresiarch.ca.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] R10k Deploy single module first time

2016-08-16 Thread broncosd183
Hello,

Is there a way to deploy a single module from a puppetfile the first time 
it is added to an environment's puppetfile without deploying other modules? 
Normally when we add a module from the forge or git we add it to the 
puppetfile and then run r10k deploy environment -pv. That deploys all the 
modules and can be somewhat time consuming. I know r10k deploy module 
exists, but it looks like that doesn't deploy a module if it was just added 
to the puppetfile... 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/e775d602-ce6e-4de4-a3fd-be2989aceae9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] variable scoping and erb templates

2016-08-16 Thread R.I.Pienaar


- Original Message -
> From: "Matt Zagrabelny" 
> To: "puppet-users" 
> Sent: Tuesday, 16 August, 2016 15:07:28
> Subject: Re: [Puppet Users] variable scoping and erb templates

> On Tue, Aug 16, 2016 at 8:04 AM, jcbollinger  
> wrote:
>>>
>>> On Tue, Aug 16, 2016 at 1:31 AM, Lowe Schmidt  wrote:
>>> > What version of Puppet are you running?
>>>
>>> Debian Jessie:
>>>
>>> 3.7.2-4
>>>
>>
>>
>> That looks like bug PUP-1220.  Note that although the ticket is marked as
>> being fixed in Puppet 3.5, commentary on the ticket and details of the
>> associated commit make me think that the fix only applies when you use the
>> future parser.
> 
> Thanks for clearing my confusion, John!

historically this is how puppet worked both in manifests and templates, that
got deprecated but for some reason templates didnt get the same treatment, 4
finished the job

> 
> Best,
> 
> -m
> 
> --
> 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/CAOLfK3W4DAqi9%3D63pwxGUO_jYQkcL6bnSMx_cePPN3z1dVyuyA%40mail.gmail.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/164645949.512039.1471353775876.JavaMail.zimbra%40devco.net.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Puppet Without Agent

2016-08-16 Thread jcbollinger


On Monday, August 15, 2016 at 8:41:04 AM UTC-5, guilherme...@netbr.com.br 
wrote:
>
> Hi guys,
>
> I wonder if I can use the Puppet without agent. I only need the Puppet 
> connect on some servers through SSH and run some command lines.
>
> Do you know if Puppet do this?
>
>
Puppet will not connect to another machine on your behalf or run commands 
on remote machines.

Puppet *can* be run without using the agent, however.  Puppet must be 
installed on the machine to be managed, and the needed manifests and data 
must be accessible on that machine.  You can then use 'puppet apply' to 
build and apply a catalog locally, using a manifest you designate as the 
starting manifest.  This does require somehow distributing the needed 
manifests and data; source-control systems and network filesystems are some 
of the popular means for handling that end.


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/cf10ed88-6312-4d6d-8713-3d9fe2a44375%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] variable scoping and erb templates

2016-08-16 Thread Matt Zagrabelny
On Tue, Aug 16, 2016 at 8:04 AM, jcbollinger  wrote:
>>
>> On Tue, Aug 16, 2016 at 1:31 AM, Lowe Schmidt  wrote:
>> > What version of Puppet are you running?
>>
>> Debian Jessie:
>>
>> 3.7.2-4
>>
>
>
> That looks like bug PUP-1220.  Note that although the ticket is marked as
> being fixed in Puppet 3.5, commentary on the ticket and details of the
> associated commit make me think that the fix only applies when you use the
> future parser.

Thanks for clearing my confusion, John!

Best,

-m

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


Re: [Puppet Users] variable scoping and erb templates

2016-08-16 Thread jcbollinger


On Tuesday, August 16, 2016 at 7:06:28 AM UTC-5, Matt Zagrabelny wrote:
>
> Hi Lowe, 
>
> On Tue, Aug 16, 2016 at 1:31 AM, Lowe Schmidt  > wrote: 
> > What version of Puppet are you running? 
>
> Debian Jessie: 
>
> 3.7.2-4 
>
>

That looks like bug PUP-1220 
.  Note that although the 
ticket is marked as being fixed in Puppet 3.5, commentary on the ticket and 
details of the associated commit make me think that the fix only applies 
when you use the future parser.


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/4ca213ba-6572-473a-9624-0fc9d47942b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] variable scoping and erb templates

2016-08-16 Thread Matt Zagrabelny
Hi Lowe,

On Tue, Aug 16, 2016 at 1:31 AM, Lowe Schmidt  wrote:
> What version of Puppet are you running?

Debian Jessie:

3.7.2-4

-m

> --
> Lowe Schmidt | +46 723 867 157
>
> On 15 August 2016 at 20:48, Matt Zagrabelny  wrote:
>>
>> Greetings!
>>
>> I am hitting a curious question and couldn't find an answer.
>>
>> I can access variables from other classes when using an erb template.
>>
>> Here is my minimal example:
>>
>> # puppet apply variable_scope_test.pp
>> Notice: Compiled catalog for puppet.example.com in environment
>> production in 0.12 seconds
>> Notice: A variable from a different class:
>> Notice: /Stage[main]/Scope_example::Sub_class/Notify[A variable from a
>> different class: ]/message: defined 'message' as 'A variable from a
>> different class: '
>> Notice: Finished catalog run in 0.11 seconds
>>
>> # cd /tmp
>> # head -n -0 variable_scope_test.pp template.erb template_output
>> ==> variable_scope_test.pp <==
>> class scope_example {
>> $variable = "THIS IS A TEST!"
>> include scope_example::sub_class
>> }
>>
>> class scope_example::sub_class {
>> file { '/tmp/template_output':
>> content => template('/tmp/template.erb'),
>> }
>> notify { "A variable from a different class: $variable": }
>> }
>>
>> node 'puppet.example.com' {
>> include scope_example
>> }
>>
>> ==> template.erb <==
>> <%= @variable %>
>>
>> ==> template_output <==
>> THIS IS A TEST!
>>
>> So why is the template allowed to see variables in other classes?
>>
>> I would have ad expected to need to use the variable like:
>>
>> <%= @scope_example::variable %>
>>
>> But it clearly works without adjusting its namespace.
>>
>> Thoughts?
>>
>> Thanks!
>>
>> -m
>>
>> --
>> 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/CAOLfK3WBY9Hg%3DsaiHA2iAt4SRQjBX6XLsAJVj_qLGHJgjuugEg%40mail.gmail.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/CAC-wWcSmcHxSC5h169UOBiqq0HJTRtN7C4WfRbmnW02rHgx_OA%40mail.gmail.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/CAOLfK3XcZQ3ck7ZN8BWf27OT8Oc-suk-hBXZ01v1uXLANQoxGA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Can I include hieradata in my puppet repo?

2016-08-16 Thread Rob Nelson
Including hieradata in your controlrepo is a common practice recommended
now by Puppet. See
http://garylarizza.com/blog/2015/11/16/workflows-evolved-even-besterer-practices/
for an explanation of why and https://github.com/puppetlabs/control-repo
for an example layout.


Rob Nelson
rnels...@gmail.com

On Tue, Aug 16, 2016 at 2:28 AM, Pubudu Gunatilaka 
wrote:

> Hi,
>
> I am using hieradata with puppet modules. Can I include hieradata in my
> puppet module repository? I can use a .pmtignore file and
> exclude hieradata from bundling to the puppet module. What is the best
>  practise?
>
> 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/27101f30-4195-422e-9059-a7e86112a994%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/CAC76iT-DgXdpOj_8afDnE4LgzVYQCMwt%2BHPMLZWKdaYuW9CBsQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Can I include hieradata in my puppet repo?

2016-08-16 Thread Pubudu Gunatilaka
Hi,

I am using hieradata with puppet modules. Can I include hieradata in my 
puppet module repository? I can use a .pmtignore file and 
exclude hieradata from bundling to the puppet module. What is the best
 practise? 

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/27101f30-4195-422e-9059-a7e86112a994%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: how to ensure LVM created before installing postgres

2016-08-16 Thread Gavin Williams
Alex

You're looking for 'Requires' - 
See https://docs.puppet.com/puppet/latest/reference/lang_relationships.html

Basically, you can add "requires => Logical_Volume['lv_pgdata']" to the 
'postgresql::server' class, and if the Logical_Volume resource fails for 
whatever reason, then the 'postgresql::server' class will be skipped... 

HTH

Gav

On Tuesday, 16 August 2016 02:16:48 UTC+1, Alex Samad wrote:
>
> Hi
>
> I would like to setup my LVM first 
> PV
> VG
> PV 
> mount that in /var/lib/pgsql/9.2/data and then use
>
> # default
> class { 'postgresql::globals':
>   manage_package_repo => false,
>   version => '9.2',
> }->
>   class { 'postgresql::server':
>   }
>
>
> now for testing I haven't installed /dev/sdc which is my phys disk for the 
> vg..
>
> I would like the install of postgress to fail
>
>
>
> # predefined mounts
> # not done via lvm - can't do labels !
>
> # setup PG Data directory first
> file { '/var/lib/pgsql':
>   ensure   => 'directory',
>   group=> '26',
>   mode => '0700',
>   owner=> '26',
> }
>
> file { '/var/lib/pgsql/9.2/':
>   ensure   => 'directory',
>   group=> '26',
>   mode => '0700',
>   owner=> '26',
> }
>
> # incuded as part of the postgres module
> #file { '/var/lib/pgsql/9.2/data':
> #  ensure   => 'directory',
> #  group=> '26',
> #  mode => '0700',
> #  owner=> '26',
> #}
>
> filesystem { '/dev/vg_pgdata/lv_pgdata':
>   ensure => 'present',
>   fs_type => 'ext4',
>   options => '-L ybPGData',
> }
>
> mount { '/var/lib/pgsql/9.2/data':
>   ensure  => 'mounted',
>   device  => 'LABEL=ybPGData',
>   dump=> '1',
>   fstype  => 'ext4',
>   options => 'defaults',
>   pass=> '2',
>   target  => '/etc/fstab',
> }
>
> volume_group { 'vg_pgdata':
>   ensure => present,
>   physical_volumes => '/dev/sdc1'
> }
>
> logical_volume { 'lv_pgdata':
>   ensure => present,
>   volume_group => 'vg_pgdata',
>   size => '20G',
> }
>
>
>
> #
> # latest postgres rpm
> #
> package { 'pgdg-centos92-repo':
>   name => 'pgdg-centos92',
>   ensure => 'installed',
>   provider => 'rpm',
>   source => '
> https://download.postgresql.org/pub/repos/yum/9.2/redhat/rhel-6-x86_64/pgdg-centos92-9.2-7.noarch.rpm
> ',
>   install_options => [
> '--httpproxy',
> 'proxyyb',
> '--httpport',
> '3128',
>   ]
> }
>
> # have to overwrite the repo file
> file { 're_pgdg-centos92':
>   ensure => present,
>   path => '/etc/yum.repos.d/pgdg-92-centos.repo',
>   content => file('profile/ybpostgresql92/pgdg-92-centos.repo'),
>   owner => 'root',
>   group => 'root',
>   mode => 'u=rw,g=r,o=r',
> }
>
>
> # default
> class { 'postgresql::globals':
>   manage_package_repo => false,
>   version => '9.2',
> }->
>   class { 'postgresql::server':
>   }
>
>
>

-- 
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/9b028628-3b87-40d6-b62e-7833b5448a52%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] variable scoping and erb templates

2016-08-16 Thread Lowe Schmidt
What version of Puppet are you running?

--
Lowe Schmidt | +46 723 867 157

On 15 August 2016 at 20:48, Matt Zagrabelny  wrote:

> Greetings!
>
> I am hitting a curious question and couldn't find an answer.
>
> I can access variables from other classes when using an erb template.
>
> Here is my minimal example:
>
> # puppet apply variable_scope_test.pp
> Notice: Compiled catalog for puppet.example.com in environment
> production in 0.12 seconds
> Notice: A variable from a different class:
> Notice: /Stage[main]/Scope_example::Sub_class/Notify[A variable from a
> different class: ]/message: defined 'message' as 'A variable from a
> different class: '
> Notice: Finished catalog run in 0.11 seconds
>
> # cd /tmp
> # head -n -0 variable_scope_test.pp template.erb template_output
> ==> variable_scope_test.pp <==
> class scope_example {
> $variable = "THIS IS A TEST!"
> include scope_example::sub_class
> }
>
> class scope_example::sub_class {
> file { '/tmp/template_output':
> content => template('/tmp/template.erb'),
> }
> notify { "A variable from a different class: $variable": }
> }
>
> node 'puppet.example.com' {
> include scope_example
> }
>
> ==> template.erb <==
> <%= @variable %>
>
> ==> template_output <==
> THIS IS A TEST!
>
> So why is the template allowed to see variables in other classes?
>
> I would have ad expected to need to use the variable like:
>
> <%= @scope_example::variable %>
>
> But it clearly works without adjusting its namespace.
>
> Thoughts?
>
> Thanks!
>
> -m
>
> --
> 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/CAOLfK3WBY9Hg%3DsaiHA2iAt4SRQjBX6XLsAJVj_
> qLGHJgjuugEg%40mail.gmail.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/CAC-wWcSmcHxSC5h169UOBiqq0HJTRtN7C4WfRbmnW02rHgx_OA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.