Re: [Puppet Users] Re: Is ensure_resource() evil?

2018-03-20 Thread jcbollinger
On Tuesday, October 17, 2017 at 7:59:16 AM UTC-5, jcbollinger wrote:

>
> Nothing has changed with `ensure_resource()`.  The problem is not its 
> implementation details, but rather the nature of the usage modes the 
> function is *designed* to support.  The whole idea of it is flawed.
>


Funny story:

I have recently been working with an "approved" Forge module, which will go 
unnamed.  It has a long history, and overall is of high quality.  But it 
happens to use ensure_resource(), and sure enough, that bit me in the ass: 
it is the cause of a module bug that crops up under relatively unusual 
circumstances.  Then when I tried to fix the bug, ensure_resource() did it 
again.

The failure mode isn't even among those I usually harp on.  Maybe the 
function's behavior has changed over time, or maybe I never knew this about 
it, but in Stdlib 4, the function only protects against declaration of 
*identical* resources -- it will happily generate a resource with the same 
title as another that has already been declared, as long as there is a 
difference between their declared parameters.  This of course elicits a 
duplicate resource declaration error from Puppet (and this is intentional: 
function's docs disclose it).

And here's the kicker: after my attempted bugfix, the duplicate 
declarations in fact *are* identical, at least as expressed to 
ensure_resource().  They are rendered non-identical externally by 
application of a resource override.  Apparently, the override is applied 
either together with application of the first ensure_resource() call in 
some way that messes up the resource comparison in the second, or between 
the effects of the first call and the effects of the second call.  Maybe 
that's a bug.

To be sure, I would rather have the function fail loudly than break 
quietly, but I would even more have liked to have a module that doesn't 
depend on ensure_resource() in the first place.


John
"ensure_resource() is evil"

-- 
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/46001944-4feb-4721-bf6c-b2a1b9daa9b7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] The 2018 Puppet User Survey is up!

2018-03-20 Thread Eric Sorenson
Hey all, we're running a survey for the next couple of weeks to get a better 
understanding of who's using Puppet, what the mix of operating systems and 
Puppet versions looks like, and how we could make better Puppet products in the 
future. It's going to be open for the next couple of weeks; once it's done I'll 
summarize the results and post some (hopefully interesting) insights from your 
responses.   It's only a few questions and should take less than 5 minutes to 
complete, plus as an added incentive, for every response we'll donate $3 to the 
EFF!

I made a quick blog post about it here: 
https://puppet.com/blog/2018-puppet-user-survey

And here's a direct link to the survey: 
https://www.surveygizmo.com/s3/4227485/puppet-users

--eric0

Eric Sorenson - e...@puppet.com  
director of product, ecosystem and platform

-- 
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/606CDA72-24CA-4051-966D-CD13A99D64A9%40puppet.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Announce: Puppet Platform 5.5.0 is now available

2018-03-20 Thread Molly Waggett
Puppet Platform 5.5.0 is a bug-fix and feature release that adds agent
support for Fedora 27, adds several stdlib functions to Puppet's core
functions, improves the puppet config command and yumrepo provider,
restores the ability to upload facts to Puppet Server and other Puppet
masters, and adds additional performance metrics to the run report.

Puppet Server 5.3.0 can now use some gems shipped by puppet-agent and
compresses catalog response bodies. PuppetDB 5.2.1 improves the performance
of fact queries. Facter 3.11 fixes an issue with uptime tracking in Windows
and reports SSH key types in the `ssh` fact.

For details, see the release notes for Puppet agent 5.5.0
, Facter 3.11.0
, Puppet Server
5.3.0 ,
and PuppetDB
5.2.1 .

Thanks!

-- 
*Molly Waggett*
she/her/hers
Release Engineer @ Puppet, Inc.

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


[Puppet Users] Announcement: Release of Facter 3.11.0 gem

2018-03-20 Thread sean . mcdonald


Hey Folks!

We are officially shipping a gem for Facter 3.11.0! There is both a source 
and a set of precompiled gems available for installation. 

We understand that migrating from Facter 2 to Facter 3 is not a small task. 
As such we have decided to ship Facter 3 technically as a ‘pre-release’ 
gem. The version of the official release of facter 3.11.0 will be:

facter-3.11.0.cfacter.20180319

