Re: [Puppet Users] Re: Array Iteration for Community Edition of Puppet(3.8)

2017-01-01 Thread Rob Nelson
Be aware that all vendor support for Puppet 3 ended at the end of 2016, and
Puppet provides their own packages (puppet-agent and puppetserver in PC1
replace the older puppet/puppetmaster combo) so you don't have to wait on
Debian. While you should plan your upgrade with care, the lack of any
support should be a motivating factor to start planning immediately instead
of waiting on a third party who isn't negatively affected by waiting, like
you are.

On Sun, Jan 1, 2017 at 4:07 PM Joe <09cic...@gmail.com> wrote:

> Thanks R.I.
>
> So iteration works with 3.8x with future parser. I am going to avoid 4
> until Debian builds it into their repositories.
>
> So iteration works but not with file_line..
>
> Here is the code.
>
> hiera array
> mod1::testdefs:
>   - 'hello'
>   - 'there'
>   - 'friends'
> ##mod1  init.pp
>
> each($testdefs) |$hline| {
>file_line { 'Append a line to /etc/testfile':
>   ensure => present,
>   line  => $hline,
>path=> '/etc/testfile',
> }
> }
>
>
> ##error is this
> Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
> Evaluation Error: Error while evaluating a Resource Statement, Duplicate
> declaration: File_line[Append a line to /etc/testfile] is already declared
> in file /etc/puppet/environments/test/modules/mod1/manifests/init.pp:48;
> cannot redeclare at
> /etc/puppet/environments/test/modules/mod1/manifests/init.pp:48
>
> I tried putting the loop in the file_line type but that throws another
> error since it is not acceptable to file_line.
>
> Is there any way around this that you guys are aware of?
>
> Thanks
>
>
> On Saturday, December 31, 2016 at 10:05:49 PM UTC-7, Joe wrote:
>
> Hi All
>
> Puppet v3.8.7 community on Ubuntu 14 LTS
>
> I have been attempting to write a class to use the "file_line" type
> reference from the stdlib library to add multiple lines to a file if these
> lines are not present.
> I was attempting to do this with iteration using the each function and
> tried with static and Hiera arrays. After a few hours of failure I came
> across the docs for Puppet Enterprise that say this iteration capability
> was introduced in Puppet 4.
>
> It looks like this, testdefs is an array in Hiera defined in the nodes
> yaml config
>
>  each($testdefs) |$hline| {
>file_line { 'Append a line to /etc/testfile':
>   ensure => present,
>   line  => "$hline",
>path=> '/etc/testfile',
> }
> }
>
> To be clear I am trying to..
> iterate through a Hiera array
> pass each array member to the file_line type
> append this member to a file if it does not exist.
>
> Is there a way to do this with Puppet 3.x or should I just make a static
> class with multiple file_line types?
>
> 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/4912ca68-64e4-48d7-906e-923b70aabaa3%40googlegroups.com
> 
> .
>
>
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
Rob Nelson

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


[Puppet Users] Re: Array Iteration for Community Edition of Puppet(3.8)

2017-01-01 Thread Joe
Got it guys, the issue was with the file_line declaration as evidenced by 
the error. I made the declaration change with the variable and it worked. 

Thanks all for the help.

On Saturday, December 31, 2016 at 10:05:49 PM UTC-7, Joe wrote:
>
> Hi All
>
> Puppet v3.8.7 community on Ubuntu 14 LTS
>
> I have been attempting to write a class to use the "file_line" type 
> reference from the stdlib library to add multiple lines to a file if these 
> lines are not present. 
> I was attempting to do this with iteration using the each function and 
> tried with static and Hiera arrays. After a few hours of failure I came 
> across the docs for Puppet Enterprise that say this iteration capability 
> was introduced in Puppet 4.
>
> It looks like this, testdefs is an array in Hiera defined in the nodes 
> yaml config
>
>  each($testdefs) |$hline| {
>file_line { 'Append a line to /etc/testfile':
>   ensure => present,
>   line  => "$hline",
>path=> '/etc/testfile',
> }
> }
>
> To be clear I am trying to.. 
> iterate through a Hiera array 
> pass each array member to the file_line type 
> append this member to a file if it does not exist.  
>
> Is there a way to do this with Puppet 3.x or should I just make a static 
> class with multiple file_line types?
>
> 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/d149a7b7-8961-4107-a08c-d5aee633faba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Array Iteration for Community Edition of Puppet(3.8)

2017-01-01 Thread Joe
Thanks R.I.

So iteration works with 3.8x with future parser. I am going to avoid 4 
until Debian builds it into their repositories.

So iteration works but not with file_line.. 

Here is the code.

hiera array
mod1::testdefs:
  - 'hello'
  - 'there'
  - 'friends'
##mod1  init.pp
each($testdefs) |$hline| {
   file_line { 'Append a line to /etc/testfile':
  ensure => present,
  line  => $hline,
   path=> '/etc/testfile',
}
}


