[Puppet Users] Re: Error 500 on SERVER: Server Error: Not authorized to call find on /file_metadata/files/

2017-02-16 Thread Peter Faller
Where does the file 'nombre.sh' live on your Puppet master? Is it in the 
'files/' directory in your module? In that case you should use 
'puppet:///modules//nombre.sh'

On Friday, 17 February 2017 02:31:57 UTC+2, Gustavo Moreno Fernández wrote:
>
> Hi,
> 
>

-- 
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/a318249a-d845-4a34-afa5-741174dce9a9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Puppet is using high CPU usage!!!

2017-02-16 Thread Amrit Atmajit
Hi,

We are using high end setup for our Puppet and foreman in CentOS server: 
RAID5, 198GB RAM, 64 cores Processor.
But, after installation of Foreman-installer puppet is eating the CPU like 
anything. We can observe CPU usage% is spiking > 4000!
Is it because of RAID5 processor? Can anyone help on this to resolve this 
issue?

==
top - 23:18:09 up 21:17,  3 users,  load average: 29.86, 21.72, 22.12
Tasks: 705 total,   1 running, 704 sleeping,   0 stopped,   0 zombie
%Cpu(s): 63.2 us,  0.4 sy,  0.0 ni, 36.4 id,  0.0 wa,  0.0 hi,  0.0 si, 
 0.0 st
KiB Mem : 19778108+total, 18979132+free,  5705996 used,  2283756 buff/cache
KiB Swap:  4194300 total,  4194300 free,0 used. 19106275+avail Mem

  PID USER  PR  NIVIRTRESSHR S  %CPU %MEM TIME+ COMMAND
36570 puppet20   0 13.414g 2.652g  21912 S  4060  1.4 141:07.87 java
 3359 sandisk   20   0 1787316 185376  45404 S   1.0  0.1   5:22.40 
gnome-shell
35962 root  20   0  158272   2920   1568 R   0.7  0.0   0:06.39 top
28264 root  20   0   0  0  0 S   0.3  0.0   0:21.24 
kworker/21:0
30703 root  20   0   0  0  0 S   0.3  0.0   0:14.38 
kworker/26:1
32997 root  20   0   0  0  0 S   0.3  0.0   0:10.75 
kworker/30:1
33369 root  20   0   0  0  0 S   0.3  0.0   0:11.32 
kworker/53:2
33435 root  20   0   0  0  0 S   0.3  0.0   0:08.22 
kworker/23:2
34037 root  20   0   0  0  0 S   0.3  0.0   0:09.36 
kworker/35:0
34064 root  20   0   0  0  0 S   0.3  0.0   0:10.88 
kworker/62:0
34461 root  20   0   0  0  0 S   0.3  0.0   0:07.47 
kworker/56:2
34996 root  20   0   0  0  0 S   0.3  0.0   0:06.21 
kworker/40:1
35002 root  20   0   0  0  0 S   0.3  0.0   0:06.51 
kworker/51:1
35214 root  20   0   0  0  0 S   0.3  0.0   0:07.02 
kworker/57:1
35966 root  20   0   0  0  0 S   0.3  0.0   0:02.58 
kworker/29:1
36175 root  20   0   0  0  0 S   0.3  0.0   0:03.25 
kworker/49:0
36358 root  20   0   0  0  0 S   0.3  0.0   0:01.86 
kworker/39:2
36861 root  20   0   0  0  0 S   0.3  0.0   0:01.16 
kworker/54:2
36890 root  20   0   0  0  0 S   0.3  0.0   0:00.84 
kworker/15:1
36929 root  20   0   0  0  0 S   0.3  0.0   0:00.72 
kworker/2:2
36930 root  20   0   0  0  0 S   0.3  0.0   0:01.17 
kworker/59:1
36938 root  20   0   0  0  0 S   0.3  0.0   0:00.82 
kworker/46:2
37013 root  20   0   0  0  0 S   0.3  0.0   0:00.76 
kworker/41:0
37077 root  20   0   0  0  0 S   0.3  0.0   0:00.23 
kworker/47:0
1 root  20   0  198032  11220   3972 S   0.0  0.0   0:17.96 systemd
2 root  20   0   0  0  0 S   0.0  0.0   0:00.94 kthreadd
3 root  20   0   0  0  0 S   0.0  0.0   0:00.45 
ksoftirqd/0
5 root   0 -20   0  0  0 S   0.0  0.0   0:00.00 
kworker/0:0H
6 root  20   0   0  0  0 S   0.0  0.0   0:04.66 
kworker/u128:0
7 root  20   0   0  0  0 S   0.0  0.0   0:00.00 
kworker/u129:0
8 root  rt   0   0  0  0 S   0.0  0.0   0:00.45 
migration/0
===