Note that this means in order to make use of facter 3.11 in your gemfile or 
gemspec you will need to specify the version all the way down to ‘.cfacter’:

gem facter, ‘~> 3.11.0.cfacter’

Using ‘--pre’ with rubygems will pull down the latest facter 3 gem for you:

gem install facter --pre

We are shipping the first facter 3 gems as ‘pre-releases’ to allow users 
(and ourselves) some time to use the new gem and find out what and where we 
need to improve the gem before moving it to a standard release. We fully 
plan on shipping Facter 3 as a standard release gem in the near future, but 
we would like users to try out the pre-release gem first and gather some 
feedback.

Currently, the first iteration of the facter 3 gem does not include the 
facter binary, and is missing EC2 support. For this release we are focused 
on learning about incompatibilities in module testing.

Please download the new Facter 3 gem and try it out! We would love your 
feedback


-- 
Sean P. McDonald
Software Engineer, Puppet Inc.

-- 
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/8c133ecb-3d2f-44d5-8abd-679c9cda796b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Certificate Regeneration issues on Windows agent

2018-03-20 Thread Subhi Andrews
We tried to point our working windows agent to a different puppet master 
and we can't get the certificate to generate with the new puppet server or 
revert back to the old one. In both puppet master cases, we get the 
following error:

*Info: Caching certificate for pfawseot01.xyz.com*
*Error: Could not request certificate: The certificate retrieved from the 
master does not match the agent's private key.*
*Certificate fingerprint: *

*To fix this, remove the certificate from both the master and the agent and 
then start a puppet run, which will automatic*
*ally regenerate a certficate.*
*On the master:*
*  puppet cert clean pfawseot01.xyz.com*
*On the agent:*
*  1a. On most platforms: find C:/ProgramData/PuppetLabs/puppet/etc/ssl 
-name pfawseot01.xyz.com.pem -delete*
*  1b. On Windows: del 
"C:/ProgramData/PuppetLabs/puppet/etc/ssl/pfawseot01.xyx.com.pem" /f*
*  2. puppet agent -t*

Tried following the above instruction. Also deleted cached catalog on the 
agent, but keeps giving the same error message. Any clues, or suggestions?

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/c05a585a-30a6-4a0b-84e5-f55b886c17d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Code Manager + Bit bucket integration is not working

2018-03-20 Thread linux . today . future
Hi All,

I am not able to integrate my PE code manager with Bit Bucket server.

Following are error:

[root@aexxxpv007 ~]# puppet-code status
{
  "alerts": [],
  "detail_level": "info",
  "state": "running",
  "status": {
"file_sync": "enabled",
"services": {
  "file-sync-storage": "running"
}
  }
}
[root@aexxxpv007 ~]# r10k deploy display --fetch
ERROR-> Unable to determine current branches for Git source 'puppet' 
(/etc/puppetlabs/code/environments)
Original exception:
Authentication failed for Git remote 
"http://aexxxpv007.corp.acxiom.net:7990/scm/dem/entr.git;.
[root@aexxxpv007 ~]# curl -k -X POST -H 'Content-Type: application/json' -H 
"X-Authentication: `cat ~/.puppetlabs/token`" 
https://aexxxpv007.corp.acxiom.net:8170/code-manager/v1/deploys -d 
'{"dry_run": true}'
{"kind":"puppetlabs.code-manager/collect-failed","msg":"Errors while 
collecting a list of environments to deploy (exit code: 
1).","details":"ERROR\t -> Unable to determine current branches for Git 
source 'puppet' (/etc/puppetlabs/code-staging/environments)\nOriginal 
exception:\nAuthentication failed for Git remote 
\"http://aexxxpv007.corp.acxiom.net:7990/scm/dem/entr.git\".\n"}[root@aexxxpv007
 
~]#

-- 
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/9c398eb4-4e00-4f87-9b26-e8d3311e7605%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Raspberry Pi Agents

2018-03-20 Thread Michael Stahnke
On Tue, Mar 13, 2018 at 3:50 AM, Dietrich, Stefan 
wrote:

> Hello Michael,
>
> oh, another Puppet on Pi user :)
>
> Any specific reason to drop the pl-build-tools for Debian 9 [1] ?
> I have recently build Puppet Agent 1.10.10 for Debian 8/9 on armhf as
> well...and for RHEL 7 on ppc64 (big endian).
> I still found it easier to build the pl-build-tools packages than removing
> all the references?
>