##error is this
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Evaluation Error: Error while evaluating a Resource Statement, Duplicate 
declaration: File_line[Append a line to /etc/testfile] is already declared 
in file /etc/puppet/environments/test/modules/mod1/manifests/init.pp:48; 
cannot redeclare at 
/etc/puppet/environments/test/modules/mod1/manifests/init.pp:48

I tried putting the loop in the file_line type but that throws another 
error since it is not acceptable to file_line.

Is there any way around this that you guys are aware of?

Thanks

On Saturday, December 31, 2016 at 10:05:49 PM UTC-7, Joe wrote:
>
> Hi All
>
> Puppet v3.8.7 community on Ubuntu 14 LTS
>
> I have been attempting to write a class to use the "file_line" type 
> reference from the stdlib library to add multiple lines to a file if these 
> lines are not present. 
> I was attempting to do this with iteration using the each function and 
> tried with static and Hiera arrays. After a few hours of failure I came 
> across the docs for Puppet Enterprise that say this iteration capability 
> was introduced in Puppet 4.
>
> It looks like this, testdefs is an array in Hiera defined in the nodes 
> yaml config
>
>  each($testdefs) |$hline| {
>file_line { 'Append a line to /etc/testfile':
>   ensure => present,
>   line  => "$hline",
>path=> '/etc/testfile',
> }
> }
>
> To be clear I am trying to.. 
> iterate through a Hiera array 
> pass each array member to the file_line type 
> append this member to a file if it does not exist.  
>
> Is there a way to do this with Puppet 3.x or should I just make a static 
> class with multiple file_line types?
>
> 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/4912ca68-64e4-48d7-906e-923b70aabaa3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Array Iteration for Community Edition of Puppet(3.8)

2017-01-01 Thread R.I.Pienaar


- Original Message -
> From: "Joe" <09cic...@gmail.com>
> To: "puppet-users" 
> Sent: Sunday, 1 January, 2017 19:15:03
> Subject: [Puppet Users] Re: Array Iteration for Community Edition of 
> Puppet(3.8)

> Hello Guys thanks for the replies..
> 
> Apologies for the top posting here.. the reply to post only includes my
> text. I am using the "puppetlabs-release-pc1-trusty.deb" apt source from
> puppet labs and the latest version is 3.8.7 as seen below. I am also using
> the puppetmaster-passenger package from the same repo. R.I Pienaarr said to
> use version 4 however I do not see puppetmaster 4 packages available.
> 
> puppetmaster:
>  Installed: (none)
>  Candidate: 3.8.7-1puppetlabs1
>  Version table:
> 3.8.7-1puppetlabs1 0
>500 http://apt.puppetlabs.com/ trusty/main amd64 Packages
> 3.8.6-1puppetlabs1 0
>500 http://apt.puppetlabs.com/ trusty/main amd64 Packages
> 
> 
> Am I missing something? How can I install the Puppetmaster 4 and
> Puppetmaster-passenger 4 packages on ubuntu server via repository?

You'll have to read about upgrading, its quite the undertaking and the
process is designed so people dont accidentally update and then end up
with inoperable CM systems.

Best start with the Puppet 4 upgrade docs and release notes etc, also 
some pretty good talks at recent Puppetconf about updating

-- 
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/1406257407.181120.1483297433107.JavaMail.zimbra%40devco.net.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Array Iteration for Community Edition of Puppet(3.8)

2017-01-01 Thread Joe
Hello Guys thanks for the replies..

Apologies for the top posting here.. the reply to post only includes my 
text. I am using the "puppetlabs-release-pc1-trusty.deb" apt source from 
puppet labs and the latest version is 3.8.7 as seen below. I am also using 
the puppetmaster-passenger package from the same repo. R.I Pienaarr said to 
use version 4 however I do not see puppetmaster 4 packages available.

puppetmaster:
  Installed: (none)
  Candidate: 3.8.7-1puppetlabs1
  Version table:
 3.8.7-1puppetlabs1 0
500 http://apt.puppetlabs.com/ trusty/main amd64 Packages
 3.8.6-1puppetlabs1 0
500 http://apt.puppetlabs.com/ trusty/main amd64 Packages


Am I missing something? How can I install the Puppetmaster 4 and 
Puppetmaster-passenger 4 packages on ubuntu server via repository?

Thanks again



On Saturday, December 31, 2016 at 10:05:49 PM UTC-7, Joe wrote:
>
> Hi All
>
> Puppet v3.8.7 community on Ubuntu 14 LTS
>
> I have been attempting to write a class to use the "file_line" type 
> reference from the stdlib library to add multiple lines to a file if these 
> lines are not present. 
> I was attempting to do this with iteration using the each function and 
> tried with static and Hiera arrays. After a few hours of failure I came 
> across the docs for Puppet Enterprise that say this iteration capability 
> was introduced in Puppet 4.
>
> It looks like this, testdefs is an array in Hiera defined in the nodes 
> yaml config
>
>  each($testdefs) |$hline| {
>file_line { 'Append a line to /etc/testfile':
>   ensure => present,
>   line  => "$hline",
>path=> '/etc/testfile',
> }
> }
>
> To be clear I am trying to.. 
> iterate through a Hiera array 
> pass each array member to the file_line type 
> append this member to a file if it does not exist.  
>
> Is there a way to do this with Puppet 3.x or should I just make a static 
> class with multiple file_line types?
>
> 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/1877ddc2-f248-4206-b6d2-3544ef4cf57f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Array Iteration for Community Edition of Puppet(3.8)

