Re: [Puppet Users] Include class with parameters

2016-06-08 Thread Martin Alfke
Hi Harish,
On 09 Jun 2016, at 06:49, Harish Kothuri  wrote:

> Hi,
> 
> I have classA with parameter and i want to include this in another classB . I 
> expected to consider the default value defined in foreman for classA but it's 
> not happening. 
> 
> 
> class classA ($version)
> {
>
>   Package { 'Package A' 
>   ensure   => 'installed',
>   source   => 'C:\install\file_${version}.msi',
>   }
> }

You defined a class with a parameter without a default value.
When declaring (include) this class you must pass a value to the parameter by 
using class as resource type:
e.g.
class { ‘classA’:
  version => ‘1.2.3’,
}

> 
> 
> class classB($variable)
> {
> 
> include classA   # throws error in this line "Must pass parameter to Class 
> [ClassA]
> 
>   Package { 'title B' 
>   ensure   => 'installed',
>   source   => 'C:\install\file_${variable}.msi',
>   require   => Package['Package A'],
>   }
> }
> 
> 
> Can someone help me on this.
> 
> 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/fc54c6ea-276e-41d9-b6c3-93390846f1df%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/342A8E0D-4070-4B1B-8796-FF2E2424A141%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] environmentpath in manifest

2016-05-13 Thread Martin Alfke
Hi Daniele,

On 13 May 2016, at 02:13, Daniele Palumbo <dani...@retaggio.net> wrote:

> Il giorno 12/mag/2016, alle ore 10:19, Martin Alfke <tux...@gmail.com> ha 
> scritto:
>> You might want to access the Puppet settings:
>> 
>> Puppet.initialize_settings unless Puppet[:confdir]
>> 
>> and then check for the environmentpath setting.
> 
> 
> Hi Martin,
> 
> Thank you very much for your hint.
> 
> But I am not able to understand how to write it.
> How can I interlock between this ruby code and the manifest?

The Ruby part must be a function - like in the example you provided in your 
first email.
You can then use the function inside your manifest.

Functions are always executed on the Master.

Best,
Martin

> 
> Sorry if this is a FAQ question :)
> Do you have some link or example to understand how this should work?
> 
> Thank you very much,
> Daniele
> 
> -- 
> 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/0329312A-9935-4B1F-A2CF-19E0E4D484BB%40retaggio.net.
> 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/5CBD144D-3CDC-4CD2-9526-A0EBFBF08D6F%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] environmentpath in manifest

2016-05-12 Thread Martin Alfke
Hi Daniele,

On 08 May 2016, at 23:36, Daniele Palumbo  wrote:

