[Puppet Users] Beaker does not install puppet in Ubuntu boxes

2015-12-01 Thread Danny Roberts
When running acceptance tests with an Ubuntu box with the following config:

HOSTS:
  ubuntu-server-1404-x64:
roles:
  - master
platform: ubuntu-server-14.04-amd64
box: puppetlabs/ubuntu-14.04-64-nocm
hypervisor: vagrant

CONFIG:
  log_level: verbose
  type: foss

The box spins up and does much of the setup but always fails here:

ubuntu-server-1404-x64 20:11:30$ wget -O /tmp/puppet.deb 
http://apt.puppetlabs.com/puppetlabs-release-.deb
  --2015-12-01 12:11:29--  http://apt.puppetlabs.com/puppetlabs-release-.deb
  Resolving apt.puppetlabs.com (apt.puppetlabs.com)...   192.155.89.90  ,   
2600:3c03::f03c:91ff:fedb:6b1d
  Connecting to apt.puppetlabs.com 
(apt.puppetlabs.com)|192.155.89.90|:80...   connected.
  HTTP request sent, awaiting response...   404 Not Found
  2015-12-01 12:11:29 ERROR 404: Not Found.

For some reason even switching up the box used it always fails to get the 
release name and complete the URL property. Any idea why this is missing?

-- 
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/3d8bad03-3e5b-494b-823d-a40e136c442f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet 101: How to make it go?

2015-12-01 Thread Morgan Haskel
John,

Have you checked out
https://docs.puppetlabs.com/puppet/4.3/reference/quick_start.html? That
should all work with open source as far as I know.

On Tue, Dec 1, 2015 at 1:11 PM John Oliver  wrote:

> That VM uses PE, not open source.  This is the EXACT problem I'm having
> with the docs... everything is geared towards the commercial product.
>
>
> On Tuesday, December 1, 2015 at 6:55:22 AM UTC-8, Peter Bukowinski wrote:
>>
>> I suggest downloading the Learning VM and working through the tutorial.
>>
>> https://puppetlabs.com/download-learning-vm
>>
> --
> 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/bb493bd4-0e0c-4a0d-91d5-3ca99dba55fc%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Morgan Haskel
mor...@puppetlabs.com
Release Engineer

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


Re: [Puppet Users] Puppet 101: How to make it go?

2015-12-01 Thread John Oliver
That VM uses PE, not open source.  This is the EXACT problem I'm having 
with the docs... everything is geared towards the commercial product.


On Tuesday, December 1, 2015 at 6:55:22 AM UTC-8, Peter Bukowinski wrote:
>
> I suggest downloading the Learning VM and working through the tutorial. 
>
> https://puppetlabs.com/download-learning-vm
>

-- 
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/bb493bd4-0e0c-4a0d-91d5-3ca99dba55fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: real path on fs to the environment in function

2015-12-01 Thread Vasil Mikhalenya
sorry, I've just accidentally sent previous unfinished email

files_dir = lookupvar("ssh_key_groups::path_to_keys") // lookup var does
not work for puppet-server anymore
files_path = env.modulepath.map{|d| d.sub("modules", "")+files_dir }.select
{ |d| Puppet::FileSystem.directory?(d) }.shift // this code looks like a
hack

On Tue, Dec 1, 2015 at 8:07 PM, Vasil Mikhalenya  wrote:

> Hi all,
>
> Could you suggest the right way to determine the path to the current
> environment in puppet function? I want to store some data outside the
> modules in the "files" directory in the git work-copy that pulled in each
> environment and be able to detect the path to the "files".
>
>
> files_dir = lookupvar("ssh_key_groups::path_to_keys")
> files_dir = "files"
>
> files_path = env.modulepath.map{|d| d.sub("modules", "")+files_dir
> }.select { |d| Puppet::FileSystem.directory?(d) }.shift
>
> --
> Best regards,
> Vasil Mikhalenya
>



-- 
Best regards,
Vasil Mikhalenya

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


Re: [Puppet Users] Puppet agent (Puppet 4) taking too long to apply the catalog

2015-12-01 Thread DEGREMONT Aurelien

Hello

To debug this slowness, try the following command:

time puppet agent -t --noop --evaltrace --summarize

And look for which part is slow in the summary and possibly which 
resource evaluation take too much time.



Aurélien


Le 01/12/2015 17:13, Lauro Silveira a écrit :

Hi,