2017-01-01 Thread R.I.Pienaar


- Original Message -
> From: "John Gelnaw" 
> To: "puppet-users" 
> Sent: Sunday, 1 January, 2017 10:48:49
> Subject: Re: [Puppet Users] Array Iteration for Community Edition of 
> Puppet(3.8)

> On Sunday, January 1, 2017 at 2:41:16 AM UTC-5, R.I. Pienaar wrote:
>>
>>
>> Puppet 3 is now dead, upgrade to Puppet 4 - it's free - and you too can
>> enjoy
>> features designed to solve your problem
>>
> 
> While understandable, that's something of an irritating answer-- It
> underlies a problem I've felt puppet has had since the 1.x days-- Any
> feature you're using can stop working with little warning, unless you
> follow the puppetlabs blogs closely.
> 
> Newer changes aren't quite as drastic as banning hyphens from a class name,
> but it can still be a major pain when you have a bunch of puppet code that
> used to work.  :)
> 
> It also does a nice job of completely ignoring the user's question.

This isn't a case of something that stopped working, the feature is new.

> 
> @Joe:  The iteration feature is available in Puppet 3.7.x and later, but
> you need to enable the "future parser"-- which is also the first step in
> upgrading smoothly to puppet 4.x.

Just blindly enabling future parser, especially on older 3.x releases
can actively cause pretty bad side effects, unexpected changes to nodes etc

First time I did it I had to reinstall the machine in question, so perhaps
not the best of advise either :)

-- 
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/1266053538.330.1483281853349.JavaMail.zimbra%40devco.net.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Array Iteration for Community Edition of Puppet(3.8)

2017-01-01 Thread vigilmary via Puppet Users


On Sun, 1/1/17, John Gelnaw  wrote:

 Subject: Re: [Puppet Users] Array Iteration for Community Edition of 
Puppet(3.8)
 To: "Puppet Users" 
 Date: Sunday, January 1, 2017, 11:48 AM
 
 On Sunday,
 January 1, 2017 at 2:41:16 AM UTC-5, R.I. Pienaar
 wrote:
 Puppet 3 is now
 dead, upgrade to Puppet 4 - it's free - and you too can
 enjoy
 
 features designed to solve your problem
 
 
 While understandable, that's
 something of an irritating answer-- It underlies a problem
 I've felt puppet has had since the 1.x days-- Any
 feature you're using can stop working with little
 warning, unless you follow the puppetlabs blogs
 closely.
 Newer changes
 aren't quite as drastic as banning hyphens from a class
 name, but it can still be a major pain when you have a bunch
 of puppet code that used to work.  :)
 It also does a nice job of
 completely ignoring the user's question.
 @Joe:  The iteration feature is
 available in Puppet 3.7.x and later, but you need to enable
 the "future parser"-- which is also the first step
 in upgrading smoothly to puppet 4.x.
 
 
 
 -- 
 
 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/b65eabdd-b7f1-4155-bd6b-44c774bd6156%40googlegroups.com.
 
 For more options, visit https://groups.google.com/d/optout.
 2 ian. - Revolutie la Palermo. 2 febr. - Tratatul de la Guadelupa Hidalgo pune 
capat razboiului dintre Mexic si S.U.A. - Constitutii noi in statele italiene. 
22-24 febr. - Lupte pe baricade la Paris  -inlaturarea Monarhiei din iulie .

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


Re: [Puppet Users] Array Iteration for Community Edition of Puppet(3.8)

2017-01-01 Thread John Gelnaw
On Sunday, January 1, 2017 at 2:41:16 AM UTC-5, R.I. Pienaar wrote:
>
>
> Puppet 3 is now dead, upgrade to Puppet 4 - it's free - and you too can 
> enjoy 
> features designed to solve your problem 
>

While understandable, that's something of an irritating answer-- It 
underlies a problem I've felt puppet has had since the 1.x days-- Any 
feature you're using can stop working with little warning, unless you 
follow the puppetlabs blogs closely.

Newer changes aren't quite as drastic as banning hyphens from a class name, 
but it can still be a major pain when you have a bunch of puppet code that 
used to work.  :)

It also does a nice job of completely ignoring the user's question.

@Joe:  The iteration feature is available in Puppet 3.7.x and later, but 
you need to enable the "future parser"-- which is also the first step in 
upgrading smoothly to puppet 4.x.

-- 
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/b65eabdd-b7f1-4155-bd6b-44c774bd6156%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.