Best Regards,
Amrit

-- 
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/d6d9bdf6-8f14-485e-995d-2f966c3639ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] puppetdb 4.3 on PG 9.4 fresh install fails to start with DB UTF8 encoding error

2017-02-16 Thread swk
Hi everyone,

I'm trying to do my first ever install of PuppetDB.  I'm installing 
PuppetDB 4.3 from RPM with Postgres 9.4.  When I try to start PuppetDB I 
get the following errors (removed some of the non-important java debugging 
lines):

2017-02-16 14:19:54,539 INFO  [p.p.s.migrate] Applying database migration 
version 43
2017-02-16 14:19:54,570 ERROR [p.p.s.migrate] Caught SQLException during 
migration
java.sql.BatchUpdateException: Batch entry 1 CREATE AGGREGATE md5_agg 
(BYTEA)
(
  sfunc = dual_md5,
  stype = bytea,
  initcond = '\x00'
) was aborted.  Call getNextException to see the cause.

2017-02-16 14:19:54,571 ERROR [p.p.s.migrate] Unravelled exception
org.postgresql.util.PSQLException: ERROR: invalid byte sequence for 
encoding "UTF8": 0x00


Any advice would be appreciated.  

-- 
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/2ffa26d1-2cd9-41be-97cb-de446a550bcb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Error 500 on SERVER: Server Error: Not authorized to call find on /file_metadata/files/

2017-02-16 Thread Gustavo Moreno Fernández
Hi,


Puppet server is launching this error message in test environment:


Error: /Stage[main]/Ejecuta/File[nombre.sh]: Could not evaluate: Could not 
> retrieve file metadata for puppet:///files/nombre.sh: Error 500 on SERVER: 
> Server Error: Not authorized to call find on /file_metadata/files/nombre.sh 
> with {:rest=>"files/nombre.sh", :links=>"manage", :checksum_type=>"md5", 
> :source_permissions=>"ignore"}
>
>

I'm googling but I don't find this server error with 500 code.


The class related is:



> class ejecuta {
> File['nombre.sh'] -> Exec['muestra_nombre']
>
> file { 'nombre.sh':
> ensure => 'file',
> source => "puppet:///files/nombre.sh",
> links => 'manage',
> path => '/usr/local/bin',
> owner => 'gus',
> group => 'gus',
> mode => '0777',
>  }
>
> exec {'muestra_nombre':
> command => '/usr/local/bin/nombre.sh',
> refreshonly => true,
> }
> }
>

 
auth.conf


path /puppet/v3/file_metadata/files
> method search,find
> auth yes
> allow_ip 192.168.0.0/16
>
>
Versions:

Puppetserver   2.7.2 
Puppet Agent   4.9.2   



Any idea?

-- 
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/4997007f-e239-453b-a0bb-7cd3c584a66b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] puppet print config yields 'Could not find a directory environment named 'development'

2017-02-16 Thread Peter K
Hi. I'm a new user with an environment problem.

My puppet.conf on my client host (puppet agent 4.9.2) looks like this:

[main]
certname = centosCLIENT.pretend.com
server = puppet
environment = development
runinterval = 1h
environment_timeout = 0



and when I run* /opt/puppetlabs/puppet/bin/puppet config print* I get:


/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/environments.rb:38:in 
`get!': Could not find a directory environment named 'development' anywhere 
in the path: /etc/puppetlabs/code/environments. Does the directory exist? 
(Puppet::Environments::EnvironmentNotFound)
from 
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application_support.rb:29:in 
`push_application_context'
from 
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:337:in 
`run'
from 
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:132:in 
`run'
from 
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:72:in 
`execute'
from /opt/puppetlabs/puppet/bin/puppet:5:in `'