Until yesterday, an agent on a node was applying the catalog very fast 
(about 5 seconds).
Yesterday, i've made  a definition that manages the fstab, using the 
module "herculesteam-augeasproviders_mounttab". The code appears to be 
very simple :


define linuxbasico::fstab(
  $mntpointsource,
  $mntpointdir,
  $mntpointtype,
  $mntpointoptions
) {
  file { "${mntpointdir}":
ensure => directory,
  }

  ->

  mounttab { "${mntpointdir}":
ensure   => present,
device   => "${mntpointsource}",
fstype   => "${mntpointtype}",
options  => $mntpointoptions,
dump => "0",
pass => "0",
provider => augeas,
  }
}

So, i've some tests to manage a mount point through this definition 
and everything worked fine. But, after a few more tests, the agent was 
taking too long to apply the catalog (more than 100 seconds). So, i 
removed the reference to my new definition and also removed the 
mounttab module, but the slowness persisted.
What i've noticed through debug messages is the following group of 
messages lots of times:



Debug: Failed to load library 'msgpack' for feature 'msgpack'
Debug: Puppet::Network::Format[msgpack]: feature msgpack is missing
Debug: file_metadata supports formats: pson yaml binary
Debug: Using cached connection for 
https://tucano1.redeteste.camara.gov.br:8140

Debug: Caching connection for https://tucano1.redeteste.camara.gov.br:8140

Another detail, after the message:

Notice: Applied catalog in 104.19 seconds

the agent is still hanging for about 30 seconds.



I've added the following config on the puppetserver, but nothing changed

always_cache_features = true

Any tips?

Thanks in advance.

Ps: Debug log file is attached

Lauro

--
You received this message because you are subscribed to the Google 
Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to puppet-users+unsubscr...@googlegroups.com 
.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CA%2B-B7vurYCOScip42_0Fx_XMWvMfb9PNN_oVM9JnpP-iSirJ8g%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/565DD24D.2070404%40cea.fr.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] real path on fs to the environment in function

2015-12-01 Thread Vasil Mikhalenya
Hi all,

Could you suggest the right way to determine the path to the current
environment in puppet function? I want to store some data outside the
modules in the "files" directory in the git work-copy that pulled in each
environment and be able to detect the path to the "files".


files_dir = lookupvar("ssh_key_groups::path_to_keys")
files_dir = "files"

files_path = env.modulepath.map{|d| d.sub("modules", "")+files_dir }.select
{ |d| Puppet::FileSystem.directory?(d) }.shift

-- 
Best regards,
Vasil Mikhalenya

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


[Puppet Users] Re: Hiera Interpolation