I'd like to drop pl-build-tools wherever possible. It's a lot more to
maintain. When we first started using C++11, not too many OSes had new
enough GCC, Boost and friends to make compiling very easy. We ended up
having to build out our own toolchains. It wasn't very fun. Now that it's
been a few years, most OSes have the requirements built-in. This means we
should be able to use system-tools where possible. I'm hoping to get some
(all) of that worked on puppet-agent master over the net few months so that
anything that can be built without a custom toolchain works that way
internally as well. (Master is now what will become Puppet platform 6).
Some OSes will have to keep custom toolchains (e.g. AIX, Solaris, older
RHEL), but anywhere we can get rid of it, I'm in favor.



>
> [1] https://github.com/stahnma/puppet-agent/commit/
> 02faa1ab51f74ddb827ca1c3f5da5c3ab9c17a20 (assuming, this is your repo?)
>
> Regards,
> Stefan
>
> - Original Message -
> > From: "Michael Stahnke" 
> > To: puppet-users@googlegroups.com
> > Sent: Monday, March 12, 2018 7:35:16 PM
> > Subject: [Puppet Users] Raspberry Pi Agents
>
> > In my spare time, I build out puppet-agents for Raspberry pis, because I
> > like pain and ARM boards.
> >
> > I finally got Debian Stretch Working for armhf.
> >
> > Debian 9
> > http://unsupported.s3.amazonaws.com/puppet-agent_5.
> > 4.0.412.g8f7446e2-1stretch_armhf.deb
> >
> > Debian 8
> > http://unsupported.s3.amazonaws.com/puppet-agent_5.
> > 4.0.412.ga221b36c-1jessie_armhf.deb
> >
> >
> > As the URI implies, unsupported :) I don't always get a chance to update
> > them. Feel free to point anybody at them though.
> >
> > --
> > 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/CAMto7LJz6-
> 0J9--ZUCt1TtnUyuXs5%2BrBs-BD26Y6srKyokhFOg%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/375713217.6064768.1520931010180.
> JavaMail.zimbra%40desy.de.
> 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/CAMto7L%2BFET%2BhLz8N-9%3DXO8uNmBqUBWZaFqTUDHUR_DmM%2B2jiQw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Hiera Interpolation of data

2018-03-20 Thread Henrik Lindberg

On 20/03/18 04:19, Gino Lisignoli wrote:

Hello

I'm using hiera with the http backend (as couchdb) which works for data 
lookup, but I want to user data interpolation 
(https://puppet.com/docs/puppet/5.0/hiera_interpolation.html).


At the moment I am trying to do a simple test of:

|
classfoo (
   $bar =lookup("some::path::var")
){
   notify {'bar':
     message =>$bar
}
}
|

Couchdb:
|
{
"some::path::var":"%{::fqdn}"
}
|


But my notify output is always:

Notice: /Stage[main]/Foo::Notify[bar]/message:current_value absent, 
should be %{::fqdn} (noop)


Any ideas why this isn't getting resolved as the fqdn fact?


Afaik, the interpolation should be performed by the backend itself for 
hiera 3 backends. Does other interpolations work with the couchdb 
backend? If not, log a ticket for that backend.


The right path forward is to use hiera 5 and write a hiera 5 backend for 
couchdb. This is as simple as writing a function - probably of the 
"lookup_key" kind. When doing such a lookup, there is a method to call 
on the "lookup context" object given to the function that performs 
interpolation.


Others that have written hiera 5 backend functions have done so quite 
easily and made the hiera 3 backend be capable of supporting both the 
hiera 3 backend API and the new hiera 5 at the same time.


Best,
- henrik


--

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/p8qsv3%24ui%241%40blaine.gmane.org.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] run puppet-agent once per day specific range time.

2018-03-20 Thread Ren
Hey everyone, 


I am looking the best way to implement overall puppet-agent (v4.9.2) to run 
only once per day during a specific time. 
ie:  between 4 hours  > 8 hours.

what do you suggest? should I go with to implement a cron type or something 
using a funciton schedule? 

Do you have any examples? 

Thank you very much . 
-r 


-- 
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/334cb9f8-24d1-46a0-8307-9f0f3c489c59%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.