Here's how my server (puppetserver 2.7.2) is configured:
$ cat  */etc/puppetlabs/code/environments/development/environment.conf*


modulepath = 
/etc/puppetlabs/code/environments/development/modules:/etc/puppetlabs/code/modules:/opt/puppetlabs/puppet/modules
# manifest = (default_manifest from puppet.conf, which defaults to 
./manifests)
manifest = manifests


On the client, except for the hiera failure, this works:
*sudo /opt/puppetlabs/bin/puppet agent -t*


Info: Using configured environment 'development'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for strontium.themolecule.com
Info: Applying configuration version '1487277062'
Notice: You're in development
Notice: 
/Stage[main]/Main/Node[default]/Notify[Using_Development_Environment]/message: 
defined 'message' as 'You're in development'
Notice: Applied catalog in 0.33 seconds


-- 
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/137c9038-5478-4d9b-ac3c-3b81f2d40ccd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] noob problem: Could not find a directory environment named 'development'

2017-02-16 Thread Peter K
Hi all, I'm hoping you can point out some detail I'm missing. Puppet agent 
seems to run fine until I introduce hiera.  I believe the issue is 
configuration path related:

I'm using opensource pupperserver version 2.7.2 on an ubuntu 16.04 machine 
and puppet agent version 4.9.2  on a centos 7 client machine.
On the centos client, this is the result of:
$ sudo /opt/puppetlabs/bin/*puppet config print* 

/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/environments.rb:38:in 
`get!': *Could not find a directory environment named 'development' 
anywhere in the path: /etc/puppetlabs/code/environments. Does the directory 
exist? *(Puppet::Environments::EnvironmentNotFound)
from 
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application_support.rb:29:in 
`push_application_context'
from 
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:337:in 
`run'
from 
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:132:in 
`run'
from 
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:72:in 
`execute'
from /opt/puppetlabs/bin/puppet:5:in `'


Here is my  /etc/puppetlabs/puppet/*puppet.conf* on the client:

[main]
certname = centosclient.pretenddomain.com
server = puppet
environment = development
runinterval = 1h
environment_timeout = 0


But here's what I get on the client if I run (which works as expected): 
$ sudo /opt/puppetlabs/bin/*puppet agent -t*

Info: Using configured environment 'development'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for centosclient.pretenddomain.com
Info: Applying configuration version '1487270914'
Notice: You're in development
Notice: 
/Stage[main]/Main/Node[default]/Notify[Using_Development_Environment]/message: 
defined 'message' as 'You're in development'
Notice: Applied catalog in 0.31 seconds


Here are the only lines uncommented in 
/etc/puppetlabs/code/environments/development/*environment.conf *(This is 
on the ubuntu puppet server)

modulepath = 
/etc/puppetlabs/code/environments/development/modules:/etc/puppetlabs/code/modules:/opt/puppetlabs/puppet/modules
manifest = ./manifests

thx, 
-peter

-- 
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/5a6a4382-c870-44aa-b30f-94eaccf0007b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: hiera deep hash merges broken

2017-02-16 Thread Francois Lafont
Hi,

On 02/16/2017 09:03 PM, Henrik Lindberg wrote:

> We are adding support for eyaml in hiera 5 which means you will get explain 
> support and that you can use eyaml when also using the new format. We now 
> also test with eyaml.

By the way, and just for information ;), here an issue I have currently with 
eyaml
and Puppet 4 (_but_ I don't use hiera 5 yet):

https://github.com/TomPoulton/hiera-eyaml/issues/186

But I absolutely don't know if this issue is a Puppet side problem or a eyaml
side problem. If it's a Puppet side problem, it would be great to fix it with
hiera 5 \o/. If it's a eyaml side problem, unfortunately eyaml no longer seems
to be really maintained.

François Lafont

-- 
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/1252ff4a-2918-6b4d-fd2c-74dd659b2ea9%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Puppet DB prune / vacuum

2017-02-16 Thread Anfield
For cleaning up report data is the parameter prune_upto still valid? - 
related to version 2016.2

Or has the vacuum parameter replaced it? Do they both essentially do the 
same thing?

https://docs.puppet.com/pe/2016.2/maintain_console-db.html

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/d95e90d5-983a-47ee-8a71-73c2f557a7eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Newbie Question About Puppet

2017-02-16 Thread Net Warrior

Hi there guys

I'm new to puppet and I'm gonna make my first install of if, I'll go 
with the free version and then in the near feature maybe we switch to 
Enterprise for support.
I'm reading some docs and it seems the lates version is 4.8, the reading 
about the installation it talks about Puppet server install which is 
version 2.6 and puppet db is 4.2, so this at first confused me, because 
I do not know to which package 4.8 is related to, is that a whole 
version number? to the whole puppet suite?


Another thing, my environment consist on about 30 AWS instances, is that 
ok install puppet server ( from what I read it replaces puppet master ) 
and puppet db on the same server? any advice on this? memory/cpu?


Is there any documentation which exaplains  or describes all the steps  
involved during the installation or should I go through separate docs, 
one for installing the db and other for the server? I'm just using 
puppet labs docs references


Thanks for your time and support
Regards

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


Re: [Puppet Users] Puppet erb template create loop

2017-02-16 Thread Henrik Lindberg

On 13/02/17 18:05, Rafael Tomelin wrote:

Hi dear,

I is create a module and need loop in puppet class and template


The my class step is:
1) My class have array declared;
$pools = [
{
  name   => 'PoolDiario',
  poolType   => 'Backup',
  recycle=> 'yes',
  autoPrune  => 'yes',
  volumeRetention=> '30 days',
  maximumVolumeBytes => '1G',
  maximumVolumes => '100',
  labelFormat=> 'Local-'
}
,
{
  name   => 'PoolDiario2',
  poolType   => 'Backup2',
  recycle=> 'yes',
  autoPrune  => 'yes',
  volumeRetention=> '20 days',
  maximumVolumeBytes => '5G',
  maximumVolumes => '10',
  labelFormat=> 'Local2'
}
])

2) The array is create file;
example:

count array$pools

 $teste = $pools[COUNT]['name']

#LOOP
  file { "/etc/bacula/pool/pool_$teste.conf":
ensure  => 'file',
owner   => 'bacula',
group   => 'bacula',
content => template('bacula/director/pool_conf.erb')
  }


3) Template loop get array.
Pool {
<% pools.each do |pool| -%>
  Name = "<%= pool['name'] %>"
  Pool Type = "<%= pool['poolType'] %>"
  Recycle = <%= pool['recycle'] %>
  AutoPrune = <%= pool['autoPrune'] %>
  Volume Retention = "<%= pool['volumeRetention'] %>"
  Maximum Volume Bytes = "<%= pool['maximumVolumeBytes'] %>"
  Maximum Volumes = <%= pool['maximumVolumes'] %>
  Label Format = "<%= pool['labelFormat'] %>"

<% end -%>
}


But this create Pool to array.

I can make this module?



Puppet 4.x (and puppet 3.x with future parser) supports iteration with 
functions such as each, map, reduce (and many more). That should enable 
you to do what you want.


- henrik



--
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/b76ca740-d7f6-4dd6-8079-43bc72700c06%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/0554267c-29cc-5bda-a6b2-2df9f1c9dc82%40puppet.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: hiera deep hash merges broken

2017-02-16 Thread Henrik Lindberg

On 16/02/17 08:16, Daniel Urist wrote:

It turns out my issue was caused by eyaml no longer supporting deep hash
merges. I've worked around my issue by separating out plain yaml and
eyaml. Fortunately none of my existing code does a deep hash merge on
the eyaml keys.

It would be great to get some reassurance that eyaml will continue to be
properly supported going forward-- my impression is that it's pretty
popular; certainly it's very useful.



We are adding support for eyaml in hiera 5 which means you will get 
explain support and that you can use eyaml when also using the new 
format. We now also test with eyaml.


You still need to install the eyaml gem separately.

Hope that helps.

- henrik


On Wed, Feb 15, 2017 at 4:51 PM, Francois Lafont
>
wrote:

On 02/15/2017 09:24 PM, Eric Sorenson wrote:

> That's great to hear François, thank you for testing the patch!

You are welcome. :)

> Our plan at
> this point is to accumulate a couple more fixes and ship a new build by
> Tuesday 21 Feb -
>
> I don't want to generate a new build containing only the fix in PUP-7215
> because
> (a) there is QA work underway on the current release that may turn up new
> things that need fixing by the end of the week
> (b) there is a simple workaround in PUP-7216 which is that you can
> s/hiera_hash/lookup/ as the function that you call.

Ok, no problem, it's better to hold your workflow.

Bye.
François Lafont


--
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/442a6d8a-387b-1dbc-031b-4605842b706f%40gmail.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/CAEo6%3DKZ%3D4LPZQJBtD8UZoNxrVS8gu_E5uZD7am8RSJu4abZ%2BUg%40mail.gmail.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/68e0b0ae-1304-4ef5-a52e-92d390ceeb2e%40puppet.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Augeas and custom lenses?

2017-02-16 Thread otheus uibk
Ah, documented bug: https://tickets.puppetlabs.com/browse/FACT-696

On Thu, Feb 16, 2017 at 8:48 PM, otheus uibk  wrote:

> Dom, Sorry about resurrecting the old thread. About facts:  `facter -p`
> (2.4.6) shows puppet facts, but not the ones loaded via puppet modules in
> /var/lib/puppet/facts.d (unless --external-dir is specified). For that
> reason, perhaps, we started putting ours in /etc/facter.
>



-- 
Otheus
otheus.u...@gmail.com
otheus.shell...@uibk.ac.at

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


Re: [Puppet Users] Augeas and custom lenses?

2017-02-16 Thread otheus uibk
Dom, Sorry about resurrecting the old thread. About facts:  `facter -p`
(2.4.6) shows puppet facts, but not the ones loaded via puppet modules in
/var/lib/puppet/facts.d (unless --external-dir is specified). For that
reason, perhaps, we started putting ours in /etc/facter.

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


Re: [Puppet Users] Re: ensure_resource should be the default behaviour

2017-02-16 Thread Rob Nelson
To elaborate on the problem set it would solve:

If you were managing the same user in two locations and all you did was set
ensure to present, by matching the create_resources behavior in default
resource declaration, you'd resolve the duplicate declaration issue. Fine
and dandy.

If you were managing the group membership of the user and the other
reference wasn't, now you have a duplicate declaration because
create_resources only matches two resource declarations with the same
parameter set, as John mentioned. No good, but still expected so not really
a problem.

We've now defined where it works and where it doesn't. Good, right?

One of the resource declarations generates the parameters dynamically,
maybe using the new * meta-parameter. The data fed to it over time changes.
Or a module is updated and it changes the parameter list in the new
version. Or two. Does generate different dynamic data. Working code is now
not working and generating duplicate declarations.

This seems likely to happen with your knowledge, but it's really easy for
the two resource declarations to be in two different modules and a third
one assists with generating the dynamic data, for instance. The only way to
fix this is to create some sort of protection in one or both modules, such
as a $manage_resource feature flag to disable managing the resource in at
least one location.

The combination of change in behavior for resource declaration and the use
of dynamic data doesn't actually change the need for defensive coding by
the developers, but it does potentially delay discoverability of such
conflicts from introduction of the code to a later time, which is likely to
be a more inconvenient time for the users.

That seems like a dubious trade off to me.

On Thu, Feb 16, 2017 at 11:20 AM jcbollinger 
wrote:

>
>
> On Wednesday, February 15, 2017 at 11:08:09 AM UTC-6, Poil wrote:
>
> Hi,
>
> After some years of writing puppet modules, I think the ensure_resource
> behaviour (from stdlib) should be the default behaviour for all resources.
>
> This will simplify the code, and made Puppet more accessible for
> beginners.
>
> Ref. https://forge.puppet.com/puppetlabs/stdlib/readme#ensure_resource
> Takes a resource type, title, and a hash of attributes that describe the
> resource(s).
> If the resource already exists, but does not match the specified
> parameters, this function attempts to recreate the resource, leading to
> a duplicate resource definition error.
>
> So I think I'm not the first to ask for this, so why not ?
>
>
>
> You're right, you're not the first to suggest this.  You will find
> multiple discussions on this topic in the archives of this group and of the
> developers group.  The most recent one I recall was in the context of a
> discussion of changes to the syntax and semantics for resource declarations
> for (then-future) Puppet 4.  Some of the ideas from that discussion were in
> fact implemented, but not the ones around reducing the duplicate
> declaration problem.  Perhaps the existence of ensure_resource() was
> considered to adequately address that aspect already.
>
> Of course, this is primarily a module compatibility issue, for within a
> single code base, it is entirely feasible to solve the problem via one of the
> means Puppet recommends
> .  In
> a more general context, some of the same ideas still apply -- in
> particular, it makes some sense to approach the problem by stipulating that
> there shouldn't *be* a problem: instead, there should be at most one
> class (and therefore one module) in any manifest set responsible for any
> given resource, and the only way that resource it should be managed is via
> that class.  Other modules would depend on the designated module / class
> instead of managing the resource directly.  But that solves the problem by
> kicking it up a level, making it one of module *set* design and curation.
>
> In the end, I think the biggest problem with the suggestion of changing
> resource declaration semantics to match the semantics of ensure_resource()
> is that despite being a substantial semantic shift, it would not completely
> solve the problem.  It would handle the case of multiple *identical*
> resource declarations but not cases of multiple *compatible*
> declarations.  This latter is quite a hard problem, because it is not clear *a
> priori* what makes non-identical declarations compatible.  I once had
> some ideas on this topic that I still think are pretty good, though fully
> implementing and using them would be much more disruptive at this point
> than when I first suggested them.  Nevertheless, you might find this
> discussion
> 
> of interest.  Felix Frank later implemented some of those ideas
> .
>
> I'm game to have this discussion again in the 

[Puppet Users] Re: ensure_resource should be the default behaviour

2017-02-16 Thread jcbollinger


On Wednesday, February 15, 2017 at 11:08:09 AM UTC-6, Poil wrote:
>
> Hi, 
>
> After some years of writing puppet modules, I think the ensure_resource 
> behaviour (from stdlib) should be the default behaviour for all resources. 
>
> This will simplify the code, and made Puppet more accessible for 
> beginners. 
>
> Ref. https://forge.puppet.com/puppetlabs/stdlib/readme#ensure_resource 
> Takes a resource type, title, and a hash of attributes that describe the 
> resource(s). 
> If the resource already exists, but does not match the specified 
> parameters, this function attempts to recreate the resource, leading to 
> a duplicate resource definition error. 
>
> So I think I'm not the first to ask for this, so why not ? 
>


You're right, you're not the first to suggest this.  You will find multiple 
discussions on this topic in the archives of this group and of the 
developers group.  The most recent one I recall was in the context of a 
discussion of changes to the syntax and semantics for resource declarations 
for (then-future) Puppet 4.  Some of the ideas from that discussion were in 
fact implemented, but not the ones around reducing the duplicate 
declaration problem.  Perhaps the existence of ensure_resource() was 
considered to adequately address that aspect already.

Of course, this is primarily a module compatibility issue, for within a 
single code base, it is entirely feasible to solve the problem via one of the 
means Puppet recommends 
.  In a 
more general context, some of the same ideas still apply -- in particular, 
it makes some sense to approach the problem by stipulating that there 
shouldn't *be* a problem: instead, there should be at most one class (and 
therefore one module) in any manifest set responsible for any given 
resource, and the only way that resource it should be managed is via that 
class.  Other modules would depend on the designated module / class instead 
of managing the resource directly.  But that solves the problem by kicking 
it up a level, making it one of module *set* design and curation.

In the end, I think the biggest problem with the suggestion of changing 
resource declaration semantics to match the semantics of ensure_resource() 
is that despite being a substantial semantic shift, it would not completely 
solve the problem.  It would handle the case of multiple *identical* 
resource declarations but not cases of multiple *compatible* declarations.  
This latter is quite a hard problem, because it is not clear *a priori* 
what makes non-identical declarations compatible.  I once had some ideas on 
this topic that I still think are pretty good, though fully implementing 
and using them would be much more disruptive at this point than when I 
first suggested them.  Nevertheless, you might find this discussion 
 
of interest.  Felix Frank later implemented some of those ideas 
.

I'm game to have this discussion again in the context of present-day Puppet 
and its ecosystem, but inasmuch as Puppet, Inc. has had multiple 
suggestions and ample opportunity to make the changes you seem to want, and 
has not made them, I think it's a lost cause.


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/943c7176-af10-4436-bec3-949cbdd0e48e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: hiera deep hash merges broken

2017-02-16 Thread Daniel Urist
It turns out my issue was caused by eyaml no longer supporting deep hash
merges. I've worked around my issue by separating out plain yaml and eyaml.
Fortunately none of my existing code does a deep hash merge on the eyaml
keys.

It would be great to get some reassurance that eyaml will continue to be
properly supported going forward-- my impression is that it's pretty
popular; certainly it's very useful.

On Wed, Feb 15, 2017 at 4:51 PM, Francois Lafont <
francois.lafont.1...@gmail.com> wrote:

> On 02/15/2017 09:24 PM, Eric Sorenson wrote:
>
> > That's great to hear François, thank you for testing the patch!
>
> You are welcome. :)
>
> > Our plan at
> > this point is to accumulate a couple more fixes and ship a new build by
> > Tuesday 21 Feb -
> >
> > I don't want to generate a new build containing only the fix in PUP-7215
> > because
> > (a) there is QA work underway on the current release that may turn up new
> > things that need fixing by the end of the week
> > (b) there is a simple workaround in PUP-7216 which is that you can
> > s/hiera_hash/lookup/ as the function that you call.
>
> Ok, no problem, it's better to hold your workflow.
>
> Bye.
> François Lafont
>
>
> --
> 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/442a6d8a-387b-1dbc-031b-4605842b706f%40gmail.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/CAEo6%3DKZ%3D4LPZQJBtD8UZoNxrVS8gu_E5uZD7am8RSJu4abZ%2BUg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: inline classes

2017-02-16 Thread jcbollinger


On Wednesday, February 15, 2017 at 2:41:29 PM UTC-6, Ligne Six wrote:
>
> Hello folks,
>
> I'm wondering if it is possible to define-declare a class. Something like 
> inlining:
>
> instead of:
>
> ```
> include hello_distro   
> 
> 
>   
>   
> 
> 
> 
> class hello_distro {   
> 
> 
>   
>  notify { "Running on distro: ${facts['os']['family']}": } 
> 
> 
>
>  } 
> ```
>
> have something like:
>
> ```
> include class hello_distro {
> ...
> } 
>
>
No, Puppet has no such feature *per se*, but I don't see what advantage you 
hope it would provide, relative to simply declaring the contents of the 
class body directly at the same point.

Moreover, if you're inclined to declare a class in the same manifest in 
which you define it -- which runs counter to the prevailing views on good 
style -- I don't see how being able to merge those into a single statement 
would provide more than the most trivial advantage.  You would save 
yourself literally *one word* of code by not repeating the class name.


John



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/ced43a16-5da2-4ec1-a209-f562a615d644%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: puppet open source reports and inventory to Satellite 6?

2017-02-16 Thread Suhail Choudhury
Result was unsuccessful :(

PPM to SAT direct was fine, this is because PPM was using the foreman-*.*
ca/cert/key SSL assets to connect to SAT.

However using these certs for PPM to CAP did allow the reports to be sent
successfully to the CAP foreman https api, but there is no mechanism for
these reports to then be relayed/proxied back to the SAT server AFAIK.



Regards,
Suhail.

On 16 February 2017 at 14:14, Ryan Anderson 
wrote:

> I did not, my Satellite 6 was on a single server. Give it a try and report
> your results!
>
> --
> 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/
> topic/puppet-users/N8AaNx67g3A/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/
> msgid/puppet-users/024e1507-9d7f-4a19-91c1-3315667dadd5%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/CAHdO4Gn%2Bwuw3e8h_Hnnr%3DdJhqec40KyGUm2RVJYT3onYZuAPhQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: puppet open source reports and inventory to Satellite 6?

2017-02-16 Thread Ryan Anderson
I did not, my Satellite 6 was on a single server. Give it a try and report 
your results!

-- 
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/024e1507-9d7f-4a19-91c1-3315667dadd5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.