2015-12-01 Thread Matthew Ceroni
So it appears you can interpolate array and hash variables 
(https://docs.puppetlabs.com/hiera/2.0/variables.html#interpolating-hash-or-array-elements)

I am currently running Puppet Master 3.8 (can't upgrade to 4 as of this 
moment as I integrate with Foreman).

Puppet 3.8 packages come with Hiera 1.3.5 and to use the above you need 2.0 
or higher. Therefore I removed the hiera 1.3.5 RPM (just broke the 
dependency on Puppet master 3.8) and installed 3.0.5 hiera gem. However I 
am receiving the following error when attempting to interpolate a key 
within a hash following the above documentation:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Evaluation Error: Empty string title at 0. Title strings must have a length 
greater than zero. at 
/etc/puppet/environments/sandbox/manifests/site.pp:25:11

My thought is that even though I removed Hiera 1.3.5 that it didn't fully 
get removed and Puppet master is still using it. The reason for this is 
with Hiera 2.0 and up the default location for hiera.yaml is now 
/etc/puppetlabs/code/hiera.yaml. I haven't created that file and just left 
/etc/puppet/hiera.yaml. If I remove /etc/puppet/hiera.yaml I get the 
standard error that hiera couldn't find the key in any lookup-files. 
Therefore it doesn't appear to be using /etc/puppetlabs/code/hiera.yaml.

Is there a way to verify what version of Hiera puppet is using and force it 
to use a specific version? 

On Monday, November 30, 2015 at 3:43:25 PM UTC-8, Matthew Ceroni wrote:
>
> I have been using variable interpolation within my Hiera data files for 
> sometime.
>
> For instance I have Citrix NetScaler LB rules defined as such:
>
> apache:
>   name: "%{::cluster}-apache"
>   ensure: 'present'
>   service_type: 'HTTP'
>   state: true
>   lb_method: 'LEASTCONNECTION'
>
> And based on the cluster the machine is in (cluster is a parameter set by 
> my ENC) it creates the rule accordingly.
>
> However I know have a need to interpolate variables that might be be 
> arrays or hashes. Is there a way I can interpolate a hash key, value within 
> a hiera data file from a variable in the current scope?
>
> I know within hiera I can reference other keys using hash and look-up 
> based on a key, but this data isn't another key within the data file, it is 
> a variable set by my ENC available in the current scope (just like cluster 
> was). 
>
> 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/32d2a28d-fc35-4e4b-acf9-f6edc8dca1cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Puppet 4: default value of a parameter in a module and dependency

2015-12-01 Thread Francois Lafont
On 30/11/2015 16:09, jcbollinger wrote:

> "init.pp" is the name of a manifest file, not of a class.  Moreover, 
> although it's poor form, such a manifest could contain definitions for more 
> than one class. 

Ok, sorry.

> "./moda/functions/data.pp" appears to be the name of another manifest 
> file.  I suppose it's instead supposed to be a Ruby (.rb) file defining a 
> custom function,

No, no. You can see 
http://puppet-on-the-edge.blogspot.fr/2015/01/puppet-40-data-in-modules-and.html
With puppet 4, the "data philosophy" has changed.

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


Re: [Puppet Users] Puppet 4: default value of a parameter in a module and dependency

2015-12-01 Thread Francois Lafont
Hi,

On 30/11/2015 11:27, Martin Alfke wrote:

> define modb with an explicit heira lookup and set a default:
> 
> class  ‘modb’ (
>   param => hiera(‘moda::param’, ‘default’)
> ){
>   …
> }
> 
> I am unsure on how to achieve this with data in modules.

Ah, indeed. In fact, with puppet 4, I think I can do this (not tested yet):

class modb (
  $param,
){
  ...
}

And in data.pp

function modb::data () {

  $param_if_set = lookup('moda::param', String, 'unique', undef)
  if $param_if_set == undef {
$param = ::moda::data()['param']
  } else {
$param = $param_if_se
  };

{
  modb::param => $param,
}

}

I will try a test...

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


Re: [Puppet Users] Re: Puppet 4: default value of a parameter in a module and dependency

2015-12-01 Thread Francois Lafont
Hi Henrik,

On 30/11/2015 19:12, Henrik Lindberg wrote:
 
> In addition to writing the function, a module can opt in to using this data 
> functions by adding a configuration in its module metadata.

Err... can you explain a little? I don't see what it is.

> This is all part of the 4.x data in modules / lookup feature.
> 
> In Puppet 4.3.0 we also added the ability to use hiera data in modules.

Same remark: can you explain a little?

Do you know if this bug will be resolved soon?
https://tickets.puppetlabs.com/browse/PUP-5209

Because it seems to me that my goal in this thread is impossible with this bug, 
no?

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


[Puppet Users] Re: SELinux context warnings, how-to fix ?

2015-12-01 Thread Thomas Müller


Am Montag, 30. November 2015 18:15:59 UTC+1 schrieb Remy:
>
> Hi,
>
> We moved from 3.1 to 3.8 and we faced some warnings regarding SELinux all 
> of the sudden:
>
> Nov 30 14:48:22 nodename puppet-agent[9865]: Failed to set SELinux context 
> system_u:object_r:usr_t:s0 on /usr/sap/home/username
> Nov 30 14:48:22 nodename puppet-agent[9865]: 
> (/File[/usr/sap/home/username]/seltype) seltype changed 'nfs_t' to 'usr_t'
>

what's the ouptput of:
matchpathcony=a+bsin(c+dx)matchpathcon
matchpathcon /usr/sap/home/username

y=a+bsin(c+dx)
if selinux is enabled (permissive or enforcing) puppet tries to set the 
default selinux context on a managed file 
resource. 
https://docs.puppetlabs.com/references/latest/type.html#file-attribute-seltype 

for a local additon of the file context you could run: 

semanage fcontext --add --type nfs_t /usr/sap/home(/.*)?

(I suspect /usr/sap/home is nfs mounted?)

afterwards the matchpathcon should then return system_u:object_r:nfs_t:s0

sometimes I can see that a running already puppet service does not know 
about updated selinux file contexts - and tries to set the old context. 
restarting puppet service helps here.

- Thomas

PS: if you wanted to have the same permissions for /usr/sap/home as for 
/home selinux-wise you could run
semanage fcontext -a -e /home /usr/sap/home

but  I don't know if this applies to you. This equivalence feature is not 
very well known altough introduced in 2009 
(http://danwalsh.livejournal.com/27571.html) and is very usefull.



-- 
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/22a5fc47-2cc0-4df3-a407-9580ac83c7ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: SELinux context warnings, how-to fix ?

2015-12-01 Thread Thomas Müller
sorry for the maths inbetween. this did not show up in the google editor. :)

Am Dienstag, 1. Dezember 2015 09:23:44 UTC+1 schrieb Thomas Müller:
>
>
> matchpathcony=a+bsin(c+dx
> y=a+bsin(c+dx)
>

-- 
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/50372e2c-19fc-4a9d-9693-063fd310c46f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] "signalling" inside a puppet provider?

2015-12-01 Thread Peter Berghold
Given the following pattern in a puppet manifest:

file{ 'some/file/foo':
  content => 'blah blah blah',
  notify => Exec['talkaboutfoo']
}
exec { 'talkaboutfoo':
 cmd => "some/command/some/where",
 subscribe => File['some/file/foo']
}

with a little bit of hand waving.

Is there something similar in a custom provider?  Reason I'm asking is I
have
written a custom provider for a very customized piece of locally grown
software that ideally one of the configuration parameters

mytype{ 'instance':
 state => "on",  # this parameter
 parm1=> "a",
 parm2=> "b",
 parm3=>"c"
}

should be set *last* among all the other parameters.

Is there a way to do that?

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


Re: [Puppet Users] Re: Puppet 4: default value of a parameter in a module and dependency

2015-12-01 Thread Henrik Lindberg

On 2015-30-11 16:09, jcbollinger wrote:



On Sunday, November 29, 2015 at 10:09:20 PM UTC-6, François Lafont wrote:

Hi,

I'm using Puppet 4 and I'm wondering if this (see below) is possible.

I have 2 Puppet modules, moda and modb. We can imagine that theses
modules
have just one class init.pp.



"init.pp" is the name of a manifest file, not of a class.  Moreover,
although it's poor form, such a manifest could contain definitions for
more than one class.  Moreover, in

The class ::moda has a parameter "param" with
the default value defined in the code of "./moda/functions/data.pp".



"./moda/functions/data.pp" appears to be the name of another manifest
file.  I suppose it's instead supposed to be a Ruby (.rb) file defining
a custom function, and although I can speculate based on its name what
it might do, the details matter, and you have not provided them.



In Puppet 4.x you can have functions written in the Puppet Language. 
Those reside under /functions/.pp


The data.pp is thus for a function called data. Such a function can be 
used to provide data for a module - it is supposed to return a hash of 
key => value mapping.


In addition to writing the function, a module can opt in to using this 
data functions by adding a configuration in its module metadata.


This is all part of the 4.x data in modules / lookup feature.

In Puppet 4.3.0 we also added the ability to use hiera data in modules.

- 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/565C91A9.2010106%40cloudsmith.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Puppet 101: How to make it go?

2015-12-01 Thread John Oliver
I downloaded and installed the open-source puppet on a CentOS 6 virtual 
machine.  I downloaded and installed the client on a Mac OS X 10.10

So... how do I make it do something?

The docs on the puppet site are pretty useless for this... the docs for 
open source wind up looping back to refer to the enterprise product, and 
they go into great detail about installing, and then about all these 
wonderful things you can do, but not a single word about how to do a "Hello 
World!" and just see one client checking in.

-- 
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/100d6f13-e4e4-4338-a564-97725453d582%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet 101: How to make it go?

2015-12-01 Thread Peter Bukowinski
I suggest downloading the Learning VM and working through the tutorial. 

https://puppetlabs.com/download-learning-vm

-- Peter Bukowinski

> On Dec 1, 2015, at 9:42 AM, John Oliver  wrote:
> 
> I downloaded and installed the open-source puppet on a CentOS 6 virtual 
> machine.  I downloaded and installed the client on a Mac OS X 10.10
> 
> So... how do I make it do something?
> 
> The docs on the puppet site are pretty useless for this... the docs for open 
> source wind up looping back to refer to the enterprise product, and they go 
> into great detail about installing, and then about all these wonderful things 
> you can do, but not a single word about how to do a "Hello World!" and just 
> see one client checking in.
> -- 
> 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/100d6f13-e4e4-4338-a564-97725453d582%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/5C82D1ED-4B7E-4C6E-AB93-1833154D7CEE%40gmail.com.
For more options, visit https://groups.google.com/d/optout.