> Hi,
> 
> i need to check if a file exists on the puppet master.
> 
> No big deal:
> http://stackoverflow.com/questions/18784329/how-to-test-for-existence-of-a-file-on-the-puppet-master
> 
> So i made:
> --
> cat ./modules/braveconf/lib/puppet/parser/functions/file_exists.rb
> require"puppet"
>  module Puppet::Parser::Functions
>newfunction(:file_exists, :type => :rvalue) do |args|
>if File.exists?(args[0])
>  return 1
>else
>  return 0
>end
>  end
> end
> --
> 
> Now, my problem is about path.
> 
> Since i have environmentpath, as seen is
> puppet config print  environmentpath --section master --environment 
> development
> /etc/puppetlabs/code/environments
> 
> I would like to use, in the manifest:
> --
> if ( file_exists 
> ("${::environmentpath}/${::environment}/modules/module/files/configfile-${::hostname}")
>  == 1 ) {
> --
> 
> But ${::environmentpath} is empty.

You might want to access the Puppet settings:

Puppet.initialize_settings unless Puppet[:confdir]

and then check for the environmentpath setting.


> 
> How can i manage this topic, avoiding to hardcode 
> /etc/puppetlabs/code/environments in the code?
> Is there a way to get variable from puppet master config?
> 
> Thanks,
> Daniele
> 
> 
> -- 
> 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/6429762B-377B-4B9D-B8B4-526859465283%40retaggio.net.
> 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/97001652-424C-4CD5-AF9B-02CA8EFF2317%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Module design

2016-05-06 Thread Martin Alfke
Hi ,

On 06 May 2016, at 17:29, Jeff  wrote:

> I'm working on a puppet module that automatically places the entire catalog 
> into zenoss (this is based on an outdated module that I found on github)
> 
> By default, I want to place every server in zenoss. 
> 
> I have a base class which is included in every node. I want to add 'include 
> zenoss::client' in that class. 
> 
> node "server.jeff.com" {
>   include base  # this includes zenoss::client
> }
> 
> Now I'd like to be able to override that at the node level. Unfortunately, I 
> can't think of a slick way to do that without using a global. Something like:
> 
> node "server.jeff.com" {
>   $zensure = "absent"   # then I can use this global in base to switch ensure 
> to absent
>   include base  # this includes zenoss::client
> }
> 
> 
> I'm sure there's a better way to do this. Any thoughts?
> 

Solution 1: parametrised class and hiera

1. make your zenoss module class a parameterised class:

class zenoss (
  $enable = true,
){
  validate_bool($enable)
  if $enable {
# this is your zenoss code
  }
}

2. enable hiera
put zenoss::enable key into hiera on a node specific level.

Solution 2: custom facts

put a custom fact onto the system which should not get zenoss:

/etc/puppetlabs/facter/facts.d/zenoss.txt
zenoss_disable = false

Within your zenoss module class: check for the ::zenoss_disable fact

zenoss {
  if ! $::zenoss_disable {
# your zenoss module code
  }
}

A general advise:
do not put variables into node level
don’t put logic into node level.

hth,
Martin

> 
> 
> -- 
> 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/f42ed9a7-d1e2-4313-95fc-2d74afade11e%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/6D92323D-D286-480C-9CBF-22170141A71C%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Upgrading Puppet from 2.7 to 4

2016-05-06 Thread Martin Alfke
Hi Chris,

On 06 May 2016, at 15:46, christg76  wrote:

> Hi, I'm fairly new to Puppet and have been given the project of upgrading an 
> existing Puppet 2.7 site (Puppetmaster with Apache/Passenger, and MySQL for 
> exported resources, with hundreds of clients), possibly to Puppet 4.

“fairly new to Puppet” and migration from 2.x to 4 does not fit well.
Go and teach yourself lots of stuff or attend a training or make use of the 
self paced training program at learn.puppet.com
Search for talks on upgrading to Puppet 4 (there have been plenty ones during 
the past 15 months).

> Just wanted to ask around if anybody has got experience with such an upgrade. 
> Reading the docs it says that skipping major versions isn't recommended, so I 
> guess I'd have to first upgrade to 3.x? Are there anymore upgrade docs for 
> 2.7 to 3.x available?

In general:
upgrade master first, then the agents.
You can skip some minor versions. I am unsure whether you really can skip all.
Read the existing Puppet code and get yourself an idea on what is deprecated.

In your project: I would not go for upgrading from MySQL/Apache-Passenger. I 
would target a complete setup from scratch and migrate system via system.
This will allow you to build good Puppet 4 code from scratch and to not deal 
with old broken code which will make yourself banging your head against a wall.

hth,
Martin

> 
> Many thanks,
> Chris
> 
> -- 
> 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/92886404-4a00-45c6-92ef-eb336f5f1211%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/73B75C09-7D50-49A7-8976-8790D80B8601%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Feedback for lint check extension on non local references

2016-05-01 Thread Martin Alfke
Hi,

in the trainings I recommend to participants to never have references to 
declarations outside of the class to prevent hidden class or even module 
dependencies.
Therefor I decided to do a lint plugin: 
https://github.com/voxpupuli/puppet-lint-reference_on_declaration_outside_of_class-check

I am interested in other users opinion on this check.
Should it be added to module-skeleton?

Best,
Martin

-- 
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/38C9E5C7-7C97-4468-9D4C-16D530549279%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Does the puppet agent start puppetmaster?

2016-04-18 Thread Martin Alfke
Hi Cesar,

On 18 Apr 2016, at 12:05, César  wrote:

> Hi all,
> 
> I have been looking for some docs to get more information on the subject, but 
> I have not been able to find them. Apologies if this has been asked before!
> 
> I'm curious about what happens when a puppet agent run is performed but there 
> are no puppetmaster processes yet (I'm talking about puppetmaster configured 
> by Passenger, not the daemonized configuration).

An agent requires a running master as a central instance.
You deploy your puppet code onto that master.
The agent asks the master for its configuration and the master checks node 
classification, classes, templates and “compiles” a catalog.
The catalog (which is minified JSON) is then sent back to the agent.

> When that happens usually I see something like this on the logs
> 
> Apr 18 09:59:19 ms1 puppet-master[5849]: Starting Puppet master version 3.3.2

The master should have been started by an init script.
Elder versions of Puppet used an Apache/Nginx in combination with 
Passenger/Unicorn to spin up the Ruby application.
Newer versions of the master are running on top of a JVM (the new server is 
written in Clojure).

> 
> My question would be: Should I always expect the puppet agent to somehow 
> spawn a puppetmaster process if there are none? Who's in charge of that?

An agent should not spin up a local master, but connect to an existing master 
instance.

hth,
Martin

> 
> Thanks,
> Cesar.
> 
> -- 
> 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/a6b4d24e-1ea8-425d-ac4c-6e5c81b94007%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/01C1438B-8977-48C1-948E-357CB2C47963%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Virtual resources ?

2016-03-31 Thread Martin Alfke

On 31 Mar 2016, at 17:28, Jakov Sosic <jso...@gmail.com> wrote:

> On 03/31/2016 05:10 PM, Martin Alfke wrote:
> 
>> You are passing a Hash as an parameter to a define.
>> Inside the define you expect the parameter to be of type String - according 
>> to what you do in the define.
>> 
>> You need to take care of splitting data accordingly in your define:
>> With Puppet 4 this is very easy to achieve:
>> 
>> define basket (
>>   Hash $arg,
>> ){
>>   $arg.each |String $key, Hash $value| {
>> file { “/tmp/${key}”:
>>   ensure => file,
>>   content => $value[‘arg’],
>> }
>>   }
>> }
> 
> 
> Thanks for an idea. I didn't know something like that is possible...
> 
> 
> 
> Why couldn't I just use create_resources? If I try with create_resources:
> 
> create_resources(@basket, $foobar)
> 
> 
> I get this:
> 
> Error: Could not parse for environment production: Virtual (@) can only be 
> applied to a Resource Expression at /tmp/pero.pp:16:1 on node workstation

You need to fix the content of $foobar

Generally it works:
https://github.com/puppetlabs/puppet/blob/master/lib/puppet/parser/functions/create_resources.rb

But no longer required since Puppet 4:
https://docs.puppetlabs.com/puppet/latest/reference/lang_resources_advanced.html#implementing-the-createresources-function


> 
> -- 
> 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/56FD423A.2080203%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/75C2B4D4-EB13-4536-A347-032A018AEAD0%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Virtual resources ?

2016-03-31 Thread Martin Alfke
Hi,

On 31 Mar 2016, at 16:38, Jakov Sosic  wrote:

> Hi guys,
> 
> I have a `test.pp` manifest that looks like:
> 
> 
> ```
> define basket($arg) {
>  file { "/tmp/$name":
>ensure  => present,
>content => $arg,
>  }
> }
> 
> foobar = {
>  'fruit' => { arg => 'apple' },
>  'berry' => { arg => 'watermelon' }
> }
> 
> @basket[$foobar]
> 
> realize( Basket[fruit] )
> realize( Basket[berry] )
> ```
> 
> 
> When I run `puppet apply test.pp`, this is what I get:
> 
> Error: Could not parse for environment production: Virtual (@) can only be 
> applied to a Resource Expression at /tmp/pero.pp:16:1 on node workstation

You are passing a Hash as an parameter to a define.
Inside the define you expect the parameter to be of type String - according to 
what you do in the define.

You need to take care of splitting data accordingly in your define:
With Puppet 4 this is very easy to achieve:

define basket (
  Hash $arg,
){
  $arg.each |String $key, Hash $value| {
file { “/tmp/${key}”:
  ensure => file,
  content => $value[‘arg’],
}
  }
}

hth,
Martin

> 
> 
> Any ideas?
> 
> -- 
> 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/56FD367F.9%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/69D9ED57-136E-4394-9404-F85DC1E5B413%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Resources sharing across different classes.

2016-03-31 Thread Martin Alfke
Hi Arfoz,

this is the best example on how to _not_ do classes.
Every class should be self contained - as long as possible.
In your case you have a hard reference from one resource inside a class to 
another resource inside another class.
I always tell my training course attendees that they should never do this 
unless they don’t like themselves and they want to have Puppet nightmares.

In your case you can do the following hack:

make the add file class a parameterised class, set the parameter to the default 
behaviour:

class addfile (
  $enable_notify => Service[’tomcat’],
) {
  file {‘/tmp/hello’:
ensure => file,
notify => $enable_notify,
  }
}

On systems where you don’t have tomcat class included you have to declare the 
class add file with parameter set to undef.

But: be aware that even this is not a good solution.
It’s just a hack.
Try to refacter your modules.

Best,
Martin


On 31 Mar 2016, at 13:48, Afroz Hussain  wrote:

> Error as below:
> 
> Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
> Invalid relationship: File[/tmp/hello] { notify => Service[tomcat] }, because 
> Service[tomcat] doesn't seem to be in the catalog
> 
> On Thursday, 31 March 2016 17:13:46 UTC+5:30, Afroz Hussain wrote:
> Hi All,
> 
> I am facing an issue to notify a service from different module whenever file 
> changes.
> Example:
> I have a addfile module which creates a file and want to notify tomcat 
> service which is present in tomcat module. 
> 
> class addfile {
>file {"/tmp/hello":
>  ensure => file,
>  content => "hello",
>  notify   => Service["tomcat'],
>}
> }
> 
> 
> it is throwing an error as tomcat service is not in catalog.
> 
> I have 3.6.2 version of puppet and using ENC.
> 
> Any help will be appreciated
> 
> Thanks,
> Afroz Hussain
> 
> 
> -- 
> 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/02cfc06d-d306-48a2-a917-7144606a1509%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/4E500FF9-67BF-4683-8929-AC0DA2FCDC31%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Defined resource type, lambda block

2016-03-30 Thread Martin Alfke
Hi Manuela,

On 30 Mar 2016, at 12:51, 'Manuela Mueller' via Puppet Users 
 wrote:

> Dear All,
> 
> I'm trying to set up a small module in order to test defined resource types. 
> Module should create 2 users, data are in host specific yaml file pieps.yaml.
> When I try to apply the module I receive the following error message:
> 
> [root@pieps modules]# puppet apply --noop --modulepath=./ 
> deftype_users_test/tests/init.pp
> Error: Evaluation Error: The value 'name' cannot be converted to Numeric. at 
> /root/Desktop/testing/modules/deftype_users_test/manifests/init.pp:3:40 on 
> node pieps.localdomain
> 
> As I'm just beginning to learn Puppet, I have no idea where the error is.
> Any help would be greatly appreciated.
> 
> Thank you very much and have a nice day,
> 
> Manula Atoui


You want Puppet to do automatic data lookup for the class ‘deftype_users_test’ 
parameter.
In this case the hiera key has to follow naming convention:

::

in your case:

deftyp_users_test::user list:
  ‘jill’:
uid: 1000
  ‘jack’:
uid: 1001

Within your puppet class you iterate over the hash:

class deftype_users_test (
  Hash $userlist
){
  $userlist.each | String $key, Hash $value| {
notify { “User with name: ${key} and hid ${value[uid]}”: }
  }
}

hth,
Martin

> 
> Hiera configuration:
> ==
> puppet master --configprint all
> ...
> hiera_config = /etc/puppetlabs/code/hiera.yaml 
> 
> cat /etc/puppetlabs/code/hiera.yaml
> 
> hiera.yaml:
> ---
> 
> :backends:
>   - yaml
> :hierarchy:
> # orig  - "nodes/%{::trusted.certname}"
>   - "hostname/%{facts.hostname}"
>   - "os/%{facts.osfamily}"
>   - common
> 
> :yaml:
> :datadir: /etc/puppetlabs/code/hieradata
> 
> 
> I set up a yaml file for host pieps:
> /etc/puppetlabs/code/hieradata/hostname/pieps.yaml
> 
> --- # start yaml file
> message: "sample message from hiera in pieps.yaml"
> # deftype_users_test, defined resource type 'create'
> user: 

>   jill:
> uid: 1
> comment: 'user jill, test defined resource type'
>   jack:
> uid: 10001
> comment: 'user jack, test defined resource type'
> 
> Structure module deftype_users_test
> =
> [root@pieps deftype_users_test]# tree
> .
> ├── manifests
> │   ├── create.pp
> │   ├── create.pp~
> │   ├── init.pp
> │   └── init.pp~
> └── tests
> └── init.pp
> 
> 2 directories, 5 files
> 
> [root@pieps deftype_users_test]# cat manifests/init.pp
> class deftype_users_test( Array[Hash] $userlist = [] ) {
>   userlist.each |$user| {
> deftype_users_test::create { $user['name']:
>   uid => $user['uid'],
>   comment => $user['comment'],
> } # end call defined resource type 'create'
>   } # end lambda block
> } # end class deftype_users_test
> 
> 
> [root@pieps deftype_users_test]# cat manifests/create.pp
> define deftype_users_test::create(
>   Integer $uid,
>   String $comment,
> ) {
>   user { $title:
> uid => $uid,
> comment => $comment,
>   }
> } # end defined resource type 'create'
> 
> [root@pieps deftype_users_test]# cat tests/init.pp 
> include deftype_users_test
> 
> 
> -- 
> 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/cb8fcf42-80a7-499e-841d-5bda1b3a2369%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/4F30B89C-CB70-478B-B9A6-2595933DC403%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Configure puppet-master on 443 rather then 8140

2016-03-29 Thread Martin Alfke

On 29 Mar 2016, at 13:47, Rohit Sharma  wrote:

> Hi Team,
> 
> By default when we install foreman puppet-master running/listen agent request 
> on 8140, but I need to it on 443 only

AFAIK foreman listens on 443.
Why do you want to move away from 8140?

puppet config print | grep 8140
You need to configure master port, ca_port and report_port on master and all 
agents.

> Can any one help me out to configure puppet master over 443 than 8140.

I don’t see the benefit in doing so.

> Please tell me the detailed step.
> 
> Thanks in advanced
> 
> Regards 
> Rohit
> 
> -- 
> 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/23eeaa73-085b-4e2d-8c44-904240717bba%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/963B9820-D235-41B8-97AE-D615724731BF%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Please Confirm: Puppet Directory Environments can not be named "master" ?

2016-03-23 Thread Martin Alfke

On 23 Mar 2016, at 12:23, Henrik Lindberg <henrik.lindb...@puppetlabs.com> 
wrote:

> On 23/03/16 11:24, Martin Alfke wrote:
>> 
>> On 22 Mar 2016, at 22:53, Carthik Sharma <cart...@puppetlabs.com> wrote:
>> 
>>> To answer the question in the subject, you're correct, as documented here 
>>> for Puppet 3.8
>>> 
>>> https://docs.puppetlabs.com/puppet/3.8/reference/environments_classic.html#allowed-names
>> 
>> Is this only for Puppet 3.8 or is this also valid for Puppet 4.x?
>> 
> 
> Only versions < 4 has those restriction.
> 
> From 4.0.0 the name "environment" should not be used as the actual name of an 
> environment.

should not or must not?

-Martin

-- 
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/BFD3351D-E707-4E13-8E52-6EED8B0E3730%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Please Confirm: Puppet Directory Environments can not be named "master" ?

2016-03-23 Thread Martin Alfke

On 22 Mar 2016, at 22:53, Carthik Sharma  wrote:

> To answer the question in the subject, you're correct, as documented here for 
> Puppet 3.8
> 
> https://docs.puppetlabs.com/puppet/3.8/reference/environments_classic.html#allowed-names

Is this only for Puppet 3.8 or is this also valid for Puppet 4.x?


> 
> 
> 
> On Tue, Mar 22, 2016 at 1:41 AM, 'Robert Heinzmann' via Puppet Users 
>  wrote:
> Hello, 
> 
> I'm using PuppetServer 1.1.3 and want to use directory environments (I can 
> not update to puppet 4 because of http://projects.theforeman.org/issues/8447, 
> Foreman is used for reporting and facts only (CMDB like)).
> 
> The main puppet repo has 2 branches: 
>   • master (production)
>   • development (test)
> I use r10k to manage the environments under /etc/puppet/environments
> 
> --- o<
> :sources:
>   example:
> basedir: /etc/puppet/environments
> prefix: false
> remote: 
> --- o<
> 
> The following master setup has worked for both "master" and "development"
> 
>  o<  
> # file /etc/puppet/puppet.conf 
> [master]
> 
> # insecure not via server_facts ...
> environment = ...
> # PuppetDB Enabled
> storeconfigs = true
> storeconfigs_backend = ...
> reports = ...
> 
> # Hiera Config File
> hiera_config = ...
> default_manifest = /etc/puppet/environments/$environment/manifests/site.pp
> manifestdir = /etc/puppet/environments/$environment/manifests
> manifest = /etc/puppet/environments/$environment/manifests/site.pp
> modulepath = 
> /etc/puppet/modules:/etc/puppet/environments/$environment/modules:/etc/puppet/environments/$environment/forge:/etc/puppet/environments/$environment/3rdparty
> # ENC Enabled
> node_terminus = exec
> external_nodes = ...
> ## see 
> https://docs.puppetlabs.com/puppet/latest/reference/lang_facts_and_builtin_vars.html#serverfacts-variable
> trusted_server_facts = true
> trusted_node_data = true
> ## Make sure master uses another directory so master can be agent of 
> someone else
> ssldir = ...
> certname = ...
> server = ...
> 
> ## Add extra DNS Names
> dns_alt_names = ...
>  o<  
> 
> Now I want to switch to directory environments changed configuration as 
> follows:
> 
> Puppet master config is as follows: 
> 
>  o<  
> # file /etc/puppet/puppet.conf 
> [master]
> 
> environment = ...
> # PuppetDB Enabled
> storeconfigs = true
> storeconfigs_backend = ...
> reports = ...
> 
> # Hiera Config File
> hiera_config = ...
> ## Directory Environments enabled
> default_manifest = /etc/puppet/manifests/site.pp
> environmentpath = /etc/puppet/environments
> environment_timeout = 0
> basemodulepath = /etc/puppet/modules
> disable_per_environment_manifest = false
> # ENC Enabled
> node_terminus = exec
> external_nodes = ...
> ## see 
> https://docs.puppetlabs.com/puppet/latest/reference/lang_facts_and_builtin_vars.html#serverfacts-variable
> trusted_server_facts = true
> trusted_node_data = true
> ## Make sure master uses another directory so master can be agent of 
> someone else
> ssldir = ...
> certname = ...
> server = ...
> 
> ## Add extra DNS Names
> dns_alt_names = ...
>  o<  
> 
> The environment.conf is 
> 
>  o<  
> # file /etc/puppet/environments/master/environment.conf and
> # file /etc/puppet/environments/development/environment.conf
> ## See 
> https://docs.puppetlabs.com/puppet/latest/reference/config_file_environment.html
> 
> # The module path
> modulepath = ./modules/:./forge/:./3rdparty/:$basemodulepath
> 
> # Manifest
> manifest = manifests/site.pp
> 
> # current or future (3.8 only)
> # parser = current
> 
> ## Path to custom script
> # config_version=
> 
> ## Timeout for cache
> environment_timeout = unlimited
>  o<  
> 
> This setup works for environment "development" but not "master".
> 
> agent shell# puppet agent --onetime --test --environment master => Fail with 
> 404
> Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
> Could not find class my_webserver for webserver-test1 on node webserver-test1
> 
> agent shell# puppet agent --onetime --test --environment development => OK
> 
> If I do "mv /etc/puppet/environments/master 
> /etc/puppet/environments/mytest123" and restart the puppetserver mytest123 
> environment works
> 
> agent shell# puppet agent --onetime --test --environment mytest123 => OK
> 
> If I do "mv /etc/puppet/environments/mytest123 
> /etc/puppet/environments/master" and restart the puppetserver master 
> environment FAILES again
> 
> agent shell# puppet agent --onetime --test --environment master => Fail with 
> 404
> Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
> Could not find class my_webserver for webserver-test1 on node webserver-test1
> 
> So it is not 

Re: [Puppet Users] Help to find Automation tool

2016-03-06 Thread Martin Alfke
Hi Mamadou,

Puppet OpenSource also supports windows:
https://docs.puppetlabs.com/windows/

Best,
Martin

On 06 Mar 2016, at 10:13, Mamadou CHERIF  wrote:

> Hello Team,
> 
> I am a noob on automation.
> I should choose one tool between Puppet, CHEF and Spacewalk.
> I have done some research on the web and i found that puppet is better.
> But our company would like to use puppet opensource not enterprise version.
> 
> I would like to know if puppet ope,source version supports WINDOWS.
> 
> 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/516bb44b-166d-4897-ae2d-e87cfdd63e96%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/BEAD52E4-606E-4385-A9AA-ACDF6C7E2359%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppet cannot find class.

2016-03-05 Thread Martin Alfke
Hi
On 05 Mar 2016, at 11:18, dE  wrote:

> Hi.
> 
> I've made a class in the $basemodulepath location --
> 
> puppet config print  | grep basemodulepath
> basemodulepath = /etc/puppetlabs/code/modules:/opt/puppetlabs/puppet/modules
> 
> ls -R /etc/puppetlabs/code/modules/all_class/
> /etc/puppetlabs/code/modules/all_class/:
> manifests

This means you have a module with name all_class.
> 
> /etc/puppetlabs/code/modules/all_class/manifests:
> dep.pp  first_class.pp

And there are two classes inside the module.
> 
> Contents of first_class.pp -- 
> class first_class {

The class is within the module namespace.
rename it to
class all_class::first_class {

> file { '/tmp/fclass.txt':
> ensure => present,
> owner => de,
> group => de,
> }
> file { '/tmp/procs':
> ensure => directory,
> source => ['puppet:///modules/filesmmodule/proc_files/'],
> owner => de, 
> group => root,
> mode => '700',
> recurse => true
> }
> file {'/tmp/procs/cpuinfo':
> ensure => present,
> owner => de,
> group => de,
> }
> require Class["dep"]
> }
> 
> Contents of dep.pp —

Same here:
rename to
class all_class::dep {

> class dep {
> file { '/tmp/dep_file':  
> ensure => present,
> owner => de
> }
> }
> 
> When I call the class from the main manifest -- 
> 
> Error: Evaluation Error: Error while evaluating a Resource Statement, Could 
> not find declared class first_class at 
> /etc/puppetlabs/code/environments/production/manifests/default.pp:1:1 on node 
> desktop miner

I suppose you have something like include first_class in your manifest.
Puppet searches for
$basemodulepath/first_class/manifests/init.pp

> 
> It does not help if I define the class in $modulepath
> 
> Thanks for any help.
> 
> -- 
> 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/b0c4b1d7-7972-4a8e-aa71-ac2930a29513%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/F67B162B-E2AB-4193-9E42-6F55FF23E2EA%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppet log files

2016-02-29 Thread Martin Alfke

On 29 Feb 2016, at 17:25, moonsun1...@gmail.com wrote:

> Hi Martin,
> 
> Thanks for your response. I have added some code to site.pp and i have 
> applied it. 

I suppose you have done the following:

puppet apply //site.pp

Puppet apply does not need a Puppet server process. It applies the content of 
the given file locally.
Puppet apply directly shows you whether the code was successful and which 
chafes have been done.

> 
> Please let me know where can i see in master whether the changes applied 
> successfully or not. 

If you want to see something on the master you have to run the puppet agent 
command.

Maybe you want to start with the learning Puppet website 
(http:((learn.puppetlabs.com) to get an understanding of Puppet functionality, 
components and workflow.

Best,
Martin

> 
> puppet directory is empty in my environment. 
> 
> 
> Thanks,
> 
> 
> On Monday, February 29, 2016 at 11:09:49 AM UTC-5, Martin Alfke wrote:
> 
> On 29 Feb 2016, at 16:17, moons...@gmail.com wrote: 
> 
> > I have installed puppet 4.3 in Centos 7. 
> > 
> > I have checked /var/log/puppetlbas. Not sure which file to check to see 
> > configuration success or not. 
> > 
> > r10k 
> This directory has the logs of the code deployment tool 
> 
> > puppet 
> This is where you find the logs from puppet agent 
> 
> > activemq 
> Here you find the logs of mcollective orchestrator 
> 
> > mcollective-audit.log 
> > puppetserver 
> Here you find the logs of the puppet server process 
> 
> > orchestration-services 
> This is for the new PE only orchestrator 
> 
> > console-services 
> This is for the logs of the web based node classification tool 
> 
> > installer 
> As the name mentions: logs from the installer 
> 
> > nginx 
> The puppet server also has a nginx in front. 
> 
> > pxp-agent 
> This is for the new “direct puppet” daemon which is used by the new 
> orchestrator 
> 
> > mcollective-metadata-cron.log 
> > postgresql 
> PuppetDB is a REST to PGSQL interface and has its logs here 
> 
> > mcollective.log 
> > puppetdb 
> This is where puppetdb stores its logs. 
> 
> > 
> > 
> > Thanks, 
> > Chaitanya 
> > 
> > On Monday, February 29, 2016 at 10:12:01 AM UTC-5, Martin Alfke wrote: 
> > Hi, 
> > 
> > On 29 Feb 2016, at 15:59, moons...@gmail.com wrote: 
> > 
> > > Hi All, 
> > > 
> > > I have install puppet enterprise 4.3 version. May I know where can i see 
> > > log files. 
> > 
> > PE 2015.3.x or FOSS Puppet 4.3? 
> > > 
> > > i have checked /var/log/messages it is not updating. 
> > 
> > Logs should be in /var/log/puppetlabs/ 
> > 
> > Best, 
> > Martin 
> > 
> > > 
> > > 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...@googlegroups.com. 
> > > To view this discussion on the web visit 
> > > https://groups.google.com/d/msgid/puppet-users/47679568-1bfe-4cd5-8c88-b4b8a08b34d4%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...@googlegroups.com. 
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/puppet-users/b2e9b620-c938-4fd0-8bb5-f7bfd847dfdc%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/3e41cbbc-c1d0-4acc-af0a-47960f59480c%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/7228AFD3-2779-409D-A8D4-75A8BCB27278%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppet log files

2016-02-29 Thread Martin Alfke

On 29 Feb 2016, at 16:17, moonsun1...@gmail.com wrote:

> I have installed puppet 4.3 in Centos 7.
> 
> I have checked /var/log/puppetlbas. Not sure which file to check to see 
> configuration success or not.
> 
> r10k
This directory has the logs of the code deployment tool

> puppet
This is where you find the logs from puppet agent

> activemq
Here you find the logs of mcollective orchestrator

> mcollective-audit.log
> puppetserver
Here you find the logs of the puppet server process

> orchestration-services
This is for the new PE only orchestrator

> console-services
This is for the logs of the web based node classification tool

> installer
As the name mentions: logs from the installer

> nginx
The puppet server also has a nginx in front.

> pxp-agent
This is for the new “direct puppet” daemon which is used by the new orchestrator

> mcollective-metadata-cron.log
> postgresql
PuppetDB is a REST to PGSQL interface and has its logs here

> mcollective.log
> puppetdb
This is where puppetdb stores its logs.

> 
> 
> Thanks,
> Chaitanya
> 
> On Monday, February 29, 2016 at 10:12:01 AM UTC-5, Martin Alfke wrote:
> Hi, 
> 
> On 29 Feb 2016, at 15:59, moons...@gmail.com wrote: 
> 
> > Hi All, 
> > 
> > I have install puppet enterprise 4.3 version. May I know where can i see 
> > log files. 
> 
> PE 2015.3.x or FOSS Puppet 4.3? 
> > 
> > i have checked /var/log/messages it is not updating. 
> 
> Logs should be in /var/log/puppetlabs/ 
> 
> Best, 
> Martin 
> 
> > 
> > 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...@googlegroups.com. 
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/puppet-users/47679568-1bfe-4cd5-8c88-b4b8a08b34d4%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/b2e9b620-c938-4fd0-8bb5-f7bfd847dfdc%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/4F0E148E-88F5-4C7B-84B5-47FF8D2F02FA%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppet log files

2016-02-29 Thread Martin Alfke
Hi,

On 29 Feb 2016, at 15:59, moonsun1...@gmail.com wrote:

> Hi All,
> 
> I have install puppet enterprise 4.3 version. May I know where can i see log 
> files. 

PE 2015.3.x or FOSS Puppet 4.3?
> 
> i have checked /var/log/messages it is not updating. 

Logs should be in /var/log/puppetlabs/

Best,
Martin

> 
> 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/47679568-1bfe-4cd5-8c88-b4b8a08b34d4%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/3B92E323-88C4-4EBA-A8E5-75B25E408818%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppetdb and multiple puppetmasters

2016-02-28 Thread Martin Alfke
Hi,
On 28 Feb 2016, at 00:39, Robert Davidson  wrote:

> I'm quite certain that there's something in the documentation that I'm 
> missing here. (It has all the hallmarks of an Own Damn Fault situation.) 
> Nonetheless, as I'm getting nowhere, I figure I'll fling out a cry for help.
> 
> How do you configure puppetdb so it will permit multiple puppetmasters to 
> talk to it? The only master that can successful submit facts/reports is the 
> one that the puppetdb machine was puppeted from.

You need to set up one master as CA and disable CA on the other masters, making 
use of the CA master.
Look for the concept of “Master of Masters”
https://docs.puppetlabs.com/guides/scaling_multiple_masters.html

Problem lies within the CA.
All Masters and the PuppetDB needs to be within the same CA.

hth,
Martin

> All others get (hostnames stripped out, of course):
> Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
> Failed to submit 'replace facts' command for $HOSTNAME to PuppetDB at 
> $PUPPETDBHOSTNAME:8081: SSL_connect returned=1 errno=0 state=SSLv3 read 
> server certificate B: certificate verify failed: [unable to get local issuer 
> certificate for /CN=$PUPPETDBHOSTNAME]
> 
> 
> What incredibly obvious thing have I overlooked entirely?
> 
> -- 
> Robert Davidson
> 
> 
> -- 
> 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/1EE73329D6577F44A3C2FB0F7D4ACAE98D08B812%40mbx-02.
> 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/BC7AF8AE-DFB0-4A99-AB2E-8F3BD76AC992%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Newbie question about fetching specific value of a key from hash

2016-02-04 Thread Martin Alfke
Hi Sam
On 03 Feb 2016, at 16:28, Sam  wrote:

> My hiera entries -
> 
> mysqlconfig::custom_mysql_options:
>   mysqld:
> replicate-ignore-db: 'test'
> server-id: 12
> datadir: '/data/mysql_data'
> 
> 
> I want to get the value of datadir in my puppet module. Please let me know 
> what is the syntax I need to use to fetch this value. I tried something as 
> follows but it doesn't work. 
> 
> 
> $datadir = hiera('mysqlconfig::custom_mysql_options[datadir]’)

With hiera you can only specify keys, not elements of a hash.

you should change this to:

$custom_mysql_options = hiera(‘mysqlconfig::custom_mysql_options’)

You can now set a new variable reading the hash element:

$datadir = $custom_mysql_options[‘datadir’]

> 
>   file { "$datadir":
> ensure => directory,
> owner  => 'mysql',
> group  => 'mysql',
> mode   => '0755',
>   }
> 
> 
hth,
Martin

> Thanks in advance
> Sam
> 
> -- 
> 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/95efaffa-4873-4fda-9caa-3a38e7b3c1de%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/7687C384-3106-4A61-AC14-1F90BB21CB33%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Using Future Parser on Puppet v3.8.2

2016-01-30 Thread Martin Alfke

On 29 Jan 2016, at 21:44, Sans  wrote:

> 
> Hi there,
> Need to iterate over an arry, so was trying the Future Parser. Using a very 
> simple example:
> 
> 
> 
> $alpha = ['a','b','c']
> each($alpha) |String $value| { notice( "Hi there, ${value}" ) }
> 
> but getting this error:
> Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
> Could not match |String at..
> 
> Not using the strict variable type also doesn't help, I get error at  |$value 
> that time.
> 
> I also tried using: $alpha.each |String $value| { notice( "Hi there, 
> ${value}" ) }
> 
> and get the error like:
> Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
> Syntax error at '.'; expected '}' at
> 
> 
> I do have parser=future defined in the puppet.conf on my PM. what am I still 
> missing?

Have you restarted puppet master process after adding future_parser to 
puppet.conf?

Best,
Martin

> 
> -San
> 
> -- 
> 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/adae1bd7-a596-43c0-b38e-5aa164de2dc9%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/ADA9A953-63B6-402F-8949-CB22B0AA0C17%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Warning: Local environment: "production" doesn't match server specified node environment

2016-01-30 Thread Martin Alfke
Hi Matt,

an ENC can set an environment for a node.
In case that a node does not specify an environment it will make use of 
environment production.
You can specify node environment on the node in puppet.conf in agent section:

[agent]
environment = apt

Best,
Martin

On 28 Jan 2016, at 18:13, Matt Zagrabelny  wrote:

> Hi Alfredo,
> 
> Thanks for the reply.
> 
> On Wed, Jan 27, 2016 at 4:47 PM, Alfredo De Luca
>  wrote:
>> Hi Matt.
>> AFAIK production is the default environment assigned to all the nodes.
> 
> Sure.
> 
>> try
>> puppet config print environment
> 
> Yep, production:
> 
> # puppet config print environment
> production
> 
> So how do I get the warning to go away?
> 
> Warning: Local environment: "production" doesn't match server
> specified node environment "apt", switching agent to "apt".
> 
> Any ideas?
> 
> -m
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/CAOLfK3UAMWc4dEWsspDnkGNkbiEYKSR5vN-CmxTFbP0RhfLAtQ%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/B5B9CC12-7A94-42EF-8AE1-A7F8407F5D72%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Overriding file resource with class inheritance

2016-01-30 Thread Martin Alfke
Hi Kyle,

On 30 Jan 2016, at 01:27, Kyle Flavin  wrote:

> On Friday, January 29, 2016 at 3:44:24 PM UTC-8, Garrett Honeycutt wrote:
> Hi Kyle, 
> 
> I think you have a scoping issue, try using the double colons for the 
> puppet class, such as 'class foreman-proxy::puppet inherits ::puppet'. 
> 
> You seem to be using inheritance correctly to override a resource, 
> though you are doing this between two modules. This pattern should be 
> avoided at all costs and will likely end in tears. 
> 
> http://docs.puppetlabs.com/guides/style_guide.html#class-inheritance 
> 
> Suggest that the puppet module manage the puppet.conf. 
> 
> I added the "::" and it allowed the client to run without an error, but I'm 
> getting the modules/puppet/templates/puppet.conf.erb template brought down on 
> the client, instead of modules/foreman-proxy/templates/puppet.conf.erb.  Is 
> it possible to change that?

First: inheritance should not be used whenever possible. Especially inheritance 
among modules.

Second: your inherited class should overwrite (not re-declare) the file 
resource:

class foreman-proxy::puppet inherits puppet {
File['/etc/puppet/puppet.conf’] {
content => template('foreman-proxy/puppet.conf.erb'),
}
}

Third: the best option would be to add a template parameter to the puppet class:

class puppet (
  puppet_conf_template = ‘puppet/puppet.conf.erb’,
){
  file { ‘/etc/puppet/puppet.conf’:
content => template($puppet_conf_template),
  }
  ...
}

class foreman_proxy::puppet {
  class { ‘::puppet’:
puppet_conf_template = ‘foreman_proxy/puppet.conf.erb’,
  }
}

Fourth: a hyphen in class names is deprecated in Puppet 4. You should switch to 
underscore (like in my example).



> 
> I'm looking into another solution as well.  The problem is, with the way our 
> manifests were written, there doesn't seem to be an easy way to extend for 
> edge cases like this without changing the original module.  The module is on 
> thousands of servers, so I'm a little hesitant to change it. 

Fifth: add rspec-puppet (and beaker) tests to your modules. This will allow 
testing behaviour prior doing changes.

Best,
Martin

> 
> -- 
> 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/4fd8baf6-398d-49d3-84b0-3fe7596886c3%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/F1AD027E-5306-4AEF-9E1F-39198157A08C%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] testing approaches for puppet upgrades

2016-01-30 Thread Martin Alfke

On 30 Jan 2016, at 13:48, Tim Coote  wrote:

> What's the best way to test upgrades of puppetmaster?  I'm trying to migrate 
> from 3.x to 4.x on a small network. An obvious step for me was to create the 
> new manifests on a new VM and then to confirm that the existing puppet agents 
> wouldn't have any changes if they try to use that server for updates.

Another approach is possible by using directory based environments on a Puppet 
3.8 master:

copy production environment to a puppet4upgradetest environment.
Put an environment.conf file into the new environment where you specify to make 
use of the future parser:
future_parser = true

Let any node do a puppet agent run in noop mode against the new environment:
puppet agent —test —environment puppet4upgradetest
You should take care on any puppet master errors and node changes.

Create a new node and let that node get its initial configuration from the new 
environment.
Afterwards run the agent against the production environment.
You have tot take care on all changes which would be done by the old puppet 3 
production environment.

And (of course) you want to do unit and integration testing on modules and 
roles

> 
> However, this approach falls as the certificates on the clients aren't 
> recognised by the server. I'd guess that there's going to be similar identity 
> issues from the clients' point of view if I get past this step.

No need for a new CA. Just sign the node certificates on the Puppet master.


hth,
Martin

> 
> Is there a more pragmatic test plan to follow?
> 
> The puppet documentation seems to leave it as an exercise to the user that 
> 'nothing has broken' in the migration.  Clearly this makes sense for changes 
> to the client configurations, but even then some sort of 'diff' between the 
> configurations would help.
> 
> tc
> 
> -- 
> 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/CAKZLxiUcbkfcOZ7a0ciAAaK8WercHQZxY4Fv2G-21CsYG5xODg%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/0203A93D-2FCE-4960-879B-283868B62D53%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] override values in puppet account creation

2016-01-23 Thread Martin Alfke

You need to specify all attributes of the resource type usage as parameters at 
the define:

accounts::virtual { ‘mysql’:
  uid=> ‘…’,
  shell  => ‘…'
  home => ‘…’,
  realname => ‘…’,
  pass   => ‘…’,
}

define accounts::virtual (
  $uid,
  $shell => ‘…’,
  $home => ‘…’,
  $realname => ‘…’,
  $pass => ‘…',
){
  …
}

Parameters within the define will be attributes on define declaration.

Best,
Martin

On 23 Jan 2016, at 19:15, Lowe Schmidt  wrote:

> you probably need to lift up the parameters to the define. 
> 
> something like 
> 
> 
> define accounts::virtual ($uid, $realname, $pass, $shell='/bin/bash') {... }
> 
> 
> It's been awhile since I did program in puppet, but that should be a start.
> 
> 
> --
> Lowe Schmidt | +46 723 867 157
> 
> On 23 January 2016 at 18:22, Tim Dunphy  wrote:
> Hey guys,
> 
>  I've got a puppet module that creates user accounts on linux machines.
> 
>  I'm trying to override a couple settings in my config for the user's shell 
> and home directory. And I'm getting this error:
> 
> Error: Could not retrieve catalog from remote server: Error 400 on 
> SERVER: Invalid parameter shell on Accounts::Virtual[mysql] at 
> /etc/puppet/environments/production/modules/accounts/manifests/init.pp:70 on 
> node solr1.jokefire.com
> Warning: Not using cache on failed catalog
> Error: Could not retrieve catalog; skipping run
> 
> I have the user virtual account definitions setup this way in the account 
> module's init.pp: 
> 
> 
>@accounts::virtual { 'mysql':
>  uid =>  1007,
>  shell   =>  '/bin/false',
>  home=> '/var/lib/mysql',
>  realname=>  'mysql',
>  pass=>  'secret_hash',
> }
> 
> And this is how the virtual account definitions are setup:
> 
> # Defined type for creating virtual user accounts
> #
> define accounts::virtual ($uid,$realname,$pass) {
> 
>   user { $title:
> ensure=>  'present',
> uid   =>  $uid,
> gid   =>  $title,
> shell =>  '/bin/bash',
> home  =>  "/home/${title}",
> comment   =>  $realname,
> password  =>  $pass,
> managehome=>  true,
> require   =>  Group[$title]
>   }
> 
>   group { $title:
> gid   =>  $uid,
>   }
> 
>   file { "/home/${title}":
> ensure=>  directory,
> owner =>  $title,
> group =>  $title,
> mode  =>  0750,
> require   =>  [ User[$title], Group[$title] ]
>   }
> }
> 
> Where am I going wrong? Why can't I override these values?
> 
> -- 
> GPG me!!
> 
> gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
> 
> 
> -- 
> 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/CAOZy0ekGSusExu6fP03HA-%2BY2iPmCaMgv%2B7%3Dkr6V%2BCBOHS%3DH9Q%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/CAC-wWcSzshwerCyVLSJMYP3_kS%2BxftCjRkERc-mwd0O2JEiwZg%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/66AC8A2A-5139-43FD-9741-7527E3E63A25%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] server not listed in manifests, but gets catalog

2016-01-11 Thread Martin Alfke
Hi Andreas,
> On 11.01.2016, at 13:47, Andreas Dvorak  wrote:
> 
> Hi,
> 
> after the update of the puppet master from 3.3.1 to 3.6.2 a host gets a 
> catalog even if it is not defined in manifests. Is this a new funcationality? 
> I did not see anything in the release notes.
> It gets a catalog with all the information from profiles::base
> 
> manifests/
> cat site.pp
> node default {
> notify { 'Server ist noch nicht in Puppet definiert': }
> }
> 
> if versioncmp($::puppetversion, '3.6.0') >= 0 {
> Package {
>   allow_virtual => true,
> }
> }
> 
> hiera_include('classes’)

The hiera_include is done in global scope, not within a node scope.
This means, that every node should get classes included from ‘classes’ hiera 
key.

> 
> a nodes.pp with server, but not the one 
> 
> hiera/
> cat common.yaml
> classes:
>   - profiles::base

And this is where the hiera_include gets its classes which should be put into 
the catalog for all nodes.

Nothing uncommon.
Expected behavior.

Best,
Martin

> 
> 
> Best regards
> Andreas
> 
> -- 
> 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/9377c926-8550-40ef-962b-d036e06bf33f%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/B567FEFE-56A8-4A24-8953-2E7E72D711E3%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] What I think that is needed for a practical Puppet class

2016-01-02 Thread Martin Alfke
Hi Rudy,

Great idea and work!
I really appreciate supporting less advanced countries.
Maybe you want to also look at our new Puppet documentation/slide/example 
project: http://www.example42.com/guide/

I encourage people to start using self developed modules (but with a prefix for 
the module name to not block them from moving to available modules).
This will allow them to understand Puppet code constructs and they should 
switch to existing modules when they have a decent understanding of Puppet.

Best,
Martin

On 01 Jan 2016, at 23:36, Rudy Gevaert  wrote:

> Hi,
> 
> This is just report of something I just wrote on my blog 
> (http://blog.webworm.org/content/whats-needed-practical-puppet-class) .  Feel 
> free to comment here or through (@rgevaert) twitter or email.
> 
> I'm a happy user of Puppet and love sharing my knowledge with other people.  
> Although I'm not that active online, I've done quiet some work in getting 
> Puppet known and used in environments that aren't that easily addressable.  
> More specifically, IT departments at several universities in Cuba and 
> Ethiopia.  This as part of several IT for development  programmes.  If you 
> want to learn more about that work, read the paper I published about it.  I 
> also started the Puppet User Group in Ethiopia.
> 
> Last December I was in Cuba to follow up on my projects.  When I was at the 
> Universidad de Oriente in Santiago De Cuba I spent some time with the 
> university staff working with Puppet.  The adoption is still very young and 
> they are still in the 'learning and testing' phase.
>  
> During our hands on sessions it became clear to me that there is need for 
> specific instructors material that teaches the use of Puppet by using already 
> available modules.
> I've seen many 'introduction to Puppet' presentations and created several 
> myself.  But to be honest I never really saw any presentation that showed the 
> audience to start from scratch and build up your infrastructure by using 
> already available modules.
>  
> Why is that necessary?  Because I've seen so many newbies getting lost in 
> setting up Puppet and then loosing way to much time with reinventing the 
> wheel.  New users to Puppet, and very specifically users who don't have 
> access to peers that are already using Puppet, have a hard time deciding what 
> to do first.  And many of them start out like so many people started with 
> Puppet 8 years ago: some small classes and no modules.  But unfortunately 
> they get stuck there and don't move on.
>  
> In the same category of missing information is how to set up an easy and 
> usable work flow.  For people who are new to Puppet (and maybe even Git too!) 
> setting up dynamic environments is too difficult.  There are just too many 
> ways to do it.  I think it's important to have this in place.  Similarly 
> getting a good syntax checking and puppet lint tests
> in place right from the beginning is key in writing good Puppet code.
>  
> It's not that there is no good documentation or tutorials.  Puppetlabs 
> provides a "learning VM". But the learning VM is more for individual 
> learning.  Recently I found Example42 Puppet Tutorial.  I find the example42 
> Puppet Tutorial very good.  And best of all, the tutorial is Free Software 
> too.  I've already decided to start using this tutorial if I need to teach 
> Puppet in the future.  They also provide some example architectures.  But I'm 
> missing the approach I was discussing. 
>  
> So what should be in the approach I'm looking for?
>  
> For example I think the new users (let's call them students) should be shown 
> how to build a small infrastructure with existing modules. Installing modules 
> to manage some key components in your infrastructure:
>   • motd updating (not important but good first exercise)
>   • repository management
>   • DNS configuration in resolve.conf
>   • user management
>   • ssh configuration
>   • firewall rules
>   • setting up an apache web server
>   • setting up a MySQL server
>  
> Only after completing these steps students should move on to learn the  
> specific Puppet DSL and write their own modules.
>  
> While students are setting up their core infrastructure they should be able 
> to do this by using a local VM where they are running 'puppet apply' to test 
> the changes they making.  A vagrant VM is well suitedf or this.
>  
> Next to the above I think it would be good to have some CI infrastructure set 
> up and ready to use.  The CI should check and deploy code committed to a VCS 
> repo.  Getting students already acquainted with this way of working should 
> ease adoption.  Emphasis should be given to using the workflow.  
> Documentation should be provided on how to set it up, but  shouldn't be the 
> first thing the students needs to do.  They just need to be able to use it in 
> the first case.
>  
> It would be nice to know what the Puppet community 

Re: [Puppet Users] Puppet Enterprise Installation errors

2015-12-22 Thread Martin Alfke
Hi Nathan,

On 22 Dec 2015, at 18:54, Lindsey Smith  wrote:

> 
> 
> On Tue, Dec 22, 2015 at 9:36 AM, nathan joiner  
> wrote:
> Good Morning,
> 
> I'm trying to setup PE puppet master server and a windows agent node but I'm 
> getting "no authorization" when trying to run the puppet-enterprise-installer.
> 
> Environment:
> - I'm using a windows 7 machine
> - Using Cmder to add and ssh into a CentOS server that will be used as the 
> Puppetmaster server.
> 
> I've done the following:
> - SCPed PE 3.7.2 directory onto the root folder of my CentOS vm 
> 
> Any specific reason to use PE 3.7.2? I'd strongly recommend the most recent 
> version of PE 3.8, if not the latest PE 2015.3 with Puppet 4. If you're just 
> starting with Puppet, starting there may be better.

Good comment from Lindsey: when you start with Puppet you should go for the 
newest PE version available.
Make use of elder versions in case of specific requirement only.

>  
> - Running as super user (su)
> - CDed into puppet enterprise directory
> - Ran ./puppet-enterprise-installer -s answers.txt
> - Recieved a not authorized error message.

Check the following:

- ensure proper DNS functionality (or specify host/ip in /etc/hosts)
- ensure proper local time (ntp)
- /tmp needs to be mounted with exec option

More unlikely:
- local firewall enabled
- selinux restrictions enabled

hth,
best,
Martin


> 
> 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/8d859d0f-d23d-407e-8963-00d3be60da14%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/CAPyei8WAohMawXAx%3D7r07L33Z9XQ9CydBGwth-4jYE9YOyi3hA%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/53D9328B-7FC0-4977-8D00-6CEF15BFA468%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] osfamily in class namespace error

2015-12-20 Thread Martin Alfke
Hi Fraser,

On 20 Dec 2015, at 10:00, Fraser Goffin  wrote:

> Forgot to mention, if I run puppet lint over the RedHat::install.pp manifest 
> this error occurs (I don't know whether this is because I am running that on 
> Windows - with osfamily set to 'RedHat' or not) :-
> 
> ..\manifests\RedHat\install.pp - ERROR: docker_registry_host not in autoload 
> module layout on line 4

Manifests (and directories) may consist of lower case file names only!
You want to make use of stdlib lowercase($::osfamily) for class includes.

(Btw: osfamily on windows is always lowercase, versus RedHat, Debian, SuSE.)

Best,
Martin

> 
> Fraser.
> 
> On Sunday, 20 December 2015 08:47:25 UTC, Fraser Goffin wrote:
> Puppet: 4.2.1
> OS: RHEL/Centos 7 (can also simulate on Windows if I set osfamily to 'RedHat')
> 
> Most of the time I develop Puppet modules to run only on Windows but 
> sometimes I want them to be able usable on other OS's particularly RHEL. 
> Sometimes there's a choice between adding a bunch of predicates to a manifest 
> to detect the current OS and just maintaining separate manifests. 
> Notwithstanding the argumant for or against, in this particular case I 
> decided to follow the latter and encountered a problem I haven't seen before.
> 
> Specifically it *appears* that using the OSFAMILY name as part of a class 
> name[space] causes an error. Or more precisely, since I have already used 
> this approach successfully with 'windows' being part of a class namespace, an 
> error occurs if I use 'RedHat'.
> 
> Example:
> 
> docker_registry_host/manifests/init.pp :-
> 
> class docker_registry_host {
>   ...
> 
> notice('CLASS: docker_registry_host')
> notice('---')
> 
> notice("osfamily = ${::osfamily}")
> 
>   ...
> include "::docker_registry_host::${::osfamily}::install"
>   ...
> }
> 
> docker_registry_host/manifests/RedHat/install.pp :-
> 
> class docker_registry_host::RedHat::install {
> 
> notice('CLASS: docker_registry_host::RedHat::install')
> notice('')
> 
> }
> 
> Produces this error (full stack trace below) :-
> 
> Notice: Scope(Class[Docker_registry_host]): CLASS: docker_registry_host
> Notice: Scope(Class[Docker_registry_host]): ---
> Notice: Scope(Class[Docker_registry_host]):
> Notice: Scope(Class[Docker_registry_host]): osfamily = RedHat
> 
> Debug: importing 
> 'E:/Data/git/docker_registry/puppet/environments/production/modules/docker_registry_host/manifests/RedHat/install.pp'
>  in environment production
> 
> Error: Illegal fully qualified class reference at 
> E:/Data/git/docker_registry/puppet/environments/production/modules/docker_registry_host/manifests/RedHat/install.pp:4:38
>  on node lt032064.xxx.com
> C:/Apps/puppet/puppet/lib/puppet/pops/parser/lexer_support.rb:32:in 
> `lex_error'
> C:/Apps/puppet/puppet/lib/puppet/pops/parser/lexer2.rb:536:in `lex_token'
> C:/Apps/puppet/puppet/lib/puppet/pops/parser/lexer2.rb:284:in `scan'
> C:/Apps/puppet/sys/ruby/lib/ruby/2.1.0/racc/parser.rb:319:in `_racc_yyparse_c'
> C:/Apps/puppet/sys/ruby/lib/ruby/2.1.0/racc/parser.rb:319:in `yyparse'
> ...
> 
> So no problem finding the docker_registry_host::RedHat::install class, but 
> also ... Error: Illegal fully qualified class reference ??
> 
> If I change that part of the class namespace 'foo' everything works fine :-
> 
> ... so in init.pp if I use :-
> 
> include "::docker_registry_host::foo::install"
> 
> and have the class : docker_registry_host/manifests/foo/install.pp :-
> 
> class docker_registry_host::foo::install {
> 
> notice('CLASS: docker_registry_host::foo::install')
> notice('')
> notice('')
> }
> 
> Output as expected and no error at all.
> 
> As I mentioned above, I have used include and contain statements with 
> ${::osfamily} in them many times before when the osfamily value resolves to 
> 'windows'. For example in another module I have an install class called :-
> 
> class sonatype_nexus::windows::install {
> 
> .. and it works just fine.
> 
> 
> So I guess I'm wondering why this error occurs when osfamily resolves to 
> 'RedHat'.
> 
> In case it makes a difference, when I'm testing locally I'm using Centos 
> rather than full-blown RHEL but running 'facter osfamily' still returns 
> 'RedHat'
> 
> Any ideas why this is happening (is 'RedHat' illegal in a class name[space] 
> or a reserved word, or ...) ?
> 
> Kind Regards
> 
> Fraser.
> 
> 
> Full stack trace :-
> 
> Error: Illegal fully qualified class reference at 
> E:/Data/git/docker_registry/puppet/environments/production/modules/docker_registry_host/manifests/RedHat/install.pp:4:38
>  on node lt032064.xxx.com
> C:/Apps/puppet/puppet/lib/puppet/pops/parser/lexer_support.rb:32:in 
> `lex_error'
> C:/Apps/puppet/puppet/lib/puppet/pops/parser/lexer2.rb:536:in `lex_token'
> C:/Apps/puppet/puppet/lib/puppet/pops/parser/lexer2.rb:284:in 

Re: [Puppet Users] foreman exec node.rb turn out: No such file or directory

2015-12-15 Thread Martin Alfke

On 15 Dec 2015, at 07:33, 辛建国  wrote:

> hi,when I exec "sudo -u puppet  /etc/puppet/node.rb puppet.server.com" 
> command on puppet server ~ it turned out that ": No such file or directory", 
> but when I run "sudo -u puppet  ruby /etc/puppet/node.rb puppet.server.com" 
> command on puppet server,it works fine. how do I resolve it? 

The command (/etc/puppet/node.rb) needs to be executable if you want to run it 
directly.
What does your puppet.conf file on the master has configured in external_nodes 
setting?


-- 
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/87C5BF20-3553-4B57-BA52-E1B5D6011E6E%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet 4 Patterns and Best Practices

2015-12-09 Thread Martin Alfke
Hi Lee,
On 08 Dec 2015, at 20:12, Lee Lowder  wrote:

> All,
> 
> I recently upgraded my Puppet (open source) install to Puppet 4.3.0.
> 
> I'm currently in the process of updating internal documentation and training 
> the rest of my teams, but I was wondering if anyone had any patterns or best 
> practices that were specific to puppet 4? Specifically in cases where you no 
> longer need to maintain compatibility with older versions.

I did a talk regarding new functionality and deprecations in Puppet 4: 
https://puppetlabs.com/presentations/power-puppet-4
Besides this I encourage customers to at least make use of the type system.
For upgrading an existing platform I recommend to have a new Puppet 4 Master in 
place and make it the CA server (easy if you did the dns_alt_name configuration 
when you set up the first master).
Then switch nodes by nodes.
At my actual project we make use of the future parser setting in 
environment.conf for a special puppet 4 upgrade environment.

Best,
Martin


> 
> Thanks.
> 
>  - Lee "FriedBob" Lowder
> 
> -- 
> 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/c41cd42f-6158-4903-b187-0b24cc88155c%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/66326082-3541-4884-9CE0-B4FC3205827B%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] handling of network mounts using puppet

2015-12-09 Thread Martin Alfke
Hi,
On 09 Dec 2015, at 14:08, ddns...@gmail.com wrote:

> Hello Group,
> 
> 
> I am working on a module to handle mounting of NFS mounts.
> Puppet: 3.7.1
> Hiera: 1.3.4
> 
> I have already tested it in my lab machine and it works as expected:
> 
> mytestserver.example.com.yaml
> nfsmounts:
> '/net1':
> path: '/net1'
> device: 'somefiler:/vol/vol1/test1'
> '/net2':
> path: '/net2'
> device: 'nfsserver:/data/test2'
> '/net3':
> path: '/net3'
> device: '192.168.0.100:/local/foo/test3'
> 
> 
> init.pp  
> class mynfsmounts {
> $nfsmounts_hash = hiera_hash('nfsmounts')
> create_resources('mynfsmounts::mounts',$nfsmounts_hash )
> }
> 
> mounts.pp
> define mynfsmounts::mounts ($path,$device,)
> {
> $mountopts = 'rw,_netdev'
> $owner = 'admuser'
> $group = 'admuser'
> 
> mount { $name:
> ensure   => 'mounted',
> device   => $device,
> fstype   => 'nfs',
> options  => $mountopts,
> atboot   => 'yes',
> require  => File[$title],
> }
>  
> file { $title:
> ensure  => directory,
> owner   => $owner,
> group   => $group,
> mode=> '2775',
> }
> 
> }
> 
> 
> My question is, how do I separate the file and the mount resources in a 
> separate manifest inside the same module and have the same effect? Our puppet 
> admins require that defined type declarations do not include resources inside 
> them.

Wow.
A self defined resource type purely makes use of existing resource types.
Why are you allowed to have the mount resource in the define but not the file 
resource declaration?


-- 
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/D9DF0847-3811-4421-9430-F1D836D17A23%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet 4 Patterns and Best Practices

2015-12-09 Thread Martin Alfke
(inline)
On 09 Dec 2015, at 14:30, Christopher Wood <christopher_w...@pobox.com> wrote:

> (inline)
> 
> On Wed, Dec 09, 2015 at 09:19:13AM +0000, Martin Alfke wrote:
>> Hi Lee,
>> On 08 Dec 2015, at 20:12, Lee Lowder <thefried...@gmail.com> wrote:
>> 
>>> All,
>>> 
>>> I recently upgraded my Puppet (open source) install to Puppet 4.3.0.
>>> 
>>> I'm currently in the process of updating internal documentation and 
>>> training the rest of my teams, but I was wondering if anyone had any 
>>> patterns or best practices that were specific to puppet 4? Specifically in 
>>> cases where you no longer need to maintain compatibility with older 
>>> versions.
>> 
>> I did a talk regarding new functionality and deprecations in Puppet 4: 
>> https://puppetlabs.com/presentations/power-puppet-4
>> Besides this I encourage customers to at least make use of the type system.
>> For upgrading an existing platform I recommend to have a new Puppet 4 Master 
>> in place and make it the CA server (easy if you did the dns_alt_name 
>> configuration when you set up the first master).
> 
> How long does this generally take for medium sized deployments? I'm really 
> wincing at the difficulty level of getting everybody in the company on the 
> same page about moving hosts between CAs. If there's a fairly 
> misconfiguration-proof way to go 3.8->future parser->4 without CA changes I'd 
> rather do that instead.

There is a puppet rollover module (need to goggle for it) which ensures agents 
get a certificate for a new puppet server and have the puppet master signing it.
The problem is mostly related to the CA where people missed the dns_alt_names 
configuration in the first place.
Without dns_alt_names the CA only has the fqdn of the puppet master inside.
But you might want to have another fqdn on the new puppet master.

Most easy way I can think of:
- new ca on new puppet master (think of dns_alt_names)
- enable autosign on new puppet master
- remove certificates form node, re-run puppet agent against new master

> 
>> Then switch nodes by nodes.
>> At my actual project we make use of the future parser setting in 
>> environment.conf for a special puppet 4 upgrade environment.
>> 
>> Best,
>> Martin
>> 
>> 
>>> 
>>> Thanks.
>>> 
>>> - Lee "FriedBob" Lowder
>>> 
>>> -- 
>>> 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/c41cd42f-6158-4903-b187-0b24cc88155c%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/66326082-3541-4884-9CE0-B4FC3205827B%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/20151209143023.GA26225%40iniquitous.heresiarch.ca.
> 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/F8E9963D-9C30-43AE-8CF5-A18B93022FA5%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] handling of network mounts using puppet

2015-12-09 Thread Martin Alfke

On 09 Dec 2015, at 17:04, ddns...@gmail.com wrote:

> Hi Martin, I'm not sure what you mean. Both the mount and file resource are 
> in the defined type.

yes. But you mentioned in your first email:
"Our puppet admins require that defined type declarations do not include 
resources inside them.”

Your question: "My question is, how do I separate the file and the mount 
resources in a separate manifest inside the same module and have the same 
effect?”

Why would you like to do this?
What is wrong with having file and mount in the define?




> 
> On Wednesday, December 9, 2015 at 11:12:31 PM UTC+8, Martin Alfke wrote:
> Hi, 
> On 09 Dec 2015, at 14:08, ddn...@gmail.com wrote: 
> 
> > Hello Group, 
> > 
> > 
> > I am working on a module to handle mounting of NFS mounts. 
> > Puppet: 3.7.1 
> > Hiera: 1.3.4 
> > 
> > I have already tested it in my lab machine and it works as expected: 
> > 
> > mytestserver.example.com.yaml 
> > nfsmounts: 
> > '/net1': 
> > path: '/net1' 
> > device: 'somefiler:/vol/vol1/test1' 
> > '/net2': 
> > path: '/net2' 
> > device: 'nfsserver:/data/test2' 
> > '/net3': 
> > path: '/net3' 
> > device: '192.168.0.100:/local/foo/test3' 
> > 
> > 
> > init.pp   
> > class mynfsmounts { 
> > $nfsmounts_hash = hiera_hash('nfsmounts') 
> > create_resources('mynfsmounts::mounts',$nfsmounts_hash ) 
> > } 
> > 
> > mounts.pp 
> > define mynfsmounts::mounts ($path,$device,) 
> > { 
> > $mountopts = 'rw,_netdev' 
> > $owner = 'admuser' 
> > $group = 'admuser' 
> > 
> > mount { $name: 
> > ensure   => 'mounted', 
> > device   => $device, 
> > fstype   => 'nfs', 
> > options  => $mountopts, 
> > atboot   => 'yes', 
> > require  => File[$title], 
> > } 
> >   
> > file { $title: 
> > ensure  => directory, 
> > owner   => $owner, 
> > group   => $group, 
> > mode=> '2775', 
> > } 
> > 
> > } 
> > 
> > 
> > My question is, how do I separate the file and the mount resources in a 
> > separate manifest inside the same module and have the same effect? Our 
> > puppet admins require that defined type declarations do not include 
> > resources inside them. 
> 
> Wow. 
> A self defined resource type purely makes use of existing resource types. 
> Why are you allowed to have the mount resource in the define but not the file 
> resource declaration? 
> 
> 
> 
> -- 
> 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/06fa7c46-4d53-4cc5-9f4a-1b4eed17da23%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/7CFFFD1E-1601-4B23-95AC-6A2944AF5583%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet Enterprise Installation Error on CentOS7

2015-12-07 Thread Martin Alfke
Hi Nikhil,

please paste the log file (/var/opt/puppetlabs/puppetserver/puppetserver.log) 
into gist (not a screenshot).
http://gist.github.com/

I assume that the error is at the end of the file.

Did you run the journalctl -xn command (like mentioned in the output)?
The error log snippet you have pasted indicates, that you can not reach 
official cents mirrors.
Has your VM access to the internet? Can you run ‘yum update’ successfully on 
the machine?

Best,
Martin


On 06 Dec 2015, at 00:27, Nikhil Rao  wrote:

> 
> 
> On Saturday, 5 December 2015 11:58:58 UTC-5, Nikhil Rao wrote:
> I tried to install puppet enterprise from puppet master and while selecting 
> monolithic installation and setting upto 500 nodes and setting up the DNS 
> name and the alias name and encountered an error WARNING 1: set 2 CPU cores 
> instead of 4 CPU cores WARNING 2: set at-least 100GB space in /Opt folder. 
> And i ended up in the following error "Error: Could not start 
> Service[pe-puppetserver]: Execution of '/bin/systemctl start pe-puppetserver' 
> returned 1: Job for pe-puppetserver.service failed. See 'systemctl status 
> pe-puppetserver.service' and 'journalctl -xn' for details. Error: 
> /Stage[main]/Puppetenterprise::Master::Puppetserver/Service[pe-puppetserver]/ensure:
>  change from stopped to running failed: Could not start 
> Service[pe-puppetserver]: Execution of '/bin/systemctl start pe-puppetserver' 
> returned 1: Job for pe-puppetserver.service failed. See 'systemctl status 
> pe-puppetserver.service' and 'journalctl -xn' for details."
> What should i change in my vmware settings Please advice
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> I have posted the log file and the error is as follows . But couldnt decode 
> what the exact error is ... Please can you advice on what the issue is  
> exactly and i have changed the Cores and it didnt throw a warning. But still 
> stuck at pe-puppetserver
> 
>  
> 
> -- 
> 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/649da43e-a615-41b6-bd35-bdf4e18d18f1%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/E08A92A8-4FF8-4760-94D7-BCC4553CE810%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet Enterprise Installation Error on CentOS7

2015-12-05 Thread Martin Alfke
Hi,

On 05 Dec 2015, at 04:16, Nikhil Rao  wrote:

> I tried to install puppet enterprise from puppet master and while selecting 
> monolithic installation and setting upto 500 nodes and setting up the DNS 
> name and the alias name and encountered an error WARNING 1: set 2 CPU cores 
> instead of 4 CPU cores WARNING 2: set at-least 100GB space in /Opt folder. 
> And i ended up in the following error "Error: Could not start 
> Service[pe-puppetserver]: Execution of '/bin/systemctl start pe-puppetserver' 
> returned 1: Job for pe-puppetserver.service failed. See 'systemctl status 
> pe-puppetserver.service' and 'journalctl -xn' for details. Error: 
> /Stage[main]/Puppetenterprise::Master::Puppetserver/Service[pe-puppetserver]/ensure:
>  change from stopped to running failed: Could not start 
> Service[pe-puppetserver]: Execution of '/bin/systemctl start pe-puppetserver' 
> returned 1: Job for pe-puppetserver.service failed. See 'systemctl status 
> pe-puppetserver.service' and 'journalctl -xn' for details."
> What should i change in my vmware settings Please advice

Like the installer mentions: your PE Master should have 2-4 cores minimum.

First guess: RAM
PE has several java applications running:
- puppetserver
- puppetdb
- node classifier
A properly sized PE Master should have 6-8 GB RAM.

Second guess:
do you have selinux enabled?
Is a local firewall running?

You might want to check the PE puppet server log file 
(/var/log/puppetlabs/puppetserver/puppetserver.log)

Best,
Martin


> 
> 
> 
> 
> 
> 
> 
> 
> -- 
> 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/d5eba3de-c3db-4b11-86db-62ba2c6cd3d7%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/833DF413-9370-48E1-AAE1-C2B99935DE2E%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppet open-source and Mac client

2015-12-02 Thread Martin Alfke
Hi,

On 02 Dec 2015, at 17:12, John Oliver  wrote:

> I have puppet-server 3.8.3 and am working on making that go with a Mac 
> running 10.10.5 "Mavericks".  I installed puppet-agent-1.2.6-1.osx10.10.dmg  
> When I run 'puppet agent --test' on the Mac, I get:

Puppet-agent is Puppet 4. You either need to install the same puppet agent 
version as the master or upgrade your master.
Installation notes for Puppet 3.8 on OS X can be found here:
https://docs.puppetlabs.com/puppet/3.8/reference/install_osx.html

Packages are here: 
http://downloads.puppetlabs.com/mac/?_ga=1.239383939.1830287848.1420469550

> 
> Error: Could not request certificate: Error 400 on SERVER: The environment 
> must be purely alphanumeric, not 'puppet-ca'
> 
> Googling that puzzler quickly suggested a client version of puppet that's 
> higher than the master.  I had looked into this before, and 
> https://docs.puppetlabs.com/puppet/latest/reference/about_agent.html suggests 
> that there is no puppet agent that will work with open source puppet.  Please 
> tell me that isn't the case!
> 
> -- 
> 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/6d55911f-2fdb-4f80-a69d-0f9f6890%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/C431B133-8A24-4298-A5F5-2D7AA9C2F328%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-11-30 Thread Martin Alfke
Hi Francois,

On 30 Nov 2015, at 05:09, Francois 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. The class ::moda has a parameter "param" with
> the default value defined in the code of "./moda/functions/data.pp". The
> module modb depends on the module moda (the dependency is indicated in
> ./modb/metadata.json) and the class ::modb have the parameter "param" too.
> 
> I would like to define the default value of the parameter ::modb::param
> to ensure that it is equal to the value of ::moda::param, ie I would like
> to have this:
> 
> a) If the value of ::moda::param is defined in hiera or in environment.conf
> with "moda::param: ", then the default value of ::modb::param is  too.

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.

> 
> b) If the value of ::moda::param is not defined at all (in hiera, in 
> environment.conf
> etc.), then the default value of ::modb::param is moda::data()['moda::param’].

same pattern, just set the default accordingly.

Best,
Martin

> 
> Is there a proper way to do that with Puppet 4?
> Thanks in advance for your help.
> 
> 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/565BCBE4.9090008%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/55CA02DC-7CB3-41DE-8BA3-205AD3742783%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Still mud-wrestling with spec testing

2015-11-28 Thread Martin Alfke
I assume you have Rakefile, spec/spec_helper.rb and .fixtures.yml in place as 
well?

On 27 Nov 2015, at 21:23, Peter Berghold  wrote:

> So, 
> 
> Now that my schedule has some slack in it I've turned my attention back to 
> doing spec testing of my Puppet modules.  Taking a really really simple 
> module that I wrote as an example I started in again.
> 
> Here is the one and only file making up the class.  
> 
> -- init.pp --
> class ntp {
> 
>   package { 'ntp':
> ensure => latest
>   }
>   service { 'ntp':
> ensure  => running,
> enable  => true,
> require => Package[ntp]
>   }
> 
> 
> }
> -
> 
> That should be really easy to run tests against in my opinion.  I wrote a 
> Gemfle for the occasion.
> 
> -Gemfile---
> source 'https://rubygems.org'
> 
> puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : 
> ['>= 3.3']
> gem 'puppet', puppetversion
> gem 'puppetlabs_spec_helper', '>= 0.1.0'
> gem 'puppet-lint', '>= 0.3.2'
> gem 'facter', '>= 1.7.0'
> gem 'rake','>= 0.0.0'
> gem 'spec','>= 0.0.0'
> 
> and my spec file looks like this: 
> 
> --- spec/classes/init_spec.rb ---
> require 'spec_helper'
> describe 'ntp', :type => 'class' do
> 
>   context 'On Debian' do
> let :facts do {
>  :osfamily => 'Debian'
> }
> end
>   
>   it {
> should contain_package('ntp').with({ 'name' =>  'ntp' })
> should contain_service('ntp').with({ 'name' => 'ntp' })
>   }
> end
> 
> end
> ---
> 
> and when I run "rake spec" I get this (severely trimmed) set of errors:
> -errors--
>  1) ntp On Debian should contain Package[ntp] with name => "ntp"
>  Failure/Error: should contain_package('ntp').with({ 'name' =>  'ntp' })
>  
>  ArgumentError:
>wrong number of arguments (2 for 1)
> 
> 
> Looks to me after reading "The Next Generation of Puppet Module Testing"  at 
> this page: 
> https://puppetlabs.com/blog/the-next-generation-of-puppet-module-testing
> there should only be one argument to  "with" so.. if that's not an 
> authoritative page for that information, which one is? 
> 
> Can somebody clarify for me what;s going on here?
> 
> 
> 
> -- 
> 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/CAArvnv0%3DEobRO49%3DhYNuf6D2e2feN4md2rFqmx%2BGySCNByhtCw%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/556A716F-7182-437E-9654-843E8E40B9E6%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] How to enable repositories for forge modules?

2015-11-15 Thread Martin Alfke
Hi Haani,

On 15 Nov 2015, at 06:58, Haani Niyaz  wrote:

> Our SOE document states that all repositories should be disabled by default 
> and enabled on installing a package. So when we write modules our package 
> resource more or less looks like this:
> 
>  package { $package_name:
>  ensure => "${package_version}-${release_version}",
>  install_options => [ {'--disablerepo' => "*"}, { '--enablerepo' => 
> "$releases_repo" } ],
>  notify => Class['::apache::service'],
>  }
> 
> In our base profile (which is included in every role) a module ensures that 
> all repos are disabled. However this has proven to be a problem when using 
> forge modules where it seems to expect the repositories will be enabled by 
> default. 
> 
> One untested suggestion was to use the package resource default statement and 
> set the install option to enable the repositories. Example shown below:
> 
> 
> class profiles::phpwebserver {
> 
>  Package{
>   install_options => [ {'--disablerepo' => "*"}, { '--enablerepo' => "*" } ],
>  }

put this resource default into site.pp
Then the resource default is set globally and not only in class namespace.

Be aware that module developers might set install_options by themselves which 
might overwrite your default setting.

Best,
Martin

-- 
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/57E9CF72-D11B-4637-85E3-E8273B6AD734%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppet agent --tag (and hiera) during Scientific Linux installation

2015-11-11 Thread Martin Alfke

On 10 Nov 2015, at 20:33, Arnau  wrote:

> Hi,
> 
> >
> > I see two possible entry points for your problem:
> >
> > 1. environment specific hiera data
> > according to your hiera.yaml file you have hieradata per environment.
> > can you please cross check that the nagios::client::selinux key is set to 
> > false in all environment default.yaml files.
> 
> The only env where it's defined is the one I'm using.

Maybe that is the reason.
Can you please have a look at the nagios::client code and check whether there 
is a default set for $selinux?

> But, in any case,if I specify the env in command line, puppet should not mix 
> data from other envs, am I wrong?

Data is hiera. Env is puppet code.
When using env in hiera, then data should not get mixed among several 
environments.
> 
> > 2. foreman providing data to modules.
> > check whether you set the selinux parameter for the nagios::client class in 
> > foreman based upon environments.
> Foreman has no parameter defined. Only the env.
OK.
> 
> What really confuses me is the fact that everything wlrks as expected once 
> the node has been rebooted. i must compare facter outputs, and anything else?
The only information the node sends to the master is: facts.
Maybe you can verify whether facts change after the reboot.

> 
> Also, i'll try to remlve all hierarchy entries except defaults.yaml, just to 
> be sure that that's the only file checked.
> 
> I've been trying to download the catalog, with no luck. If the compilation 
> fails, is there any way for downloading it anyway?
> 
> Thanks,
> Arnau
> 
> -- 
> 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/CAM69jx9VhnXR6S2J8uoosWy8bVDBGE27%2BeYSguBaa4z6BSfOiw%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/9D7BBE07-8771-4A95-A33F-11F9BEC43F19%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppet agent --tag (and hiera) during Scientific Linux installation

2015-11-10 Thread Martin Alfke
Hi Arnau,

On 10 Nov 2015, at 14:23, Arnau <listsar...@gmail.com> wrote:

> 
> 
> 2015-11-10 14:39 GMT+01:00 Martin Alfke <tux...@gmail.com>:
> Hi Arnau
> Hi Martin,
>  
> Are your hiera data generic or specific to environments?
> 
> specific to hiera.
>  
> > …
> 
> > * Hiera works and returns the expected values:
> > #  hiera -c /etc/puppet/hiera.yaml -d  classes environment=basic_conf 
> > clientcert=XX
> 
> Here you make use of the ::environment.
> 
> Yes, because the default environment is not "basic_conf" .
> 
>  
> > My kickstart posinstall section runs puppet like:
> > puppet agent --test --tags=kickstart::bootstrap --report --pluginsync 
> > --no-noop
> 
> Here you do not specify the environment.
> 
> I've tried to run the puppet command + --environment=basic_conf inside the 
> kickstart process and it still gives me the error. I should have pasted the 
> complete command and not this one. Sorry.
> 
>  
> The reason why I specify the environment is becasue the default env in the 
> puppet master is not basic_conf. The node env  (AND ONLY NODE ENV) is defined 
> in foreman. (yes, maybe I should have talked about foreman before, but, as 
> the same command with/without environment fails, I did not consider that 
> foreman was interefering with my current issue).

I see two possible entry points for your problem:

1. environment specific hiera data
according to your hiera.yaml file you have hieradata per environment.
can you please cross check that the nagios::client::selinux key is set to false 
in all environment default.yaml files.

2. foreman providing data to modules.
check whether you set the selinux parameter for the nagios::client class in 
foreman based upon environments.


> 
>  
> Can you provide the content and location of your hiera.yaml file?
> 
>  # cat /etc/puppet/hiera.yaml
> ---
> :backend:
>   - yaml
> :hierarchy:
>   - "%{environment}/hieradb/global"
>   - "%{environment}/hieradb/cert/%{clientcert}"
>   - "%{environment}/hieradb/net/%{netlocation}"
>   - "%{environment}/hieradb/location/%{location}"
>   - "%{environment}/hieradb/env/%{environment}"
>   - "%{environment}/hieradb/dist/%{operatingsystem}/%{operatingsystemrelease}"
>   - 
> "%{environment}/hieradb/dist/%{operatingsystem}/%{operatingsystemmajrelease}"
>   - "%{environment}/hieradb/dist/%{operatingsystem}"
>   - "%{environment}/hieradb/dist/%{lsbdistid}/%{lsbdistrelease}"
>   - "%{environment}/hieradb/dist/%{lsbdistid}/%{lsbmajdistrelease}"
>   - "%{environment}/hieradb/dist/%{lsbdistid}"
>   - "%{environment}/hieradb/defaults"
> 
> :yaml:
>   :datadir: "/var/lib/puppet-deploy/XX-environments"
> 
> 
> 
> 
> Best,
> Martin
>  
> Cheers,
> Arnau
> 
> -- 
> 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/CAM69jx-JRhRtHhrSo92nW%3DgkQE4Sw7G1RVhnvh-JOjx8%2BX6axA%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/C3112600-AAB0-4E9F-8185-69171373D824%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Testing yaml files being passed as parameters using rspec-puppet

2015-11-10 Thread Martin Alfke
Hi,
On 06 Nov 2015, at 14:38, choffee  wrote:

> I have a define which takes a yaml file as a parameter and want to check that 
> my template creates valid yaml.
> 
> I am currently using regexp to test bits of it like so
> 
>   should contain_mydefine('foo').with_yaml_content(/---\s+-part1/m)

You can directly access the content attribute:

content = catalogue.resource(‘mydefine', ‘foo').send(:parameters)[:content]

Then you can use default spec matchers for checking what is in local variable 
content.
I am unsure how to check for valid yaml.

Best,
Martin



> 
> It would be nice to be able to do
> 
>   should contain_mydefine('foo').with_yaml_content.valid_yaml()
> 
> Is there a simple way to check this?
> 
> As an alternative, if I assign the yaml to a local available is there a way 
> in rspec to check that value?
> 
> Thanks
> 
> 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/79782f5f-f006-4094-a29e-3414ea7ba5c8%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/05756EAC-00D5-4869-AA38-3A27E8DA0404%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppet agent --tag (and hiera) during Scientific Linux installation

2015-11-10 Thread Martin Alfke
Hi Arnau

On 10 Nov 2015, at 13:19, Arnau  wrote:

> …

> in hiera defaults.yaml I've also defined a couple of nagios::client[1] 
> variables (for not including selinux):
> 
> $cat hieradb/defaults.yaml
> [...]
> 
> nagios
> ::client::selinux: 'false'
> 
> nagios
> ::client::selinux_enforced: 'false'
> [...]
> *Default for selinux is true.

Are your hiera data generic or specific to environments?

> …

> * Hiera works and returns the expected values:
> #  hiera -c /etc/puppet/hiera.yaml -d  classes environment=basic_conf 
> clientcert=XX

Here you make use of the ::environment.

> …

> My kickstart posinstall section runs puppet like:
> puppet agent --test --tags=kickstart::bootstrap --report --pluginsync 
> --no-noop 

Here you do not specify the environment.

> 
> I expect puppet to run, not include selinux and ONLY configure ntp
> But it gives me an error (failed catalog) because selinux::audit2allow is an 
> invlaid resource type. (which means that the nagios variables are not picked 
> up from hiera (false)  so selinux is included)
> If I reboot the node, and run the same exact puppet agent line, then puppet 
> runs (no selinux complain) and only NTP class is configured:
> #  /usr/bin/puppet agent --test --environment=basic_cb_conf 
> --tags=kickstart::bootstrap

Here you again use the environment.

Can you provide the content and location of your hiera.yaml file?


Best,
Martin

> …

> So, what are (or could be) the differences between puppet runs inside the 
> kickstart postinstall process and puppet runs outside it?
> Why is hiera ignored?
> 
> [1] (https://forge.puppetlabs.com/thias/nagios)
> 
> TIA,
> 
> -- 
> 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/CAM69jx_uAbfBc1aU0hYUv%3DGfkGu1oTCx%3D1%3DkgS1JUE1ifsxMxQ%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/05700C27-DDB2-49D6-B44B-3E0D12A609B1%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppet-4-able agent for RHEL7 on ppc64?

2015-10-13 Thread Martin Alfke
Hi Marc,

> On 24.09.2015, at 14:54, Marc Haber  wrote:
> 
> Hi,
> 
> I am looking for a puppet agent rpm that can run against a puppet 4
> server (and can use its features) for RHEL 7 on ppc 64. On
> yum.puppetlabs.com, I can only find binaries for agent 1.2.4 (latest
> version) for x86_64 and i386, and the corresponding SRPM directories
> do only have puppetdb and puppetserver src.rpms.

PL released their build chains:
[1] https://github.com/puppetlabs/ezbake 
[2] https://github.com/puppetlabs/packaging 

[3] https://github.com/puppetlabs/vanagon 
.
[4] https://github.com/puppetlabs/vmpooler 

[5] https://tickets.puppetlabs.com/browse/CPR 

[6] http://stahnma.github.io/vanagon/doc/ 



> 
> What can I do to be able to use puppet 4 with my ppc64 LPAR systems?

Maybe you can install ruby and use the puppet4 and facter gems.

Best,
Martin

> 
> Greetings
> Marc
> 
> -- 
> -
> Marc Haber | "I don't trust Computers. They | Mailadresse im Header
> Leimen, Germany|  lose things."Winona Ryder | Fon: *49 6224 1600402
> Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421
> 
> -- 
> 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/20150924125447.GI23456%40torres.zugschlus.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/49D0A8B8-5BFB-4EAB-92D2-DABDFC9F075C%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Confused after system upgrade - F22, Puppet 4.1.0-5

2015-10-08 Thread Martin Alfke
Hi Bret,

On 08 Oct 2015, at 09:08, Bret Wortman  wrote:

> So I upgraded our Puppet server to Fedora 22, which brought with it an 
> upgrade from Puppet 3.8-ish to 4.1.0-5. And as this wasn't expected (I should 
> have read and studied more -- it's definitely my fault), a few things have 
> confused me as I've started reading the Puppetlabs site for 4.1 documentation:
> 
> 1. It says that config files are now under /etc/puppetlabs/puppet, but the 
> RPM says it installed everything to /etc/puppet as always. Which is right?

The PuppetLabs website refers to PL packages.
Maybe Fedora Packages still have everything in /etc/puppet.

> 
> 2. My hiera config, or at least the default .yaml file I set up, isn't being 
> seen -- I suspect this is related to #1, but could something else be to 
> blame? The specific error when running a Puppet 4.1 client against my system 
> (actually, the agent running on the server since this was the first F22 
> upgrade we did) is:
> 
> Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
> Evalutaiton Error: Error while evaluating a Function Call, Could not find 
> data item proxy in any Hiera data file and no default supplied at 
> /path/to/manifests/site.pp:25:10 on node puppetserver.foo.net
> 
> 3. Has Puppetlabs stopped providing RPMs at their yum server? I haven't seen 
> a full set since F20.

The last set of Packages has been made for Fedora 21:
https://docs.puppetlabs.com/puppet/latest/reference/system_requirements.html#fedora

> 
> Thanks,
> 
> 
> Bret Wortman
> 
> 
> -- 
> 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/0e9e133a-1d48-45c3-9a1f-ead296205868%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/3FCC3CBF-B118-4709-B515-2C8F07B4CEC2%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Write arrays to an erb

2015-10-07 Thread Martin Alfke
Hi Sergiu,
On 07 Oct 2015, at 09:12, Sergiu Cornea  wrote:

> Hello guys,
> 
> I am passing 4 arrays in the Hiera file a: {a,b,c} b: {d,e,f} c: {g,h,i} d: 
> {j,k,l} which I am using them in an .erb template. However, when I am trying 
> to run Puppet it is complaining saying that cannot associate the file with 
> that name as it is already declared in a manifest.
> 
> I am using the create_resource function with Puppet 3.7 on Ubuntu 14.04.
> 
> Could someone please help me understand what I am doing wrong?

It would be useful to have the code pasted in gist.
Otherwise it will be difficult to help.

Best,
Martin

> 
> Thank you,
> 
> Regards,
> Sergiu
> 
> This message and its attachments are private and confidential. If you have 
> received this message in error, please notify the sender and remove it and 
> its attachments from your system.
> 
> The University of Westminster is a charity and a company limited by 
> guarantee. Registration number: 977818 England. Registered Office: 309 Regent 
> Street, London W1B 2UW.
> 
> 
> -- 
> 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/f2795f58-5d39-4ff3-9a44-79d2caeeae49%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/5AAB3874-0331-407D-AEDA-B3B568000405%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Ordering agent runs

2015-10-06 Thread Martin Alfke

On 06 Oct 2015, at 11:39, rjl  wrote:

> Hi All,
> I have an odd requirement to contend with. We have puppet clients that have 
> peers. While a catalog is being executed on one client, its peer must not 
> execute its catalog until the other is complete. Each client has only one 
> peer. Has anyone done something similar? I have not yet been able to derive a 
> good solution.
> 
> Scratching my head…

Hi rjl,

you might want to view or attend PuppetConf keynote.
https://puppetlabs.com/introducing-puppet-application-orchestration

Best,
Martin

> 
> Thanks in advance.
> 
> rjl
> 
> -- 
> 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/941fa895-4356-4bb3-bf03-264fee982d5b%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/AD749615-4ABC-429F-8C15-0B22EC6E05C5%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppetserver error: no such file to load -- pg on node puppetmaster1

2015-09-21 Thread Martin Alfke

On 20 Sep 2015, at 18:00, Martin Alfke <tux...@gmail.com> wrote:

> 
> On 19 Sep 2015, at 21:14, rhpuppetu...@gmail.com wrote:
> 
>> Thanks Martin for replying. By the way, i'm following your seminars on 
>> youtube and they are very helpful. The error still persists.
>> 
>> I've tried this earlier but command failed with the following error. 
>> # puppetserver gem install pg --no-ri --no-rdoc
>> Building native extensions. This could take a while...
>> ERROR:  Error installing pg:
>>ERROR: Failed to build gem native extension.
>> 
>>  java -jar /usr/share/puppetserver/puppet-server-release.jar -r 
>> ./siteconf20150919-17955-hjabmk.rb extconf.rb
>> 
>> Error(s) occured while parsing command-line arguments: Unknown option: "-r"
>> 
>> <--- some options >
>> 
>> extconf failed, uncaught signal 1
>> 
>> <--- some output 2 lines —>
> 
> Seems to be a bug.
> I can reproduce this error on Debian 7 with puppetserver 2.1.1
> 
> I have opened a ticket at PuppetLabs: 
> https://tickets.puppetlabs.com/browse/SERVER-905

I love PuppetLabs guys for their fast feedback and detailed descriptions:
Quoting Chris:
"I think this is probably expected behavior; Puppet Server runs JRuby, and 
JRuby doesn't support gems with native extensions. For most of the common gems 
that fall into this category, there is a suitable alternative that does work 
with JRuby. You can find general docs on this subject on the JRuby wiki, here:
https://github.com/jruby/jruby/wiki/C-Extension-Alternatives
It looks like, for pg, they're recommending the 
activerecord-jdbcpostgresql-adapter instead. Maybe that will be sufficient for 
your use case?"

In your case: puppetserver works as expected.
I will close the ticket with PL.

> 
>> 
>> =
>> 
>> 
>> On Friday, September 18, 2015 at 1:51:44 AM UTC-5, Martin Alfke wrote:
>> 
>> On 18 Sep 2015, at 04:08, rhpupp...@gmail.com wrote: 
>> 
>>> Our puppet master used to run using apache passenger stack. We've recently 
>>> migrated from passenger to puppetserver. When i run puppet agent -vt on my 
>>> client, its showing the following error. 
>>> 
>>> Error 400 on server : could not autoload 
>>> puppet/parser/functions/get_location: no such file to load -- pg on node 
>>> puppetmaster1 
>>> 
>>> puppet master --version : 3.7.5 
>>> ruby --version : 1.8.7 patch level 374-2 
>>> - 
>>> #cat puppet/parser/functions/get_location.rb 
>>> require 'rubygems' 
>>> require 'pg' 
>>> require ‘resolv' 
>> 
>> It seems as if you are missing the pg ruby gem within puppet server: 
>> sudo puppetserver gem install pg --no-ri --no-rdoc 
>> see: 
>> https://github.com/puppetlabs/puppet-server/blob/master/documentation/gems.markdown
>>  
>> 
>> Best, 
>> Martin 
>> 
>>> 
>>> module Puppet::Parser::Funtions 
>>> 
>>> xx 
>>> - 
>>> 
>>> I would appreciate if someone help me fixing this issue. 
>>> 
>>> 
>>> -- 
>>> 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...@googlegroups.com. 
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/puppet-users/e86265cf-cf4b-4b92-9657-64d5137adf59%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/bba04c2b-a309-4219-8a40-d381a7554be7%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/5B0F9E3D-E75B-42D2-9963-C8D9F2A59EB9%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppetserver error: no such file to load -- pg on node puppetmaster1

2015-09-20 Thread Martin Alfke

On 19 Sep 2015, at 21:14, rhpuppetu...@gmail.com wrote:

> Thanks Martin for replying. By the way, i'm following your seminars on 
> youtube and they are very helpful. The error still persists.
> 
> I've tried this earlier but command failed with the following error. 
> # puppetserver gem install pg --no-ri --no-rdoc
> Building native extensions. This could take a while...
> ERROR:  Error installing pg:
> ERROR: Failed to build gem native extension.
> 
>   java -jar /usr/share/puppetserver/puppet-server-release.jar -r 
> ./siteconf20150919-17955-hjabmk.rb extconf.rb
> 
> Error(s) occured while parsing command-line arguments: Unknown option: "-r"
> 
> <--- some options >
> 
> extconf failed, uncaught signal 1
> 
> <--- some output 2 lines —>

Seems to be a bug.
I can reproduce this error on Debian 7 with puppetserver 2.1.1

I have opened a ticket at PuppetLabs: 
https://tickets.puppetlabs.com/browse/SERVER-905

> 
> =====
> 
> 
> On Friday, September 18, 2015 at 1:51:44 AM UTC-5, Martin Alfke wrote:
> 
> On 18 Sep 2015, at 04:08, rhpupp...@gmail.com wrote: 
> 
> > Our puppet master used to run using apache passenger stack. We've recently 
> > migrated from passenger to puppetserver. When i run puppet agent -vt on my 
> > client, its showing the following error. 
> > 
> > Error 400 on server : could not autoload 
> > puppet/parser/functions/get_location: no such file to load -- pg on node 
> > puppetmaster1 
> > 
> > puppet master --version : 3.7.5 
> > ruby --version : 1.8.7 patch level 374-2 
> > - 
> > #cat puppet/parser/functions/get_location.rb 
> > require 'rubygems' 
> > require 'pg' 
> > require ‘resolv' 
> 
> It seems as if you are missing the pg ruby gem within puppet server: 
> sudo puppetserver gem install pg --no-ri --no-rdoc 
> see: 
> https://github.com/puppetlabs/puppet-server/blob/master/documentation/gems.markdown
>  
> 
> Best, 
> Martin 
> 
> > 
> > module Puppet::Parser::Funtions 
> > 
> > xx 
> > - 
> > 
> > I would appreciate if someone help me fixing this issue. 
> > 
> > 
> > -- 
> > 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...@googlegroups.com. 
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/puppet-users/e86265cf-cf4b-4b92-9657-64d5137adf59%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/bba04c2b-a309-4219-8a40-d381a7554be7%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/1E5042ED-BE05-4892-92BC-5DBF33B60BB4%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Some environments not working in puppet

2015-09-18 Thread Martin Alfke

On 18 Sep 2015, at 10:53, Vishal Goel <vgoe...@gmail.com> wrote:

> When I kill it and restart the puppetmaster, it is again created. And how do 
> i make sure that only passenger/ruby webrick runs the puppet master?

service puppetmaster will start the ruby process
This is the one you want to disable.

service apache|nginx|httpd will start the passenger rack application.
The web server name depends on
- which web server
- which distribution


> 
> On Friday, September 18, 2015 at 1:40:22 PM UTC+5:30, Martin Alfke wrote:
> 
> On 18 Sep 2015, at 09:49, Vishal Goel <vgo...@gmail.com> wrote: 
> 
> > Yes, I always restart puppetmaster after adding a new environment or doing 
> > any changes in code for that matter. 
> > 
> > Also, below are the two processes that are running on the puppetmaster 
> > (used ps -ef | grep puppet ) 
> > puppet   29247 1  0 12:27 ?00:00:00 Rack: 
> > /usr/share/puppet/rack/puppetmasterd 
> This is the passenger process 
> > 
> >   
> > 
> > puppet   30130 1  0 12:29 ?00:00:05 /usr/bin/ruby1.8 
> > /usr/bin/puppet master 
> This is the ruby webrick process. Kill this one! 
> 
> > 
> > 
> > 
> > Maybe the problem is with them? 
> > 
> > 
> > On Friday, September 18, 2015 at 1:02:48 PM UTC+5:30, Martin Alfke wrote: 
> > 
> > On 18 Sep 2015, at 09:24, Vishal Goel <vgo...@gmail.com> wrote: 
> > 
> > > I am experiencing a very strange error in puppet. I have around 4-5 
> > > environments in my puppet codebase and whenever i add a new environment, 
> > > it doesn't work. Even thought the code of new environment added is almost 
> > > similar, it doesn't work. 
> > 
> > Have you restarted the puppet master process after adding the static 
> > environment? 
> > Maybe you want to have a look at environment path setting in puppet 
> > https://docs.puppetlabs.com/puppet/3.8/reference/environments_configuring.html
> >  
> > 
> > > 
> > > Below is my puppet.conf file: 
> > > 
> > > [main] 
> > > logdir=/var/log/puppet 
> > > vardir=/var/lib/puppet 
> > > ssldir=/var/lib/puppet/ssl 
> > > rundir=/var/run/puppet 
> > > factpath=$vardir/lib/facter 
> > > templatedir=$confdir/templates 
> > > pluginsync=true 
> > > masterport=8141 
> > > 
> > > [master] 
> > > reports = store 
> > > environment_timeout = unlimited 
> > > autosign = true 
> > > 
> > > [newdcdeploy] 
> > > modulepath = $confdir/modules 
> > > manifest = $confdir/environments/newdcdeploy/manifests/site.pp 
> > > 
> > > [newdcalerts] 
> > > modulepath = $confdir/modules 
> > > manifest = $confdir/environments/newdcalerts/manifests/site.pp 
> > > 
> > > So, newdcdeploy is working and newdcalerts is not. And both have exact 
> > > same tree directory and content in files, only the names of environment 
> > > are different. Am I missing something here? 
> > > 
> > > -- 
> > > 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...@googlegroups.com. 
> > > To view this discussion on the web visit 
> > > https://groups.google.com/d/msgid/puppet-users/a11ba4c8-f871-4d76-85fc-99a1948fcc7a%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...@googlegroups.com. 
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/puppet-users/7828482b-22ea-438e-b136-2125193b2f59%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/a31eadf9-c400-4a2c-86e5-848702e78af1%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/C056E1F0-3D1E-4C13-8969-AF35471C8E19%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Some environments not working in puppet

2015-09-18 Thread Martin Alfke

On 18 Sep 2015, at 09:24, Vishal Goel  wrote:

> I am experiencing a very strange error in puppet. I have around 4-5 
> environments in my puppet codebase and whenever i add a new environment, it 
> doesn't work. Even thought the code of new environment added is almost 
> similar, it doesn't work.

Have you restarted the puppet master process after adding the static 
environment?
Maybe you want to have a look at environment path setting in puppet
https://docs.puppetlabs.com/puppet/3.8/reference/environments_configuring.html

> 
> Below is my puppet.conf file:
> 
> [main]
> logdir=/var/log/puppet
> vardir=/var/lib/puppet
> ssldir=/var/lib/puppet/ssl
> rundir=/var/run/puppet
> factpath=$vardir/lib/facter
> templatedir=$confdir/templates
> pluginsync=true
> masterport=8141
> 
> [master]
> reports = store
> environment_timeout = unlimited
> autosign = true
> 
> [newdcdeploy]
> modulepath = $confdir/modules
> manifest = $confdir/environments/newdcdeploy/manifests/site.pp
> 
> [newdcalerts]
> modulepath = $confdir/modules
> manifest = $confdir/environments/newdcalerts/manifests/site.pp
> 
> So, newdcdeploy is working and newdcalerts is not. And both have exact same 
> tree directory and content in files, only the names of environment are 
> different. Am I missing something here?
> 
> -- 
> 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/a11ba4c8-f871-4d76-85fc-99a1948fcc7a%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/7161A8A3-D62C-47A7-9E0B-9BEF83C62D78%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppetserver error: no such file to load -- pg on node puppetmaster1

2015-09-18 Thread Martin Alfke

On 18 Sep 2015, at 04:08, rhpuppetu...@gmail.com wrote:

> Our puppet master used to run using apache passenger stack. We've recently 
> migrated from passenger to puppetserver. When i run puppet agent -vt on my 
> client, its showing the following error. 
> 
> Error 400 on server : could not autoload 
> puppet/parser/functions/get_location: no such file to load -- pg on node 
> puppetmaster1
> 
> puppet master --version : 3.7.5
> ruby --version : 1.8.7 patch level 374-2
> -
> #cat puppet/parser/functions/get_location.rb
> require 'rubygems'
> require 'pg'
> require ‘resolv'

It seems as if you are missing the pg ruby gem within puppet server:
sudo puppetserver gem install pg --no-ri --no-rdoc
see: 
https://github.com/puppetlabs/puppet-server/blob/master/documentation/gems.markdown

Best,
Martin

> 
> module Puppet::Parser::Funtions
> 
> xx
> -
> 
> I would appreciate if someone help me fixing this issue.
> 
> 
> -- 
> 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/e86265cf-cf4b-4b92-9657-64d5137adf59%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/ED4DBBFB-AC4E-4845-9032-4334A50CB318%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Some environments not working in puppet

2015-09-18 Thread Martin Alfke

On 18 Sep 2015, at 09:49, Vishal Goel <vgoe...@gmail.com> wrote:

> Yes, I always restart puppetmaster after adding a new environment or doing 
> any changes in code for that matter.
> 
> Also, below are the two processes that are running on the puppetmaster (used 
> ps -ef | grep puppet )
> puppet   29247 1  0 12:27 ?00:00:00 Rack: 
> /usr/share/puppet/rack/puppetmasterd 
This is the passenger process
>   
> 
> 
> puppet   30130 1  0 12:29 ?00:00:05 /usr/bin/ruby1.8 
> /usr/bin/puppet master
This is the ruby webrick process. Kill this one!

> 
> 
> 
> Maybe the problem is with them?
> 
> 
> On Friday, September 18, 2015 at 1:02:48 PM UTC+5:30, Martin Alfke wrote:
> 
> On 18 Sep 2015, at 09:24, Vishal Goel <vgo...@gmail.com> wrote: 
> 
> > I am experiencing a very strange error in puppet. I have around 4-5 
> > environments in my puppet codebase and whenever i add a new environment, it 
> > doesn't work. Even thought the code of new environment added is almost 
> > similar, it doesn't work. 
> 
> Have you restarted the puppet master process after adding the static 
> environment? 
> Maybe you want to have a look at environment path setting in puppet 
> https://docs.puppetlabs.com/puppet/3.8/reference/environments_configuring.html
>  
> 
> > 
> > Below is my puppet.conf file: 
> > 
> > [main] 
> > logdir=/var/log/puppet 
> > vardir=/var/lib/puppet 
> > ssldir=/var/lib/puppet/ssl 
> > rundir=/var/run/puppet 
> > factpath=$vardir/lib/facter 
> > templatedir=$confdir/templates 
> > pluginsync=true 
> > masterport=8141 
> > 
> > [master] 
> > reports = store 
> > environment_timeout = unlimited 
> > autosign = true 
> > 
> > [newdcdeploy] 
> > modulepath = $confdir/modules 
> > manifest = $confdir/environments/newdcdeploy/manifests/site.pp 
> > 
> > [newdcalerts] 
> > modulepath = $confdir/modules 
> > manifest = $confdir/environments/newdcalerts/manifests/site.pp 
> > 
> > So, newdcdeploy is working and newdcalerts is not. And both have exact same 
> > tree directory and content in files, only the names of environment are 
> > different. Am I missing something here? 
> > 
> > -- 
> > 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...@googlegroups.com. 
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/puppet-users/a11ba4c8-f871-4d76-85fc-99a1948fcc7a%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/7828482b-22ea-438e-b136-2125193b2f59%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/3831C18A-40E1-49D8-AC81-059314910B78%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] params.pp vs Hiera

2015-09-09 Thread Martin Alfke
As a module developer I want to provide a module which will do sane defaults 
without forcing users to hiera.
Module developer (at the moment) put OS and application defaults into params.pp.
As a user you might want to override these defaults and specify them either as 
a parameter or via hiera.

On 09 Sep 2015, at 17:47, Dan White  wrote:

> Your observation is on target. 
> Now consider a module that has to support multiple operating systems, 
> multiple locations, et cetera, ad infinitum. You can either have a whopping 
> huge params.pp file that contains all the logic and possibilities, or you set 
> up Hiera to pick and choose for you, completely outside of your module and, 
> IMNSHO, much easier to maintain.
> 
> On Sep 9, 2015, at 8:45 AM, Sergiu Cornea  
> wrote:
> 
>> Hello guys,
>> 
>> I was wondering if someone can explain the difference between using the 
>> params.pp file and Hiera, as in my opinion they achieve the same thing using 
>> different methods.
>> 
>> For example, in the params.pp file you declare all or almost all the 
>> variables that are going to be used in your module and then call then in 
>> each manifest that you are using them and by using Hiera you declare the 
>> variables as you go in your manifest and set them using the Hiera file for 
>> that node.
>> 
>> Thank you,
>> 
>> Regards,
>> Sergiu
>> 
>> This message and its attachments are private and confidential. If you have 
>> received this message in error, please notify the sender and remove it and 
>> its attachments from your system.
>> 
>> The University of Westminster is a charity and a company limited by 
>> guarantee. Registration number: 977818 England. Registered Office: 309 
>> Regent Street, London W1B 2UW.
>> 
>> 
>> -- 
>> 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/308289d5-90b4-4dfb-b9e8-6afc687fa85a%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/6319666A-A094-45DF-88D5-415188B60A18%40icloud.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/F8CF1CA9-F5CB-4A59-884C-CC03D960C4D1%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Inside a custom function, how can you know if noop is enabled ?

2015-09-06 Thread Martin Alfke
Hi Fred,
On 05 Sep 2015, at 19:36, Frédéric Lespez  wrote:

> Hi,
> 
> Inside a manifest, you can know if noop is enabled thanks to the $clientnoop 
> variable[1].
> But inside a custom function, how can you know it ?

$clientnnop is a fact [1]
You can access facts from functions e.g. by using lookupvar(‘clientnoop’) [2]

[1]https://docs.puppetlabs.com/puppet/latest/reference/lang_facts_and_builtin_vars.html#puppet-agent-facts
[2]https://docs.puppetlabs.com/guides/custom_functions.html#using-facts-and-variables

hth,
Martin

-- 
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/51589416-A845-4087-B160-880A4D41AA13%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] How to set puppet runintervel to neverrun?

2015-08-17 Thread Martin Alfke

On 17 Aug 2015, at 11:38, Ayyanar ayyanar@gmail.com wrote:

 I don't want to fetch the configuration for particular interval.
 
 example default runintervel = 30min.
 I want to never fetch the configuration.
 How to set this value.
 
The “default_runinterval” only has a meaning when you have the puppet agent 
running.
Maybe you want to ensure the service is stopped and removed from run levels?

service { ‘puppet’:
  ensure = stopped,
  enable = false,
}

or: (from defaults.rb):
:runinterval = {
  :default  = 30m,
  :type = :duration,
  :desc = How often puppet agent applies the catalog.
  Note that a runinterval of 0 means \run continuously\ rather than
  \never run.\ If you want puppet agent to never run, you should start
  it with the `--no-client` option. #{AS_DURATION},
},


 -- 
 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/0f170975-28a0-438f-a88f-45684bf54fc8%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/A25F7BBD-B304-407A-A6C7-83BE5216E3D5%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] PuppetDB and Debian Jessie

2015-08-14 Thread Martin Alfke
Hi Oli,

there are a couple of tickets at PL regarding jessie support as puppet server:
https://tickets.puppetlabs.com/browse/CPR-111?jql=text%20~%20%22jessie%22 
https://tickets.puppetlabs.com/browse/CPR-111?jql=text%20~%20%22jessie%22

Unluckily no delivery date has been given so far.

Best,
Martin

 On 14.08.2015, at 10:19, Oliver Schad 
 puppet.oliver.sc...@automatic-server.com wrote:
 
 Hi everybody,
 
 does somebody know when the puppetdb packages will be available to
 build a complete puppet master/server based on Debian Jessie?
 
 Best Regards
 Oli
 
 -- 
 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/20150814101922.7de7f81b%40dickeberta.automatic-server.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/9F2E09F2-0325-4981-B3DF-8B1A5CCDD7E8%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Help with NTP module provided by puppetlabs

2015-08-10 Thread Martin Alfke

On 10 Aug 2015, at 09:54, Eddie Mashayev eddie...@gmail.com wrote:

 Hi Martin, 
 
 Thanks for the help. I used the second approach. 
 
 1) I’ve created custom fact to identify the server location (I’m using the 
 timezone fact) – Now I’m able to identify all my servers by location. 
 2) I’m not sure about the second part “put ntp::servers into the appropriate 
 hiera data hierarchy” – I’m using Foreman and NOT Puppet enterprise if it 
 matters. Can you elaborate more how to implement it right, maybe add some 
 code if possible.

Hiera is not related to Puppet Enterprise.
Hiera is a data backend for automatic parameter lookups.
see http://docs.puppetlabs.com/hiera/latest/

You need to create a hiera.yaml config file.
The config file may look like this:

:backends:
  - yaml
:yaml:
  :datadir: ‘/etc/puppet/data’
:hierachy:
  - “nodes/#{::certname}”
  - “location/#{::timezone}”
  - global

In your hiera data directory you can provide yaml files for hierarchies (you 
don’t have to, but you can!)

/etc/puppet/data/
  - nodes/foo.bar.domain.com.yaml # has host specific parameters
  - location/CEST.yaml # has parameters for CEST timezone
  - location/PDT.yaml# has parameters for PDT timezone systems
  - global.yaml  # has global parameters

Hiera parses the data hierarchy and uses the first match.
To allow dynamic data lookup the variable names from the module have to be 
prefixed with the class name where they are used.
Note: this only works with parameterised classes, not with normal variables 
inside a manifest.

With foreman you should also be able to create a group setting based on 
timezone fact (I don’t have access to foreman right now, so I can not verify).

Best,
Martin

 
 Thanks,
 EddieM
 
 On Sunday, August 9, 2015 at 5:35:07 PM UTC+3, Martin Alfke wrote:
 Hi Eddie, 
 
 On 09 Aug 2015, at 16:25, Eddie Mashayev eddi...@gmail.com wrote: 
 
  Hi All, 
  
  I have many servers spread in 3 different time zones USA (NY and San 
  Francisco) and also in ISR. Have 3 NTP servers, one NTP server in each 
  location. 
  https://forge.puppetlabs.com/puppetlabs/ntp module is letting you to insert 
  an array of NTP servers 
  
  class { '::ntp': 
  servers = [ 'ntp1.corp.com', 'ntp2.corp.com' ], 
  } 
  
  I can override this array but the problem is how to fit the correct NTP 
  server to each server in the different location. 
  In other words, how can I modified the puppet module to fit server to the 
  correct NTP Server by locations. 
  
  For example - I thought using the server prefix name to choose the right 
  NTP server, for example if this server is located in NY so it prefix name 
  is ny-{server name} so I can fit it to NY NTP server but it look like a 
  headache to do it. 
  
  Do you have any idea how can it be done in most efficient way with the NTP 
  module provided by puppetlabs. 
 
 Several solutions: 
 
 1. write wrapper module per data center: 
 
 class ny_ntp { 
   class { ‘::ntp’: 
 server = [‘ny_ntp.corp.com’], 
   } 
 } 
 
 class sf_ntp { 
   class { ‘::ntp’: 
 servers = [‘sf_ntp.corp.com’], 
   } 
 } 
 
 class isr_ntp { 
   class { ‘::ntp’: 
servers = [‘isr_ntp.corp.com’], 
   } 
 } 
 
 use one of the the wrapper class within node classification 
 
 2. use hiera 
 
 provide a custom fact to identify location per server and put ntp::servers 
 into the appropriate hiera data hierarchy. 
 
 Best, 
 Martin 
 
 
  
  
  Thanks, 
  EddieM 
  
  -- 
  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...@googlegroups.com. 
  To view this discussion on the web visit 
  https://groups.google.com/d/msgid/puppet-users/8cdf1ae0-46c8-4de6-bb06-9f42bdbd31ed%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/d7398ad5-9b31-42e5-b3ee-d1eb889a8356%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/DD001BB3-D530-4509-AFDE-051381F58E29%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Help with NTP module provided by puppetlabs

2015-08-09 Thread Martin Alfke
Hi Eddie,

On 09 Aug 2015, at 16:25, Eddie Mashayev eddie...@gmail.com wrote:

 Hi All, 
 
 I have many servers spread in 3 different time zones USA (NY and San 
 Francisco) and also in ISR. Have 3 NTP servers, one NTP server in each 
 location. 
 https://forge.puppetlabs.com/puppetlabs/ntp module is letting you to insert 
 an array of NTP servers 
 
 class { '::ntp': 
 servers = [ 'ntp1.corp.com', 'ntp2.corp.com' ], 
 } 
 
 I can override this array but the problem is how to fit the correct NTP 
 server to each server in the different location. 
 In other words, how can I modified the puppet module to fit server to the 
 correct NTP Server by locations. 
 
 For example - I thought using the server prefix name to choose the right NTP 
 server, for example if this server is located in NY so it prefix name is 
 ny-{server name} so I can fit it to NY NTP server but it look like a headache 
 to do it. 
 
 Do you have any idea how can it be done in most efficient way with the NTP 
 module provided by puppetlabs. 

Several solutions:

1. write wrapper module per data center:

class ny_ntp {
  class { ‘::ntp’:
server = [‘ny_ntp.corp.com’],
  }
}

class sf_ntp {
  class { ‘::ntp’:
servers = [‘sf_ntp.corp.com’],
  }
}

class isr_ntp {
  class { ‘::ntp’:
   servers = [‘isr_ntp.corp.com’],
  }
}

use one of the the wrapper class within node classification

2. use hiera

provide a custom fact to identify location per server and put ntp::servers into 
the appropriate hiera data hierarchy.

Best,
Martin


 
 
 Thanks,
 EddieM
 
 -- 
 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/8cdf1ae0-46c8-4de6-bb06-9f42bdbd31ed%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/0CB6F615-A45C-408F-90B2-CCAEB9FCBC01%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] How to define own data types in Puppet 4?

2015-08-06 Thread Martin Alfke
Hi,

is there the possibility in Puppet 4 to provide own data types.

e.g. 
Fullpath $path

instead of
Regexp[/\/.*/] $path
or
Pattern[/\/.*/] $path

thanks,
Martin

-- 
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/EF3326F0-2196-4E49-A9E3-EECA66E5ADF9%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet Module spec testing

2015-08-05 Thread Martin Alfke
Hi Peter,
On 04 Aug 2015, at 21:37, Peter Berghold salty.cowd...@gmail.com wrote:

 Is there a newer set of documents on doing Spec testing of Puppet modules 
 than this link?  
 https://puppetlabs.com/blog/the-next-generation-of-puppet-module-testing
 
 I am running into a brick wall getting this to work so I have to assume I'm 
 doing something wrong…

This should still be valid documentation.
It only refers to unit testing.
For acceptance testing you should take a look on beaker.

hth,
Martin

-- 
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/E4C768F5-D6FC-4618-89F1-7882E81DCE33%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] How to make file_line autocreate files?

2015-08-04 Thread Martin Alfke
Hi,
On 04 Aug 2015, at 12:24, Arnaud Gomes-do-Vale arn...@glou.org wrote:

 Hello,
 
 I am trying to manage my dsh groups with Puppet. The way I'm trying to
 do this:
 
 - each node has a block like this in its manifest:
 
  @@file_line { ${::fqdn} in dsh group ${group}:
line = $::fqdn,
path = /etc/dsh/group/${group},
tag  = 'dsh',
  }
 
 - each dsh client collects those File_line resources.
 
  File_line | tag == 'dsh' |
 
 Of course, this fails:
 
 Error: /Stage[main]/Dsh::Client/File_line[my.host in dsh group mygroup]: 
 Could not evaluate: No such file or directory - /etc/dsh/group/mygroup
 
 I can't manage every file in /etc/dsh/group/ explicitely, as the list is
 not fixed (basically I want to create whatever group nodes register
 themselves in).
 
 How would you do this kind of thing? Modifying the file_line provider is
 probably the easiest way (basically, you just have to change method
 lines to return an empty list if the file does not exist), but I'm not
 sure of the possible side effects.

You could do the following:

@@file { “/etc/dsh/group/${group}”:
ensure = file,
tag = ‘dsh’,
}
@@file_line { ${::fqdn} in dsh group ${group}”:
line = $::fqdn,
path = /etc/dsh/group/${group}”,
tag  = 'dsh’,
}
File || tag == ‘ssh’ | - File_line | tag == 'dsh' |

This creates files when required and takes care on the content with file_line

hth,
Martin

 
 -- 
 Arnaud
 
 -- 
 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/87egjj8i7u.fsf%40ymagis.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/71C27D84-616B-4991-B602-7A310DF8E269%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] String/Float comparison - Puppet and Facter

2015-08-04 Thread Martin Alfke

On 04 Aug 2015, at 00:39, Mike Reed mjohn.r...@gmail.com wrote:

 Hello all,
 
 I've been trying to solve what seems to be a simple problem but have yet to 
 find the answer.  
 
 I'm trying to do a comparison between the value of a fact and some arbitrary 
 value:
 
 if ($::class == 'workstation') and ($::kernelmajversion = '3.11') {

You compare two strings.
Have you tried versioncmp function instead?
versioncmp($::kernelmajversion, ‘3.11’)

https://docs.puppetlabs.com/references/latest/function.html#versioncmp


 notify {My Kernel version is = ${kernel_test_version} and I'm going to 
 upgrade : }
 
 file { 
 /usr/src/linux-headers-${kernel_test_version}_${kernel_release_test_version}~precise1_all.deb
  :
   mode   = '755',
   ensure = 'present',
   source = 
 puppet:///modules/kernel/${kernel_test_version}_${kernel_release_test_version}~precise1_all.deb
  }
   }
   
   elsif ($::class == 'workstation') and ($::kernelmajversion = '3.11') {
 notify {My Kernel version is = ${kernel_test_version} so I don't need 
 to upgrade: }
   }
 
 
 After invoking a puppet run, I can never get the evaluation of if to 
 actually take place and as a result, the elsif is invoked and regardless of 
 whether or not the kernel version is = 3.11, the if statement is never 
 run.  From what I gather, this means that the evaluation of if is never 
 happening and the resulting elsif is automatically invoked.
 
 I've also seen some errors that pertain to string/float comparisons and to my 
 knowledge, facter data is coming back as a string and my version number in 
 the if statement (3.11) is a float and therefore can't be compared due to 
 comparison rules of different data types.
 
 Does anybody have some words of wisdom that may lead me to the correct syntax 
 for what I'm trying to achieve?
 
 Thanks in advance to the community for the help.
 
 Cheers,
 
 Mike
 
 
 
 -- 
 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/5f9249a2-1bab-4f7e-84b5-f5fa6afd3ad7%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/9800277A-848F-4303-9C5E-E155EBAB918E%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] How to make file_line autocreate files?

2015-08-04 Thread Martin Alfke

On 04 Aug 2015, at 13:30, Arnaud Gomes-do-Vale arn...@glou.org wrote:

 Martin Alfke tux...@gmail.com writes:
 
 @@file { “/etc/dsh/group/${group}”:
ensure = file,
tag = ‘dsh’,
 }
 File || tag == ‘ssh’ | - File_line | tag == 'dsh' |
 
 This creates files when required and takes care on the content with file_line
 
 Error: Could not retrieve catalog from remote server: Error 400 on SERVER: A 
 duplicate resource was found while collecting exported resources, with the 
 type and title File[/etc/dsh/group/mobius-backoffice] on node 
 access.syltest.ymagis.com
 
 I hadn't even tried it, but this is what I expected.

Ah. You are exporting on all nodes and you collect only on clients…
Seems as if you have multiple hosts within same group - which makes sense.
In this case it is not good to export the group file on the nodes.

Maybe you can do the following ( I am unsure whether the if ! defined will be 
validated properly on the client):

On the servers:

define dhs_group (
  $group
){
  if !defined(File[“/etc/dsh/group/${group}”]) {
file { “/etc/dhs/group/${group}”:
  ensure = file,
  tag = ‘dsh’,
}
file_line { “${title} in dsh group ${group}:
  line = $title,
  path = /etc/dsh/group/${group},
  tag  = 'dsh',
}
  }
}

@@dsh_group { $::fqdn:
  group = $group,
  tag = ‘dsh’,
}

On the Client:

Dsh_group  | tag == ‘ssh’ |


 
 -- 
 Arnaud
 
 -- 
 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/87wpxb70kp.fsf%40ymagis.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/99A4DF94-2E11-48AF-91D3-2D11FA8673D2%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet noop and Rsync

2015-08-04 Thread Martin Alfke
Hi,
On 04 Aug 2015, at 10:26, Sergiu Cornea s.cor...@my.westminster.ac.uk wrote:

 Good morning guys,
 
 When I am running Puppet in noop shouldn't Rsync do a dry-run in order to 
 show me what files have changed or if they are the same?

—noop refers to the agent only.
Everything else takes place as normal action:
- pluginsync
- storing exported resources
- compiling catalog

It is only the agent that checks for differences within catalog and the actual 
system and showing them instead of applying changes.

hth,
Martin

 
 Or I am missing something?
 
 Thank you,
 
 Regards,
 Sergiu
 
 This message and its attachments are private and confidential. If you have 
 received this message in error, please notify the sender and remove it and 
 its attachments from your system.
 
 The University of Westminster is a charity and a company limited by 
 guarantee. Registration number: 977818 England. Registered Office: 309 Regent 
 Street, London W1B 2UW.
 
 
 -- 
 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/90beeac3-a06c-461f-a4b7-3fab1132525d%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/0AE595FF-0393-44C1-91F2-9F731A9DC6CA%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Method to automatically/remotly clear out sign certificates

2015-07-15 Thread Martin Alfke
Hi Grant,

On 14 Jul 2015, at 20:03, Grant Schoep matobin...@gmail.com wrote:

 Using Puppet 3.6 now, but will be upgrading to 3.8 shortly. All running on 
 CentOS 7
 
 So I am setting up a small network to be used in testing application 
 deploys/OS.  The idea is basically this.
 
 1. Build out a new VM(based off Puppet classes).
 2. Install software
 3. Test that software
 4. Blow away VM
 
 So I have self signing turned on, so when the machine first installs and runs 
 puppet for the first time, it applies everything we want. All these steps is 
 happening automatically Which is why I have self signing turned on in this 
 case.
 
 Now, the only hiccup, is that in this procedure, the ONE manual step I have, 
 is that I need to go onto the puppetCA server, and run a puppet cert clean 
 hostname
 Shortly this is going to be a real pain, as there will be a bunch more manual 
 machines. Short of setting  up a cron job, or using ssh'keys...
 
 Is there a built in way to tell the PuppetCA server to just accept newly 
 generate keys... and clean the old one I guess this is sorta bypassing 
 the whole idea of signed keys, but then I have self signing turn on anyways...
 
 If not, I'll probably just write a simple RESTful app that sits on teh 
 PuppetCA server, that I can curl to to tell it to remove the old host key. 
 I need to do things like that anyways in the building of of the VMs.

No need to do this. Puppet has a REST API built in.
You need to allow a remote system access to certificates via auth.conf
http://projects.puppetlabs.com/projects/1/wiki/Certificate_Authority_Rest_API
https://docs.puppetlabs.com/puppet/latest/reference/http_api/http_certificate.html

Best,
Martin

 
 
 
 
 
 
 
 
 -- 
 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/3dda1ebb-e4c8-4fe7-b997-585475cf48f3%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/5CE8ADA2-E1DB-40BA-973B-1B8817DE099B%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] where is PC1 for Debian Jessie?

2015-07-06 Thread Martin Alfke
Hi Felix,

seems as if Jessie is missing the apt-sources.
Remove the sources line from /etc/apt/sources.list.d/filename
and rerun apt-get update

best,
Martin

On 06 Jul 2015, at 01:37, Felix Frank felix.fr...@alumni.tu-berlin.de wrote:

 Hi,
 
 has anyone tried the PC1 on jessie yet? I just did the following:
 
 wget http://apt.puppetlabs.com/puppetlabs-release-pc1-jessie.deb
 dpkg -i puppetlabs-release-pc1-jessie.deb
 apt-get update
 
 but I get
 
 ...
 W: Failed to fetch http://apt.puppetlabs.com/dists/jessie/Release 
 Unable to find expected entry 'PC1/source/Sources' in Release file
 (Wrong sources.list entry or malformed file)
 
 No puppetlabs packages come available to apt.
 
 Thanks,
 Felix
 
 On 06/09/2015 10:30 PM, Kylo Ginsberg wrote:
 Hey all,
 
 We're planning to release the next puppet-agent drop on June 22nd and
 that should include Jessie packages/repos.
 
 Meanwhile, you can grab jessie packages from our nightly builds, e.g.
 
 http://nightlies.puppetlabs.com/puppet-agent/3a6740a0753b6fb20d27e45071eedc29dd8b436c/repos/deb/jessie/PC1/puppet-agent_1.1.0.170.g3a6740a-1jessie_amd64.deb
 
 Builds only promote to nightly if they pass CI, but these are
 nightlies, so standard caveats apply.
 
 Thanks,
 Kylo
 
 -- 
 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/5599BFB7.5090808%40Alumni.TU-Berlin.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/7EE67E94-8478-407F-9CC3-26D8F134536E%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] How to execute multiple script in puppet using bashrc file sourced.

2015-07-02 Thread Martin Alfke
Hi,
On 02 Jul 2015, at 10:29, Ayyanar ayyanar@gmail.com wrote:

 1. I am executing  two shell script in puppet agent. 
 2. In first shell script setting env variable in bashrc file. example export  
 JAVA_HOME=/opt/jdk1.8.0_45   bashrc file and i sourced bashrc file.

Do not do this via an exec. Have you taken a look on file_line (from std lib) 
or the inifile module from PuppetLabs?
https://forge.puppetlabs.com/puppetlabs/stdlib
https://forge.puppetlabs.com/puppetlabs/inifile

 3.In second shell script changing  permission for JAVA_HOME. The permission 
 is not changed. Once i LogIn and LogOut in agent then i ran second  script 
 now the permission was changed.

What kind of permission are you going to change?
Permission on the directory?
Please use the file resource type for managing directories.

 
 How to change permission without logout in agent Or Tell me some solution to 
 run multiple script and reflect env variable in puppet.

I suppose that you expect from second shell script that it uses standard 
environment.
This is not true. Puppet Exec resource type uses an empty environment.

hth,
Martin

 
 -- 
 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/d3c4cc3f-d489-4d46-bfa7-9437e394970d%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/D8E5B3AA-9454-4A7B-A971-76B8AF0FE963%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] permission denied on files

2015-06-17 Thread Martin Alfke
Hi Tim,

the agent wants to fetch the file
 puppet:///modules/bacula/monitor1/monitor1.mydomain.com.crt

But on the Master you are shooing us a file with the name:
 environments/production/modules/bacula/files/monitor1:
 total 8.0K
 -rw-r--r--. 1 puppet puppet 2.0K Jun 16 21:53 monitor1.jokefire.com.crt
 -rw-r--r--. 1 puppet puppet 3.2K Jun 16 21:53 monitor1.jokefire.com.key

mydomain.com - jokefire.com

Is this copy-n-paste or does the filename and the source name not match?

Best,
Martin


On 17 Jun 2015, at 04:20, Tim Dunphy bluethu...@gmail.com wrote:

 Hi all,
 
  I've setup a puppet module to install and keep the bacula backup system 
 running on a number of systems. 
 
 
 Part of the formula I've come up with is to transfer an SSL cert/key pair to 
 each host that uses the module. So that bacula can work over TLS. 
 
  I have this defined in my bacula config manifest:
 
 file { /etc/pki/tls/private/${::hostname}.mydomain.com.key:
   notify  = Service[bacula-fd],
   owner = bacula,
   group = bacula,
   mode = 0400,
   require = Package[bacula-client,bacula-common],
   source = 
 puppet:///modules/bacula/${::hostname}/${::hostname}.mydomain.com.key,
 
  }
 
 file { /etc/pki/tls/certs/${::hostname}.mydomain.com.crt:
   notify  = Service[bacula-fd],
   owner = bacula,
   group = bacula,
   mode = 0400,
   require = Package[bacula-client,bacula-common],
   source = 
 puppet:///modules/bacula/${::hostname}/${::hostname}.mydomain.com.crt,
 
  }
 
 
 
 This has been working perfectly fine for a while now. But only on SOME hosts 
 that were recently added I'm getting permission denied errors on the keypairs 
 that I'm trying to send over. 
 
 
 Error: 
 /Stage[main]/Bacula::Config/File[/etc/pki/tls/certs/monitor1.mydomain.com.crt]:
  Could not evaluate: Could not retrieve information from environment 
 production source(s) 
 puppet:///modules/bacula/monitor1/monitor1.mydomain.com.crt
 Error: 
 /Stage[main]/Bacula::Config/File[/etc/pki/tls/private/monitor1.mydomain.com.key]:
  Could not evaluate: Could not retrieve information from environment 
 production source(s) 
 puppet:///modules/bacula/monitor1/monitor1.mydomain.com.key
 
 And this is the weird part! All of the directories that I'm transferring keys 
 and certs from have identical ownership and permissions for both the working 
 and the non working hosts!
 
 This is a directory listing of certs and keys that does NOT work:
 
 environments/production/modules/bacula/files/monitor1:
 total 8.0K
 -rw-r--r--. 1 puppet puppet 2.0K Jun 16 21:53 monitor1.jokefire.com.crt
 -rw-r--r--. 1 puppet puppet 3.2K Jun 16 21:53 monitor1.jokefire.com.key
 
 
 And this is a listing from a directory containing certs and keys that DOES 
 work:
 
 environments/production/modules/bacula/files/logs:
 total 8.0K
 -rw-r--r--. 1 puppet puppet 1.9K Apr 23 22:14 logs.jokefire.com.crt
 -rw-r--r--. 1 puppet puppet 3.2K Apr 23 22:14 logs.jokefire.com.key
 
 And these are permissions on the directories themselves:
 
 drwxr-xr-x. 2 puppet puppet 62 Jun 16 22:13 
 environments/production/modules/bacula/files/logs
 drwxr-xr-x. 2 puppet puppet 70 Jun 16 22:14 
 environments/production/modules/bacula/files/monitor1
 
 Trouble is I can tell no difference between the working and non working 
 directories. 
 
 If I run puppet  with the bacula module on the monitor1 host, I get the 
 error. If I run puppet with the bacula module on the logs host, everything 
 works fine!
 
 I'm just wondering what I may be missing that could get rid of that error!
 
 Thanks,
 Tim
 -- 
 GPG me!!
 
 gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
 
 
 -- 
 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/CAOZy0ekwcGN%2B609_K0pS6-zm%2B5tEpCpqkx_LHHmrhCk0cb-MsQ%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/487BF260-444D-4985-A118-FA20095A8CB2%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Facter throwing MySQL errors

2015-05-29 Thread Martin Alfke
Have you tried running facter -p
This will also pull the pluginsynced facts.

(I am unsure which version has puppet facter)


On 29 May 2015, at 11:21, Jonathan Gazeley jonathan.gaze...@bristol.ac.uk 
wrote:

 Hi folks,
 
 Since upgrading to Puppet 3.8.1 my Facter (2.4.4) has been throwing this 
 error every run:
 
 [jg4461@webdev-ispms ~]$ facter
 ERROR 2002 (HY000): Can't connect to local MySQL server through socket 
 '/var/lib/mysql/mysql.sock' (2)
 ERROR 2002 (HY000): Can't connect to local MySQL server through socket 
 '/var/lib/mysql/mysql.sock' (2)
 
 I initially assumed it was a bad custom fact but none of them attempt to 
 connect to MySQL. When running facts individually, it's mostly the built-in 
 Puppet facts that throw this error, including facts like $::disks and 
 $::memoryfree.
 
 I can't figure out what is causing the problem. Any clues?
 
 Thanks,
 Jonathan
 
 -- 
 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/55682F86.8010808%40bristol.ac.uk.
 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/1D7A3F0C-C0D7-4983-A948-CEF06ADA6857%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Facter throwing MySQL errors

2015-05-29 Thread Martin Alfke
Try facter -p —debug or even facter -p —debug —trace to identify the broken 
fact which does the mysql connection.

hth,

Martin

On 29 May 2015, at 13:51, Jonathan Gazeley jonathan.gaze...@bristol.ac.uk 
wrote:

 Yes, I tried running facter -p and it produces the same error. The same error 
 also crops up when puppet or mcollective execute facter too.
 
 Thanks,
 Jonathan
 
 
 On 29/05/15 12:25, Martin Alfke wrote:
 Have you tried running facter -p
 This will also pull the pluginsynced facts.
 
 (I am unsure which version has puppet facter)
 
 
 On 29 May 2015, at 11:21, Jonathan Gazeley jonathan.gaze...@bristol.ac.uk 
 wrote:
 
 Hi folks,
 
 Since upgrading to Puppet 3.8.1 my Facter (2.4.4) has been throwing this 
 error every run:
 
 [jg4461@webdev-ispms ~]$ facter
 ERROR 2002 (HY000): Can't connect to local MySQL server through socket 
 '/var/lib/mysql/mysql.sock' (2)
 ERROR 2002 (HY000): Can't connect to local MySQL server through socket 
 '/var/lib/mysql/mysql.sock' (2)
 
 I initially assumed it was a bad custom fact but none of them attempt to 
 connect to MySQL. When running facts individually, it's mostly the built-in 
 Puppet facts that throw this error, including facts like $::disks and 
 $::memoryfree.
 
 I can't figure out what is causing the problem. Any clues?
 
 Thanks,
 Jonathan
 
 -- 
 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/55682F86.8010808%40bristol.ac.uk.
 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/556852A6.7020704%40bristol.ac.uk.
 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/C88490DF-D2E4-4B2C-9797-BE10BEE0D90E%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Fresh Puppet PE 3.8 install error

2015-05-26 Thread Martin Alfke
Hi Paolo,

the answer was a few mails earlier:

install the following package list:
zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev 
libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev 
python-software-properties 

Also see 
http://tuxmea.blogspot.de/2015/05/puppet-enterprise-38-installation-steps.html 
for other Ubuntu related installation issues.

Best,

Martin

On 26 May 2015, at 00:53, Paolo Marin marinpa...@gmail.com wrote:

 I am having the same issue. 
 Installing PE 3.8 to ubuntu 12.04.
 Installer fail with the following:
 
  ** cp /opt/puppet/share/installer/install_log.lastrun.FQDN.log 
 /var/log/pe-installer
 ** sed s/^\(q_.*password\)=.*/#\1=REDACTED/g  
 /tmp/pe-installer-wU0wqDPV/install/answers.lastrun.FQDN  
 /var/log/pe-installer/answers.install
 !! ERROR: The puppet master service failed to start within 120
seconds; unable to proceed
 
 
 I have tried 3 times and I thing this is a bug with the product.
 
 Please advice of any solution.
 Thanks
 
 
 On Saturday, May 2, 2015 at 3:58:39 AM UTC+10, Martin Alfke wrote:
 Confirmed. 
 This package list also solves installation issue on Ubuntu 14.10 
 
 Many thanks, 
 
 Martin 
 
 On 01 May 2015, at 19:49, Jay Benner long...@gmail.com wrote: 
 
  Nailed it!  Not sure which package did the trick, but smooth sailing after 
  installing these. 
  
  On Thursday, April 30, 2015 at 5:21:20 PM UTC-7, Kamil Keski wrote: 
  Scratch 2.1.5 as the issue.  Quick lsof shows that everything is still 
  using the 1.9.1 binary pulled in the install.  Only other thing I installed 
  was the following packages as they are my default pulls for a ruby build. 
  
  zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev 
  libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev 
  python-software-properties 
  I'm not going any deeper than that on this one.  I'm tired of drudging 
  through .rb's and am leaving this as is. 
  
  Still, on a pure fresh Ubuntu 12.04 or 14.04 install there is a dependency 
  that the PE installer is not pulling down. 
  
  If you're a user and need a quick fix just install the above packages. 
  
  Puppet devs, if you can track down which and package that into the 
  installer that would be fantastic. 
  
  Thanks, 
  K 
  
  On Thursday, April 30, 2015 at 3:43:27 PM UTC-6, Kamil Keski wrote: 
  Going to answer my own question here as there is likely no way a fresh 
  install of PE 3.8 will succeed on Ubuntu 12.04 or 14.04.  Ruby comes 
  preinstalled with the distro's with a version of 1.9 (old for sure).  
  However this should be known.  I Installed 2.1.5, made global and the 
  installation of PE 3.8 succeeded. 
  
  I'd like to see the PE install updated to pull a version of Ruby that it 
  requires (who knows, 2.0 may be sufficient).  At minimum listing that you 
  have a minimum version of Ruby installed as a prerequisite. 
  
  On Thursday, April 30, 2015 at 12:50:27 PM UTC-6, Kamil Keski wrote: 
  Yes, I've added the temp path arg to the pe-puppetserver init as well.  No 
  go. 
  
  Has anyone installed successfully from scratch using an ubuntu 12.04 or 
  14.04 distro?  Not an existing one, but a nice fresh build? 
  
  On Thursday, April 30, 2015 at 11:49:29 AM UTC-6, Martin Alfke wrote: 
  Hi Kamil, 
  
  have you tried setting the path attribute at the exec resource? 
  Puppet exec starts with an empty environment and you are using several Unix 
  commands without full path. 
  
  hth, 
  Martin 
  
  On Apr 30, 2015 7:29 PM, Kamil Keski ka...@inthetelling.com wrote: 
  Thanks for the reply Josh.  I worked through this and other posts I found 
  pointing to the tmp issue.  However I don't have /tmp or /usr/tmp mounted, 
  they are just dir's on the root mount. 
  
  fstab: 
  
  # file system mount point   type  options   dump  pass 
  /dev/mapper/ITTPuppet--vg-root /   ext4errors=remount-ro 0  
   1 
  # /boot was on /dev/sda1 during installation 
  UUID=89c2c14f-03a6-4f43-9935-25061c52e4f9 /boot   ext2defaults  
0   2 
  /dev/mapper/ITTPuppet--vg-swap_1 noneswapsw  0  
   0 
  /dev/fd0/media/floppy0  autorw,user,noauto,exec,utf8 0   0 
  
  Pretty vanilla stuff here, so noexecute should not be an issue in this 
  instance.  For good measure I tried creating a new dir (/usr/tmp) with 777 
  and defined -Djava.io.tmpdir=/usr/tmp globally via my /bashrc profile for 
  the user I'm running under and root.  Verified that was picked up via java 
  -version. 
  
  Picked up _JAVA_OPTIONS: -Djava.io.tmpdir=/usr/tmp 
  java version 1.6.0_35 
  OpenJDK Runtime Environment (IcedTea6 1.13.7) 
  (6b35-1.13.7-1ubuntu0.12.04.2) 
  OpenJDK 64-Bit Server VM (build 23.25-b01, mixed mode) 
  
  Still same behavior.  I don't see how anyone has worked through a fresh 
  install on Ubuntu at this point. 
  
  Thanks, 
  K 
  
  On Wednesday, April 29, 2015 at 4:03:13 PM UTC-6, Josh

Re: [Puppet Users] How to do Puppet type which autorequire an existing declaration of another type

2015-05-11 Thread Martin Alfke
Hi John,

many thanks for your explanation.
I will stay with auto require to allow managing resource B without the need for 
having the depending A resource declared within puppet too.

Best,

Martin


On 11 May 2015, at 16:17, jcbollinger john.bollin...@stjude.org wrote:

 
 
 On Sunday, May 10, 2015 at 8:03:25 AM UTC-5, Martin Alfke wrote:
 Hi, 
 
 I am working on some types and providers for opennebula network management. 
 
 I have one type already finished, which creates the network itself. 
 Each network can have multiple address ranges. 
 
 My idea so far: 
 
 onevnet { ’testnet’: 
   ensure = present, 
   … 
 } 
 
 onevnet_addressrange { ‘name’: 
   ensure  = present, 
   onevnet = ‘testnet’, 
   … 
 } 
 
 How can I enforce that onevent ‘testnet’ has to be declared? 
 I found auto require but that seems to be optional (or did I miss something). 
 
 
 Autorequire is about order-of-application dependencies between resources 
 under Puppet management.  It is not about which resources should be under 
 management in the first place.  For example, autorequire automatically causes 
 a File's parent directory to be managed before the File itself, provided that 
 the parent is under management.
 
 You should consider structuring your type so that instances do not inherently 
 depend on another resource being declared.  A hard dependency such as that is 
 a good sign that your resource is not properly scoped.
 
 If for some reason you must have a hard dependency, then the easiest route to 
 take might be to specify that the plugin type is for your module's internal 
 use only (though you cannot enforce that), and provide a defined type wrapper 
 for public use.  The wrapper can declare a fixed, unconditional relationship 
 with whatever other resources you like, and catalog building will fail if any 
 of those resources is not declared.
 
 
 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/d0ce5ac8-100a-42ed-90d5-ee5286c7aa7c%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/7963F5C4-3520-4D4A-B96C-A5B1178A96EB%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] How to do Puppet type which autorequire an existing declaration of another type

2015-05-10 Thread Martin Alfke
Hi,

I am working on some types and providers for opennebula network management.

I have one type already finished, which creates the network itself.
Each network can have multiple address ranges.

My idea so far:

onevnet { ’testnet’:
  ensure = present,
  …
}

onevnet_addressrange { ‘name’:
  ensure  = present,
  onevnet = ‘testnet’,
  …
}

How can I enforce that onevent ‘testnet’ has to be declared?
I found auto require but that seems to be optional (or did I miss something).

You can find the actual code on github: 
https://github.com/tuxmea/opennebula-puppet-module/tree/onevnet_multinet_provider

Please note:
I am not a developer so please don’t start screaming immediately when seeing 
the code.
I am happy to receive recommendations and ideas.

Thanks in advance,

Martin

-- 
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/CEF6C0EA-FFC9-4EE3-BF46-E1359F541265%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] parameters from agent to master

2015-04-29 Thread Martin Alfke
the agent sends facts to master.
you want to look for facter extensions to geht data from agent to master.
On Apr 29, 2015 3:27 PM, saji...@wso2.com wrote:

 Is there a way to pass parameters from agent to master?

 --
 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/05e55640-bb77-4b2b-917f-added688085d%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/05e55640-bb77-4b2b-917f-added688085d%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 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/CAH_Azc1V%2BugDT%2BTE1VNwoyGJHJKSs_DvUDUzRFZhdh5tFFZVGA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Juniper SRX 5400

2015-04-28 Thread Martin Alfke

 On 28.04.2015, at 11:17, rto...@gmail.com wrote:
 
 Does puppet support provisioning the juniper SRX-5400.
 I could not find yet. If yes then could you please direct me in right 
 direction with some available documents.
 

http://www.juniper.net/techpubs/en_US/junos-puppet1.0/information-products/pathway-pages/junos-puppet.html
 
http://www.juniper.net/techpubs/en_US/junos-puppet1.0/information-products/pathway-pages/junos-puppet.html

Supported Platforms:
ES Series
MX Series
QFX Series

Further documentation can be found at juniper website:
http://www.juniper.net/techpubs/en_US/release-independent/junos-puppet/information-products/pathway-pages/
 
http://www.juniper.net/techpubs/en_US/release-independent/junos-puppet/information-products/pathway-pages/
http://www.juniper.net/techpubs/en_US/junos-puppet1.0/topics/concept/automation-junos-puppet-overview.html
 
http://www.juniper.net/techpubs/en_US/junos-puppet1.0/topics/concept/automation-junos-puppet-overview.html

Or from puppet forge:
https://forge.puppetlabs.com/juniper/netdev_stdlib_junos 
https://forge.puppetlabs.com/juniper/netdev_stdlib_junos


 Thanks
 -Rajiv
 
 -- 
 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 
 mailto:puppet-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/puppet-users/5cbfa149-5205-431b-bd35-f11776c485e3%40googlegroups.com
  
 https://groups.google.com/d/msgid/puppet-users/5cbfa149-5205-431b-bd35-f11776c485e3%40googlegroups.com?utm_medium=emailutm_source=footer.
 For more options, visit https://groups.google.com/d/optout 
 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/0D7CE895-42CD-49F3-B6DD-255CC1D20689%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Managing multiple files in a directory - permissions issue

2015-04-07 Thread Martin Alfke

On 07 Apr 2015, at 04:55, Dave Hunsinger dhuns...@calliduscloud.com wrote:

 Can somebody help me with what I'm doing wrong here? I want to copy all 
 sshkeys in the file resource of this puppet module to the machine:
 
 class sshkeys {
 
 file { '/etc/ssh/ssh.keys':
   ensure = directory,
   owner = 'root',
   group = 'root',
   source = puppet:///sshkeys,
   recurse = true,
   purge = true,
   }
 
 }

You need to change the source:

source = ‘puppet:///modules/sshkeys',

 
 Info: Applying configuration version '1428375139'
 Error: /Stage[main]/Sshkeys/File[/etc/ssh/ssh.keys]: Failed to generate 
 additional resources using 'eval_generate': Error 400 on SERVER: Not 
 authorized to call search on /file_metadata/development/sshkeys with 
 {:links=manage, :recurse=true, :checksum_type=md5}
 Error: /Stage[main]/Sshkeys/File[/etc/ssh/ssh.keys]: Could not evaluate: 
 Could not retrieve file metadata for puppet:///development/sshkeys: Error 400 
 on SERVER: Not authorized to call find on /file_metadata/development/sshkeys 
 with {:links=manage, :source_permissions=use}
 Wrapped exception:
 Error 400 on SERVER: Not authorized to call find on 
 /file_metadata/development/sshkeys with {:links=manage, 
 :source_permissions=use}
 Notice: Finished catalog run in 1.15 seconds
 [root@lfmx-lin-stg01 daveh]#
 
 
 
 
 CallidusCloud HQ has moved. 
 Our new address is: 
 4140 Dublin Blvd, Suite 400, Dublin, CA 94568  
 
 -- 
 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/68fbbb6c-b0a1-4319-94a2-48e47e2247aa%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/38B69EAB-3FB9-42CF-888D-2EE141E22606%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] developing module for k5login

2015-04-07 Thread Martin Alfke

On 06 Apr 2015, at 17:35, Dhaval d.josh...@gmail.com wrote:

 hello,
 
 I am trying to develop puppet module for k5login entries .. now my question 
 is, how do i manage entries for multiple hierarchies ?
 
 currently when i try it, it picks up from where it finds entry first and 
 completes it, how do i get values so it creates an array from all hierachies 
 and then populates the k5login?
 
 i tried deeper merging and hiera_array, still not sure why it's not 
 working. anything special i need to do ?

Hi Dhaval,

it would be great if you can post the puppet code and your hiera data.
Otherwise people have to guess.

Best,

Martin

-- 
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/A14F2C7F-6504-4D60-81D8-D93608D82D4F%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: [Announce] Micro-puppet v0.0.2 now available with new code extinguisher feature

2015-04-01 Thread Martin Alfke
I really like the approach of m::in { auto: } and m::cf { auto: } to have my 
systems up and running in seconds.
I just think of my new configuration to change and everything works. ;-)
no more manual work. more beertime.
And: the future fix script works as documented. ;-)

happy hacking!!


On 01 Apr 2015, at 11:43, Raphink raph...@gmail.com wrote:

 This is great!
 
 I was looking forward to something that would be more useable than the 
 puppet-lint plugins to migrate my Puppet code, and this is just so simple and 
 efficient! Thank you!
 
 
 On Wednesday, April 1, 2015 at 10:00:56 AM UTC+2, Corey Osman wrote:
 On the heels of the previously announced tiny-puppet 
 (https://github.com/example42/puppet-tp.git) now comes micro-puppet.  A 
 shortened version of tiny-puppet for the keystroke impaired.  But with 
 Micro-puppet there is so much more.  Version 0.0.2 now brings a new feature 
 called code extinguisher that fixes all your puppet 2.7.x code depreciation 
 warnings and automagically converts them to take advantage of the new parser 
 found only in puppet 4. 
 
 To learn more about the advantages of using Micro puppet please visit the 
 following repo: 
 
 https://github.com/logicminds/micro-puppet.git 
 
 
 Corey 
 
 
 
 -- 
 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/ff144551-d822-4da9-bfb7-fea0e679f7d6%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/52BB7A31-6D12-4CAB-806B-E706FCF3335E%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Upgrading from 0.25.1 to 3.7.4

2015-04-01 Thread Martin Alfke
Hi James,

a horrible task (I am still busy at a customer upgrading the puppet DSL code 
from 2.7.23).

You want to get rid of:
- non-scoped variables (in manifests, modules and templates)
- import in class files

You might need to:
- clean up node classification
- rewrite classes to have parameters
- rewrite self developed facts, functions, types, providers

And you definitely want to have rspec tests in place.

Good luck.

Martin

P.S. I know of at least one installation where they did not upgrade, but a 
complete rewrite and a new puppet master.

On 01 Apr 2015, at 17:17, James Perry jjperr...@gmail.com wrote:

 I have been tasked to upgrade puppet 0.25.1 to 3.7.4.  There has been a lot 
 of past admins tweaking this puppet server and most of the existing modules 
 are all ad-hoc creations. I want to ensure I do not miss any expected 
 dependencies, but I also do not have months to manually traverse the entire 
 Puppet site.pp file by hand.
 
 Is there some tool, script or puppet command that will show me a quick 
 digestion for each node as to what modules it includes and inherits? 
 
 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/1971bf52-6c44-4b96-80fb-72c9dc096355%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/703D6255-BAE5-4648-855E-68BD1D7689E5%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] new to puppet.

2015-03-21 Thread Martin Alfke
Hi,

the best way is to start with learning puppet vm and the according website: 
https://docs.puppetlabs.com/learning/index.html 
https://docs.puppetlabs.com/learning/index.html
At https://puppetlabs.com/learn https://puppetlabs.com/learn you have the 
possibility to get a guide through Puppet basics without the need for a VM.

It is always the best to first understand the concept behind puppet and then 
start with real world problems.

hth,

Martin


 On 19.03.2015, at 15:45, manyi anche...@gmail.com wrote:
 
 does anyone has a manifest I can use to:
 1. Create an account for Mary, maryjane on all systems
 2. Create a specific user on just a specific system  (For example,  create 
 account john.doe on puppet-domain but not on puppetagent)
 
 -- 
 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 
 mailto:puppet-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/puppet-users/78b8556c-2bff-4da4-a335-101a19a5f402%40googlegroups.com
  
 https://groups.google.com/d/msgid/puppet-users/78b8556c-2bff-4da4-a335-101a19a5f402%40googlegroups.com?utm_medium=emailutm_source=footer.
 For more options, visit https://groups.google.com/d/optout 
 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/F88CFF7B-8194-48E9-B72C-BD2356F3DA2A%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Selectively Install Packages

2015-03-04 Thread Martin Alfke
Hi Steve,

with tags you only can execute classes which are enabled anyway.
It is a  way to limit execution on a certain subset of classes.

What else:
you can provide a fact at CLI and react on that specific fact:

FACTER_runnow=true puppet agent —test —tags class

Inside your class you will do something like

class foo {
  if $::runnow {
notify { ‘Only when run now is set’: }
  }
}

On 04 Mar 2015, at 17:12, Steve Harp steve.h...@rdasys.com wrote:

 Thanks Martin.
 
 I've tried adding a tag 'testing' to a class and the class deploys regardless 
 of the '--tags testing' being on the puppet agent command line or not.  What 
 am I missing?  I need the class to deploy if and only if specified.
 
 Thanks...
 
 On Wednesday, March 4, 2015 at 10:05:34 AM UTC-5, Martin Alfke wrote:
 Hi, 
 On 04 Mar 2015, at 15:57, Steve Harp steve...@rdasys.com wrote: 
 
  Hi Guys, 
  
  I'm using Puppet for many configuration items and package deployments.  I 
  need to be able to only deploy certain packages/classes when the Agent 
  sends a definable command line option.   
  
  Example: puppet agent --onetime --no-daemonize --verbose 
  --do_something_special 
  
  I want to be able to execute a class only when the '--do_something_special' 
  flag is passed. 
 
 You can use the —tag option to only do what is mentioned in a specific class. 
 
 e.g. puppet agent —test —tags apache 
 
 Classes will become tags automatically. 
 Besides this you can use the tag metaparameter on the package resource. 
 
 hth, 
 
 Martin 
 
 
 -- 
 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/2a49081b-bd40-440b-aa86-4937354012de%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/F7829755-16F5-4083-A063-AA816121EEDA%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Selectively Install Packages

2015-03-04 Thread Martin Alfke
Hi,
On 04 Mar 2015, at 15:57, Steve Harp steve.h...@rdasys.com wrote:

 Hi Guys,
 
 I'm using Puppet for many configuration items and package deployments.  I 
 need to be able to only deploy certain packages/classes when the Agent sends 
 a definable command line option.  
 
 Example: puppet agent --onetime --no-daemonize --verbose 
 --do_something_special
 
 I want to be able to execute a class only when the '--do_something_special' 
 flag is passed.

You can use the —tag option to only do what is mentioned in a specific class.

e.g. puppet agent —test —tags apache

Classes will become tags automatically.
Besides this you can use the tag metaparameter on the package resource.

hth,

Martin

-- 
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/9CF1F858-EF65-4DFF-9586-2D1346465D30%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] delete line in file with substring xyz

2015-02-25 Thread Martin Alfke
The single quotes take the argument as it is.
In this case you are looking for a line with *xyz*
Maybe you want to try double quotes.

hth,

Martin

On 25 Feb 2015, at 13:58, Andreas Dvorak andreas.dvo...@gmail.com wrote:

 Dear all
 
 I would like to use the stdlib Modul with file_line to delete a line that 
 matches *xyz*.
 But the resource
 
 file_line {'delete line':
   ensure = absent,  
   path = '/etc/file', 
   line = '*xyz*',
 }
 
 or 
 
 file_line {'delete line':
   ensure = absent,  
   path = '/etc/file', 
   match = '*xyz*',
 }
 
 does not work.
 
 My current solution is with an exec resource but I don't like it.
 
 Does anymbody know how to do it with file_line?
 
 Andreas
 
 -- 
 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/bd72d951-bcb7-4091-879e-047d65d20407%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/33F0B944-9D59-4171-AEBD-48CD71BC2568%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Dependencies issue for puppet agent installation

2015-02-17 Thread Martin Alfke
Hi Subodh,

you might want a repository mirror inside your network.
Or: add a local repo only having the required packages.
Or: install required packages during provisioning.

Best,

Martin

On 18 Feb 2015, at 07:26, Subodh Kant sk14...@gmail.com wrote:

 Hi Martin,
 
 Thanks.
 
 Is there any way to install puppet agent without having internet 
 connectivity.??
 
 Thnaks
 Subodh Kant
 
 -- 
 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/785b7f89-56bf-4f6a-8b89-2aeb210a1d68%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/867DF13F-4373-49D9-964B-BB590B4B621A%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Dependencies issue for puppet agent installation

2015-02-17 Thread Martin Alfke
Hi Subodh,

when using the simple curl puppet agent installer method you will get a repo 
file created on the node and the puppet master acts as pe-package repository 
server.
All non PE packages have to be installed using the normal cents/rhel 
repositories.

hth,

Martin

On 17 Feb 2015, at 16:44, Subodh Kant sk14...@gmail.com wrote:

 Hi Martin,
 
 Thanks.
 
 But how other packages are getting resolved?? If you see my log, all packages 
 pe-x are getting resolved but only two packages (pciutils, cyrus-sasl) 
 are getting fail which is not pe-x. When i install these two packages 
 manually by RPM and then i ran curl command to registration, i was able to 
 registration the node to puppet master.
 
 --- Package pe-rubygem-net-ssh.noarch 0:2.1.4-2.pe.el7 will be installed
 --- Package pe-virt-what.x86_64 0:1.14-1.el7 will be installed
 -- Finished Dependency Resolution
 Error: Package: pe-facter-2.2.0.2-1.pe.el7.x86_64 (puppetlabs-pepackages)
Requires: pciutils
 Error: Package: pe-libldap-2.4.39-5.pe.el7.x86_64 (puppetlabs-pepackages)
Requires: cyrus-sasl
  You could try using --skip-broken to work around the problem
 
 
 Thanks
 Subodh Kant
 
 -- 
 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/CAAbO_CUScvAs5nao_16py%2BQ8%3DRhJvU1exNEDzz634e-uJwkYzA%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/FC5DFC6F-C49E-4ECD-B272-9F5B1785CF37%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Dependencies issue for puppet agent installation

2015-02-17 Thread Martin Alfke
Hi Subodh,

does the agent have the CentOS/RHEL repositories enabled?
Look into /etc/yum.repos.d and check for *.repo files.

hth,

Martin

On 17 Feb 2015, at 07:52, Subodh Kant sk14...@gmail.com wrote:

 Hi Puppet Team,
 
 I am facing Dependencies issue for puppet agent installation. Please help me 
 to resolved this issue. I am running PE 3.7 on CentOS 7 and clients are 
 CentOS 7 and RHEL 7. I ran this command on puppet agent...
 
 curl -k https://host1.xxx.com:8140/packages/current/install.bash | sudo bash 
 -s agent:certname=host5.xxx.com
 
 And getting this error
 
 --- Package pe-rubygem-net-ssh.noarch 0:2.1.4-2.pe.el7 will be installed
 --- Package pe-virt-what.x86_64 0:1.14-1.el7 will be installed
 -- Finished Dependency Resolution
 Error: Package: pe-facter-2.2.0.2-1.pe.el7.x86_64 (puppetlabs-pepackages)
Requires: pciutils
 Error: Package: pe-libldap-2.4.39-5.pe.el7.x86_64 (puppetlabs-pepackages)
Requires: cyrus-sasl
  You could try using --skip-broken to work around the problem
  You could try running: rpm -Va --nofiles --nodigest
 /tmp/tmp.7k7yHBjblk: line 40: /opt/puppet/bin/puppet: No such file or 
 directory
 /tmp/tmp.7k7yHBjblk: line 41: /opt/puppet/bin/facter: No such file or 
 directory
 /tmp/tmp.7k7yHBjblk: line 41: /opt/puppet/bin/puppet: No such file or 
 directory
 /tmp/tmp.7k7yHBjblk: line 42: /opt/puppet/bin/puppet: No such file or 
 directory
 /tmp/tmp.7k7yHBjblk: line 15: /opt/puppet/bin/puppet: No such file or 
 directory
 /tmp/tmp.7k7yHBjblk: line 44: /opt/puppet/bin/puppet: No such file or 
 directory
 Error running install script /tmp/tmp.7k7yHBjblk
 
 
 Please help.
 
 Thanks
 Subodh Kant
 
 -- 
 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/c57686b3-b5a6-4a73-8338-e30b21d46201%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/923E81D9-AE4D-4C3C-A57C-F2CC05380ED3%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Dependencies issue for puppet agent installation

2015-02-17 Thread Martin Alfke
Hi Subodh,

the Puppet master generates a catalog for the agent.
Within the catalog the agent receives information regarding its configuration.
The agent will then issue proper commands based on the declared Puppet resource 
types.
For packages the agent (RHEL, CentOS) will use the yum command.
This means that the agent needs access to a yum repository server.

Most companies do not want their agents to fetch packages directly from the 
internet and use a local repository mirror for that purpose.

hth,

Martin

On 17 Feb 2015, at 13:26, Subodh Kant sk14...@gmail.com wrote:

 Hi Martin,
 
 Thank you for your reply.
 
 My CentOS servers does not have internet connectivity so CentOS repo will not 
 work in this case. And RHEL also not connected Redhat satellite server so 
 there is no repo for RHEL too.
 
 On my puppet server only, yum.puppetlabs.com is enable and it can talk to 
 puppet yum repository.
 
 My assumption is that, puppet client installation by using curl command will 
 talk to puppet server for all the dependencies since puppet server is part of 
 pe-repo class under classification and puppet client server will not required 
 internet connectivity for any dependencies. Am i correct ???
 
 I do not want to enable internet for puppet client servers.
 
 Please help.
 
 Thanks
 Subodh Kant 
 
 -- 
 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/c67c1d53-cc7a-43ed-8109-3838b903dba9%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/9225492D-96BD-475C-AACC-D730838AB3E8%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] [Solved] Behavior of exported resource collectors

2015-02-05 Thread Martin Alfke
Answering myself on this one:

the described behaviour is expected.
Many thanks to Henrik for his input on this.

Background:

when collecting all exported resources the parser uses a “shortcut” and does 
not inspect all exported resources.
When collecting a subset only, the parser needs to inspect all exported 
resources to analyse what to collect and what not.

Fix: set a sane default for all parameters in exported resources.

- Martin

On 20 Jan 2015, at 16:02, Martin Alfke tux...@gmail.com wrote:

 Hi,
 
 I have the following code:
 
 define monitor::host (
 $target,
 $monitortag = $::domain,
 ) {
 }
 …
 }
 
 The define gets exported on all nodes:
 
 @@monitor::host { $::fqdn: }
 
 And I collect on the monitor server:
 
 Monitor::Host | | {
 target = ‘/full path to config’,
 }
 
 This is working as expected
 
 No I want to collect from a specific monitortag only:
 
 Monitor::Host | monitortag == ‘foo.com’ | {
 target = ‘/full path to config’,
 }
 
 Now we receive an error message on the host where we collect claiming that 
 target is not set.
 
 Is this known behaviour?
 
 Many thanks,
 
 Martin
 

-- 
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/20A8AC8E-1C1D-4040-A4BE-49EFD0F3379E%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] File() function weird behavior

2015-01-27 Thread Martin Alfke
Hi,

On 27 Jan 2015, at 13:45, Przemysław Szypowicz p.szypow...@gmail.com wrote:

 Hi,
 
 When I locally apply manifest:
 
 file{'/tmp/cert.pem':
   ensure = present,
   content = file(/var/lib/puppet/ssl/private_keys/${::clientcert}.pem),
 }
 
 its working as expected.
 
 But when thats manifest on puppet master, puppet agent -t gave me:
 
 Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
 Could not find any files from 
 /var/lib/puppet/ssl/private_keys/host.internal.pem at 
 /etc/puppet/environments/production/modules/profiles/manifests/test.pp:31 on 
 node host.internal
 Warning: Not using cache on failed catalog
 Error: Could not retrieve catalog; skipping run
 
 Any one knows why file() is not working in my case? I asked on IRC and looked 
 in docs but failed. 

First guess: file permissions.
Is the puppet user allowed to access the file?

hth,

Martin

-- 
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/0EF7BC0B-5FAC-408B-BD5A-752099C1AF47%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Behavior of exported resource collectors

2015-01-20 Thread Martin Alfke
Hi,

I have the following code:

define monitor::host (
  $target,
  $monitortag = $::domain,
) {
}
…
}

The define gets exported on all nodes:

@@monitor::host { $::fqdn: }

And I collect on the monitor server:

Monitor::Host | | {
  target = ‘/full path to config’,
}

This is working as expected

No I want to collect from a specific monitortag only:

Monitor::Host | monitortag == ‘foo.com’ | {
  target = ‘/full path to config’,
}

Now we receive an error message on the host where we collect claiming that 
target is not set.

Is this known behaviour?

Many thanks,

Martin

-- 
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/87C98E61-9294-4526-B70F-11F7EBDE15CD%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Resource ordering syntax

2015-01-18 Thread Martin Alfke
When using an array on a resource title Puppet will internally create multiple 
resource declarations.

e.g.
when declaring like this:
package { [‘foo’, ‘bar’, ‘bas’]: ensure = present }

You can build references on each of the array elements:

require = Package[‘bas’]

see: 
https://docs.puppetlabs.com/puppet/latest/reference/lang_resources.html#array-of-titles

On 17 Jan 2015, at 15:13, Andrew Langhorn 
andrew.langh...@digital.cabinet-office.gov.uk wrote:

 Hi,
 
 I have a syntax query, I hope that the group can help with.
 
 When using resource ordering parameters, such as 'before' or 'require', I can 
 specify the resource on which to act the ordering around. For instance:
 
 exec { 'wget-docker-key':
 command = '/usr/bin/wget -qO- https://get.docker.io/gpg | 
 /usr/bin/apt-key add -',
 before  = Exec['echo-docker-deb-apt-sources'],
 }
 
 exec { 'echo-docker-deb-apt-sources':
 command = '/bin/echo deb http://get.docker.io/ubuntu docker main  
 /etc/apt/sources.list.d/docker.list',
 creates = '/etc/apt/sources.list.d/docker.list',
   }
 
 This will ensure that the Docker key is installed on the machine before 
 create a list of Docker sources for Apt.
 
 In situations where I'm using an array as the resource title, such as this:
 
 package { [
   linux-image-extra-${::kernelrelease},
   'lxc',
   'lxc-docker-1.0.0',
 ]:
   ensure = present,
 }
 
 How do I reference the resource when using resource ordering? Do I just use 
 Package['linux-image-extra-${::kernelrelease},'lxc','lxc-docker-1.0.0']?
 
 Thanks in advance!
 
 -- 
 Andrew Langhorn
 Web Operations
 Government Digital Service
 
 e: andrew.langh...@digital.cabinet-office.gov.uk
 a: 6th Floor, Aviation House, 125 Kingsway, London, WC2B 6NH
 
 -- 
 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/CANCa_WZ2Mp7A8PrAEvkK3DuuCks_3ptp1rCByhxxs1r%3DZ31iqQ%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/43CB4061-35A8-466C-B374-0FF718A5D716%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] exec resource long runtime

2015-01-18 Thread Martin Alfke
Please also keep in mind that puppet is doing more:

require = Class['spacewalk::install'], 

There is another class which also gets executed.

The 48 second is not only the command execution time.
Its the whole catalog apply time.
Puppet always checks whether it has do do something prior doing changes.
e.g. check file md5sum, owner and group and permissions.

hth,

Martin

On 18 Jan 2015, at 15:54, Royee Tager royee...@gmail.com wrote:

 Hi Martin,
 
 Attached is the output of the commands:
 
 [root@labit-lg02 ~]# time /usr/sbin/spacewalk-channel -l
 Unable to locate SystemId file. Is this system registered?
 
 real  0m1.125s
 user  0m0.120s
 sys   0m0.055s
 [root@labit-lg02 ~]#
 
 [root@labit-lg02 ~]# time /usr/sbin/rhnreg_ks 
 --serverUrl=http://spacewalk.example.com/XMLRPC 
 --activationkey=1-aab07306b6f673c367ebecae2aa55f22 --force --nohardware 
 --nopackages --novirtinfo --norhnsd
 warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: 
 NOKEY
 
 real  0m15.558s
 user  0m9.997s
 sys   0m0.704s
 [root@labit-lg02 ~]#
 
 בתאריך יום ראשון, 18 בינואר 2015 בשעה 15:46:38 UTC+2, מאת Martin Alfke:
 The 48 seconds is the complete time the agent needs for the catalog. 
 Within the catalog you are running two commands: 
 
 spacewalk-channel -l and rhnreg. 
 
 Please add both execution times when comparing. 
 
 On 18 Jan 2015, at 08:29, Royee Tager roye...@gmail.com wrote: 
 
  Hi, 
  
  If I run the following command manually (time /usr/sbin/rhnreg_ks -v 
  --serverUrl=http://spacewalk.example.com/XMLRPC 
  --activationkey=1-aab07306b6f673c367ebecae2aa55f22 --force --nohardware 
  --nopackages --novirtinfo --norhnsd -v), the runtime is 15 seconds. 
  However, if the command is performed via the exe resource the runtime is 
  ~48 seconds. 
  
  Why is the runtime via the exe resource longer? 
  
  Is it possible shorten the runtime? 
  
  class spacewalk::config inherits spacewalk { 
  
file { '/etc/yum/pluginconf.d/rhnplugin.conf': 
  
  ensure   = present, 
  
  source   = 'puppet:///modules/spacewalk/rhnplugin.conf', 
  
  owner= root, 
  
  group= root, 
  
  mode = '0644', 
  
  before   = Exec['register-client'], 
  
} 
  
exec { 'register-client': 
  
  command = /usr/sbin/rhnreg_ks -v 
  --serverUrl=http://${::spacewalk::spacewalk_server_fqdn}/XMLRPC 
  --activationkey=${::spacewalk::activation_key} --force --nohardware 
  --nopackages --novirtinfo --norhnsd -v, 
  
  require = Class['spacewalk::install'], 
  
  unless  = '/usr/sbin/spacewalk-channel -l', 
  
} 
  
  } 
  
  
  
  Info: /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]: 
  Starting to evaluate the resource 
  
  Debug: Exec[register-client](provider=posix): Executing check 
  '/usr/sbin/spacewalk-channel -l' 
  
  Debug: Executing '/usr/sbin/spacewalk-channel -l' 
  
  Debug: 
  /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]/unless: 
  Unable to locate SystemId file. Is this system registered? 
  
  Debug: Exec[register-client](provider=posix): Executing 
  '/usr/sbin/rhnreg_ks --serverUrl=http://spacewalk.example.com/XMLRPC 
  --activationkey=1-aab07306b6f673c367ebecae2aa55f22 --force --nohardware 
  --nopackages --novirtinfo --norhnsd' 
  
  Debug: Executing '/usr/sbin/rhnreg_ks 
  --serverUrl=http://spacewalk.example.com/XMLRPC 
  --activationkey=1-aab07306b6f673c367ebecae2aa55f22 --force --nohardware 
  --nopackages --novirtinfo --norhnsd' 
  
  Notice: 
  /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]/returns: 
  executed successfully 
  
  Debug: /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]: The 
  container Class[Spacewalk::Config] will propagate my refresh event 
  
  Info: /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]: 
  Evaluated in 47.20 seconds 
  
  
  
  Thank you in advance, 
  
  
  -- 
  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...@googlegroups.com. 
  To view this discussion on the web visit 
  https://groups.google.com/d/msgid/puppet-users/e7aa4d1b-3086-4705-ab83-65f2acf85714%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/4e05168d-407d-44c1-b631-bd0c9960d1a7%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

Re: [Puppet Users] exec resource long runtime

2015-01-18 Thread Martin Alfke
The 48 seconds is the complete time the agent needs for the catalog.
Within the catalog you are running two commands:

spacewalk-channel -l and rhnreg.

Please add both execution times when comparing.

On 18 Jan 2015, at 08:29, Royee Tager royee...@gmail.com wrote:

 Hi, 
 
 If I run the following command manually (time /usr/sbin/rhnreg_ks -v 
 --serverUrl=http://spacewalk.example.com/XMLRPC 
 --activationkey=1-aab07306b6f673c367ebecae2aa55f22 --force --nohardware 
 --nopackages --novirtinfo --norhnsd -v), the runtime is 15 seconds. However, 
 if the command is performed via the exe resource the runtime is ~48 seconds.
 
 Why is the runtime via the exe resource longer?
 
 Is it possible shorten the runtime?
 
 class spacewalk::config inherits spacewalk {
 
   file { '/etc/yum/pluginconf.d/rhnplugin.conf':
 
 ensure   = present,
 
 source   = 'puppet:///modules/spacewalk/rhnplugin.conf',
 
 owner= root,
 
 group= root,
 
 mode = '0644',
 
 before   = Exec['register-client'],
 
   }
 
   exec { 'register-client':
 
 command = /usr/sbin/rhnreg_ks -v 
 --serverUrl=http://${::spacewalk::spacewalk_server_fqdn}/XMLRPC 
 --activationkey=${::spacewalk::activation_key} --force --nohardware 
 --nopackages --novirtinfo --norhnsd -v,
 
 require = Class['spacewalk::install'],
 
 unless  = '/usr/sbin/spacewalk-channel -l',
 
   }
 
 }
 
 
 
 Info: /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]: 
 Starting to evaluate the resource
 
 Debug: Exec[register-client](provider=posix): Executing check 
 '/usr/sbin/spacewalk-channel -l'
 
 Debug: Executing '/usr/sbin/spacewalk-channel -l'
 
 Debug: /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]/unless: 
 Unable to locate SystemId file. Is this system registered?
 
 Debug: Exec[register-client](provider=posix): Executing '/usr/sbin/rhnreg_ks 
 --serverUrl=http://spacewalk.example.com/XMLRPC 
 --activationkey=1-aab07306b6f673c367ebecae2aa55f22 --force --nohardware 
 --nopackages --novirtinfo --norhnsd'
 
 Debug: Executing '/usr/sbin/rhnreg_ks 
 --serverUrl=http://spacewalk.example.com/XMLRPC 
 --activationkey=1-aab07306b6f673c367ebecae2aa55f22 --force --nohardware 
 --nopackages --novirtinfo --norhnsd'
 
 Notice: 
 /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]/returns: 
 executed successfully
 
 Debug: /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]: The 
 container Class[Spacewalk::Config] will propagate my refresh event
 
 Info: /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]: 
 Evaluated in 47.20 seconds
 
 
 
 Thank you in advance,
 
 
 -- 
 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/e7aa4d1b-3086-4705-ab83-65f2acf85714%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/F54FF072-9664-4EAF-B356-1E6582333CEF%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] update package with condition

2015-01-15 Thread Martin Alfke
Hi,

with RH6 you can use yum provider and set ensure to latest.
(Maybe you need to create a yum repo for your factor package).

hth,

Martin

On 14 Jan 2015, at 18:34, puppetstan stanislas.lev...@gmail.com wrote:

 Hi,
 
 I would like to update the package facter on all of my servers. (I can not 
 use INSTALL_OPTIONS because my puppet version is too old)
 
 I added a condition-- if the package facter is installed AND if facter 
 version is not facter-1.7.6-1.el6.x86_64.rpm I install the package but I 
 think I have an error in my onlyif condition because it does not work.
 
 Can you have an idea please?
 Thanks in advance
 
 regards
 
 
 class paquet::redhat6-64 {
 
 package {'facter':
   provider = 'rpm',
 #  install_options = ['-Uvh'],
   source = /tmp/facter-1.7.6-1.el6.x86_64.rpm,
   require = File[/tmp/facter-1.7.6-1.el6.x86_64.rpm],
   notify = Service[puppet],
   }
 
file { /tmp/facter-1.7.6-1.el6.x86_64.rpm:
source = puppet:///modules/paquet/facter-1.7.6-1.el6.x86_64.rpm
}
 
 exec {'rpm updates':
 command = '/bin/rpm -Uvh /tmp/facter-1.7.6-1.el6.x86_64.rpm',
 onlyif = /bin/rpm -q facter and ('/usr/bin/facter -v' != 
 facter-1.7.6),
 }
 
 
 -- 
 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/d4289154-27d7-489d-adea-c452b4d6c767%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/8D42B17B-9A0D-4EAE-99B5-F19B6D264959%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Error: Failed to parse template . Detail: Could not find value for 'serveraliases' at

2015-01-10 Thread Martin Alfke
Hi,

 
 class otrs::apache {
 
   include apache
 
   apache::vhost { $otrs::sitename:
 priority= '01',
 docroot = '/var/www',
 port= '80',
 serveraliases   = [ $::fqdn ],
 content= template('otrs/vhost-otrs.conf.erb'),
   }
 
 Error: Invalid parameter content at 
 /etc/puppetlabs/puppet/modules/otrs/manifests/apache.pp:11 
 

Are you using puppetlabs-apache module or have you written the apache::ghost 
define by yourself?
Check that the define knows about the parameter content.

Puppetlabs-apache ghost define does not have the content attribute.
They switched to concat module and small template snippets.
https://github.com/puppetlabs/puppetlabs-apache/blob/master/manifests/vhost.pp

- Martin

-- 
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/6A9B2E99-7B79-48AF-AE06-2CDC58DEAE30%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Error: Failed to parse template . Detail: Could not find value for 'serveraliases' at

2015-01-09 Thread Martin Alfke
Seems to be an issue with unscoped variable inside the template.
https://docs.puppetlabs.com/guides/templating.html#referencing-variables

Please switch to scoped variables in your template:

# OTRS Config
# MaxRequestsPerChild (so no apache child will be to big!)
MaxRequestsPerChild 4000

VirtualHost *:%= scope.lookupvar(otrs::apache::port) %
  ServerName %= @name %
%if @serveraliases.is_a? Array -%
% @serveraliases.each do |name| -%%=   ServerAlias #{name}\n %% end -%
% elsif @serveraliases != '' -%
%=   ServerAlias #{@serveraliases} -%
% end -%

hth,

Martin


On 09 Jan 2015, at 16:58, Craig White white.n...@gmail.com wrote:

 Testing for errors is part of the erb game. Comment all of that out and put 
 in just %= serveraliases -% just to see what is written to the file.
 
 In your case above, it seems you have accounted for whether serveraliases is 
 an array or empty but not a simple string which is probably what it is.
 
 On Friday, January 9, 2015 at 8:41:20 AM UTC-7, Spriya wrote:
 Hi,
 
 I am having this issue:
 
 
 Error: Failed to parse template otrs/vhost-otrs.conf.erb:
   Filepath: 
 /opt/puppet/lib/ruby/site_ruby/1.9.1/puppet/parser/templatewrapper.rb
   Line: 81
   Detail: Could not find value for 'serveraliases' at 
 /etc/puppetlabs/puppet/modules/otrs/templates/vhost-otrs.conf.erb:7
  at /etc/puppetlabs/puppet/modules/otrs/manifests/apache.pp:10 on node 
 dot-pap-spr-t03.ddc.dot.state.ma.us
 
 
 Here is my code manifests code:
 
 class otrs::apache {
 
   include apache
 
   apache::vhost { $otrs::sitename:
 priority= '01',
 docroot = '/var/www',
 port= '80',
 serveraliases   = [ $::fqdn ],
 }
 }
 
 Here is my template:
  cat vhost-otrs.conf.erb
 # OTRS Config
 # MaxRequestsPerChild (so no apache child will be to big!)
 MaxRequestsPerChild 4000
 
 VirtualHost *:%= scope.lookupvar(otrs::apache::port) %
   ServerName %= @name %
 %if serveraliases.is_a? Array -%
 % serveraliases.each do |name| -%%=   ServerAlias #{name}\n %% end -%
 % elsif serveraliases != '' -%
 %=   ServerAlias #{serveraliases} -%
 % end -%
 
 
 Do any one knows  answer? I could not find the answer for this?
 
 
 -- 
 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/3d6e89bc-f8e9-4708-89d2-6f3408f14299%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/181C06F1-FFC3-4080-81C4-CB29381645DD%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Hiera doesn t behave as expected or as written in doc

2015-01-08 Thread Martin Alfke
Hi,
 On 08.01.2015, at 09:52, Raphael raphael.k...@gmail.com wrote:
 
 Hi,
 I have a working puppetmaster installed from package on an ubuntu server 
 14.04 64bits.
 I've been struggeling for a while now with hiera to achieve what it is 
 written in the doc ;
 
 My hiera version is 1.3.0
 Puppetmaster version 3.4.3
 
 My hierachy settings is quite simple, with a common file and a specific file 
 for host : 
 
 ---
 :backends:
   - yaml
   - json
 :yaml:
   :datadir: /etc/puppet/hieradata
 :json:
   :datadir: /etc/puppet/hieradata
 :hierarchy:
 
   - common
   - node/%{::fqdn}
 
 :merge_behavior: deeper
 
 This file is in /etc/puppet/ and linked to /etc/hiera.yaml
 
 In the common.yaml, I'm trying to use a variable based on facts (like in the 
 example on the official documentation) :
 
 
 smtpserver: mail.%{::domain}
 
 When I issue hiera smtpserver, I have this output :
 
 mail.

You are running the hiera command on cli?
In this case you do not have facts available.
But: you can provide facts on cli:

hiera -c /etc/hiera.yaml smtpserver domain=foobar.com http://foobar.com/

hth,

Martin

-- 
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/B29F42AF-F35C-4609-B8DE-58A91D296CAB%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


<    1   2   3   4   5   >