Re: [Puppet Users] Virtual resources ?

2016-03-31 Thread Jakov Sosic

On 03/31/2016 05:40 PM, Martin Alfke wrote:

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


Thanks!

I've decided to stick with create_resources :)

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


[Puppet Users] Announce Strings 0.4.0 Released

2016-03-31 Thread Hailee Kenney
We’re excited to announce the latest release of the puppet strings
documentation tool! Puppet strings 0.4.0 is a backwards compatible minor
release. It includes bug fixes as well as a new feature that produces a
JSON representation of a module. It’s also the first version of puppet
strings to be release as a ruby gem, and the last version that will be
released as a puppet module. After some discussion, it seemed clear that a
ruby gem is a preferable distribution method, so going forward, all new
releases will only be distributed via the gem.

Shout out to language team intern Ian Kronquist for the awesome new JSON
feature, and community member David Danzilio for doing the work to make the
gem release possible.

* The CHANGELOG can be found here:
https://github.com/puppetlabs/puppetlabs-strings/blob/master/CHANGELOG.md

* The module can be found on the Forge here:
https://forge.puppetlabs.com/puppetlabs/strings

* The ruby gem can be found here: https://rubygems.org/gems/puppet-strings

* Installation and usage instructions can be found here:
https://github.com/puppetlabs/puppetlabs-strings/blob/master/README.md


To track issues related to this release or file new issues, check out the
PDOC JIRA project:

* JIRA Project: https://tickets.puppetlabs.com/browse/PDOC

* Fixes for 0.4.0: https://tickets.puppetlabs.com/issues/?filter=18810


-- 
Hailee Kenney
hai...@puppetlabs.com
Software Developer, Puppet Labs

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


Re: [Puppet Users] Could not find default node or by name with 'vm7012.muc.baag, if not defined in manifests/node.pp

2016-03-31 Thread Chad Huneycutt
Per https://docs.puppetlabs.com/puppet/3.7/reference/lang_node_definitions.html

"If site.pp contains at least one node definition, it must have one
for every node"

if you want the default behavior to be to just pull in classes from
hiera, then I would recommend wrapping your hiera_include in the
default node definition:

node default {
  hiera_include('classes')
}

On Thu, Mar 31, 2016 at 9:23 AM, Andreas Dvorak
 wrote:
> Dear all
>
> if I do not list a server in the directory manifests e.g. in nodes.pp the
> agent says:
> puppet agent -t
> Info: Retrieving pluginfacts
> Info: Retrieving plugin
> Info: Loading facts
> Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
> Could not find default node or by name with 'vm7012.muc.baag, vm7012.muc,
> vm7012' on node vm7012.muc.baag
> Warning: Not using cache on failed catalog
> Error: Could not retrieve catalog; skipping run
>
> I know that is should work, because I have got it on an other Puppet Master
> server.
> How can to solve that? It should be ignored that the server is not listed.
>
> cat site.pp
> if versioncmp($::puppetversion, '3.6.0') >= 0 {
>   Package {
> allow_virtual => true,
>   }
> }
> hiera_include('classes')
>
> cat hiera/common.yaml
> classes:
>   - profiles::base
>
> Puppet 3.7.5
>
> 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/84c946c7-1b6b-40ea-8a7c-853596f86f4a%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Chad M. Huneycutt

-- 
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/CAOJfo16Jc9Ro5F3mULvJDGr8mOpQbCjL1rPhEE9qPGvYfNf6XA%40mail.gmail.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  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 Jakov Sosic

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 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.


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] Use nodes with defined resource in nginx configuration

2016-03-31 Thread Justin Rowles
Hi Gareth,

I'd be interested on your feedback with a gem that we at BGCH have just 
released: bgch-hiera-consul.  It's on rubygems.

It's derived from lynxman's hiera-consul, but the behaviour is different. 
 It permits storing yaml and/or json as a value and parses it for hiera 
variables.

Hope you like it!

Justin.

On Tuesday, 19 January 2016 12:39:11 UTC, garethr wrote:
>
> On 19 January 2016 at 11:34, Lowe Schmidt  > wrote: 
> > Exported resources would accomplish what you are trying to do, as long 
> as 
> > you don't often and rapidly remove and add upstream app-hosts. 
> > 
>
> If you find you do want to change things more rapidly, integrating 
> with a service discovery mechanism is a nice approach. 
>
> This repo, and accompanying presentation I gave last year demonstrate 
> using Consul, along with the Consul module and Hiera backend to 
> accomplish dynamic changes to configuration of an nginx upstream. The 
> demo uses Puppet Enterprise but the approach is general purpose, and 
> the modules are all open source and from the wider Puppet community. 
>
> https://github.com/puppetlabs/puppet-enterprise-consul-docker-demo 
>
> https://speakerdeck.com/garethr/service-discovery-and-configuration-management
>  
>
> The key trick is to use some sort of watcher (in my case the build-in 
> consul watcher setup using the ::consul::watch Puppet type) to detect 
> changes across the cluster as they happen and to run Puppet to update 
> the proxy straight away. 
>
> Gareth 
>
>
> > -- 
> > Lowe Schmidt | +46 723 867 157 
> > 
> > On 18 January 2016 at 14:29, Frederik Bjerggaard Nielsen <
> f...@firstcom.dk > 
> > wrote: 
> >> 
> >> Hi, 
> >> 
> >> I am working on making our puppet infrastructure more dynamic where I 
> can 
> >> add any number of nodes and these will automatically be applied in 
> another 
> >> nodes configuration. 
> >> 
> >> An example: 
> >> I have X number of hosts running a Java application, which are defined 
> by 
> >> our javaapp module with the following define in it (simplified): 
> >> 
> >> define javaapp::site ( 
> >>   $site_name, 
> >>   $site_port ) { 
> >>   # Doing some stuff regarding deployment etc here 
> >> } 
> >> 
> >> These are defined in the site.pp file like this: 
> >> 
> >> javaapp::site { 'app01': 
> >>   play_site_name=> 'app01', 
> >>   play_site_port=> 9100, 
> >> } 
> >> 
> >> We have a nginx reverse proxy in front of these application servers 
> where 
> >> I need to forward requests to a range of servers. Currently my nginx 
> >> template looks like this: 
> >> 
> >> upstream app-hosts { 
> >>   server <%= @host_app_01 %>:9100; 
> >>   server <%= @host_app_02 %>:9100; 
> >> } 
> >> 
> >> Where @host_app_01 and @host_app_02 have been defined globally in the 
> >> site.pp file with the IP of the nodes. 
> >> 
> >> What I would like to do is to collect an array of the nodes with a 
> >> specific javaapp site name and use it in the nginx template. 
> >> 
> >> I have read a little about exported resources, but I can't figure out 
> >> whether it is the right thing for this situation? 
> >> 
> >> Is it even possible to do with puppet? 
> >> 
> >> We are running puppet version 3.7.5. 
> >> 
> >> Thanks in advance. 
> >> 
> >> Regards 
> >> Frederik Nielsen 
> >> 
> >> -- 
> >> 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/a3bcb7c2-f8bb-4b4b-a901-a328662e2266%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/CAC-wWcQTTqcZe1x3rfswQmTyV1pzMKNcMSFe5RHNZtCB43Q8pw%40mail.gmail.com.
>  
>
> > 
> > For more options, visit https://groups.google.com/d/optout. 
>
>
>
> -- 
> Gareth Rushgrove 
> @garethr 
>
> devopsweekly.com 
> morethanseven.net 
> garethrushgrove.com 
>

-- 
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/01c0d4a6-8db4-4ece-929c-c5e679147279%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] unable to create home directory

2016-03-31 Thread warron.french
Isn't .ssh created after the first time a user attempts an SSH outbound
connection, not at initial creation of homedirs?

--
Warron French


On Thu, Mar 31, 2016 at 4:56 AM, Patrick G.  wrote:

> Nope …
> With new users this should create the directory.
>
> The debug log shows:
>
> Debug: Creating /home/admin/.ssh
>
>
> But it doesn’t create it.
>
> Gr. Patrick.
>
> On 29 mrt. 2016, at 17:09, Lowe Schmidt  wrote:
>
> > Notice: /Stage[main]/Ssh/Ssh_authorized_key[admin]/ensure: created
> > Debug: Creating /home/admin/.ssh
> > Error: /Stage[main]/Ssh/Ssh_authorized_key[admin]: Could not evaluate:
> No such file > or directory - /home/admin/.ssh
>
> Well, does the directory /home/admin/.ssh exist?
>
> --
> Lowe Schmidt | +46 723 867 157
>
> On 29 March 2016 at 16:44, Patrick G.  wrote:
>
>> Hi,
>>
>> I am using # puppet-module-ssh
>>
>> In the yaml file I have:
>>
>> ssh::keys:
>>   admin:
>> ensure: present
>> user: admin
>> type: dsa
>> key: ...==
>>
>> But when running puppet agent I get:
>>
>> Notice: /Stage[main]/Ssh/Ssh_authorized_key[admin]/ensure: created
>> Debug: Creating /home/admin/.ssh
>> Error: /Stage[main]/Ssh/Ssh_authorized_key[admin]: Could not evaluate: No
>> such file or directory - /home/admin/.ssh
>>
>>
>>
>>
>> --
>> 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/892b9b3a-30b3-47e5-8c0f-1e52a2309179%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/CAC-wWcRByycxjrkvWMWrOhX7EiVGLxrsQ7z2zx8m8%3DBt7Wc6Mg%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/3BE51F3A-023A-46F8-AF09-881F68CA5E92%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/CAJdJdQmskCXwetBENJUg5TBEUh0%2Buwkivz9ODNhxRS-ZbYMDyA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Puppet, Hiera, and Consul

2016-03-31 Thread Justin Rowles
For those who would like to expand their use of Hiera to talk to a Consul 
server/cluster, British Gas Connected Home have made available a gem called 
bgch-hiera-consul on rubygems.

It derives from lynxman's hiera-consul, but works somewhat differently.  

It fulfils the hiera_hash and hiera_array functionality, and does all 
parsing of data in Consul value stores for you.  Thus you can embed 
(currently) json or yaml directly and bgch-hiera-consul will populate your 
hiera variables (and thus puppet class parameters) for all of the sub 
entries.

We use this, currently, for our development clusters, where we want to have 
a quick turnaround in our puppet process.  Instead of editing yaml files, 
we can manually or  automatically push values to our Consul store, and 
puppet will pick them up on the next run.

Source and sample code are at https://github.com/ConnectedHomes/hiera-consul

Any feedback, whether in questions, PRs, or complaints, will be appreciated.

Justin.

-- 
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/be70fdcf-b29f-413c-bbed-4b41c648cadd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: fqdn fact is set to "localhost" at boot time

2016-03-31 Thread jcbollinger


On Wednesday, March 30, 2016 at 4:48:47 PM UTC-5, Dave Alden wrote:
>
> Hi,
>I'm running into a problem with puppet agent on my Mac's.  I have ~200 
> mac's and when they reboot, a few of them (typically 5-10) have problems 
> where the "fqdn" fact is set to "localhost" (as is the "hostname" fact).  
> This causes them to try to request a new cert using the certname "localhost" 
> and therefore puppet (which is run by launchd) never works (it just sits 
> there printing "Notice: Did not receive certificate" every 2 minutes .  I 
> have a few "hacks" that I've thought of to fix this, but I'm not a fan of 
> them:
>
> 1)  Write a script that runs every  minutes looking at the puppet.log file 
> to see if the last few lines contains "Did not receive certificate" and 
> unload/load puppet.
>
> 2) Write a wrapper for puppet that makes sure the network is up (and the fqdn 
> is returning a true fqdn) before it starts puppet.
>
> 3) Set the "certname" in puppet.conf -- I don't like this because we rename 
> hosts kind of often and we want their certname to be their fqdn.  I don't 
> want to add another step ("don't forget to login and edit the puppet.conf 
> file before you rename the computer").
>
> I'd much prefer to figure out how to properly fix this (as I would expect 
> that no one really wants the fqdn fact to be "localhost" :) - any suggestions?
>
> ...dave
>
>

If your machines rely on the network to determine their hostnames, and 
Puppet is configured to use the hostname as certname (as it is by default), 
then it follows that you cannot successfully perform Puppet catalog runs 
until the network is up and the machine has determined (or maybe just can 
determine) its own hostname.  I'm not well versed in OS X service 
management, which in any case I understand has changed somewhat over time, 
but surely it has a conventional idiom for expressing that sort of 
dependency.

Alternatively, and perhaps a bit quicker and dirtier, you could run the 
agent via an external scheduler instead of as a daemon in its own right 
(i.e. with --onetime --no-daemonize).  This has a lot of advantages, one of 
the lesser being that if the agent does issue a certificate request, it 
will do so only once per scheduled run (and fail the run if it does not 
receive the requested cert).  Supposing that you can rely on the network 
eventually coming up, and the machines learning their correct hostnames, 
the problem will go away (on a per-machine, per-boot basis) once that 
happens.  Overall, you will see far fewer cert-request errors logged.


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/e06d9dd8-b223-43ff-b21f-1d6dd35737ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] unable to create home directory

2016-03-31 Thread jcbollinger


On Thursday, March 31, 2016 at 7:13:30 AM UTC-5, Patrick G. wrote:
>
> /home does exists but /home/admin doesn’t because it is a new user.
>
> How should I give puppet permission to create this directory?
>


It's unclear whether you need to give Puppet permission, whether you need 
to give it an additional resource to manage, or whether you just need to 
instruct Puppet to manage resources in a different relative order.  I'd 
rate a permission problem the least likely of those possibilities.

If you expect the new user's home directory to be created as part of the 
process of creating a new user under Puppet management, then

   1. the relevant User resource must be synced before any ssh key 
   attributed to them, and
   2. that resource's parameters should specify that the user home 
   directory is to be managed.
   
You have not the module you are using well enough for me to distinguish it 
from the dozens of other SSH modules, but your log excerpt shows it using 
the standard Ssh_authorized_key resource type.  That type automatically 
causes the key's associated user to be managed before the key itself if 
that user is in fact under management as a User resource, so I conclude 
that either there is no such User in the catalog all (in which case I'm 
uncertain why you characterize the context as creating a new user) or else 
that User is not configured as you need it to be.

For example, for this to work properly in conjunction with creating a new 
user, you might need the relevant User resource to be configured with *at 
least* these properties and parameters:

user { 'admin':
  ensure => 'present',
  uid=> 1, # or whatever
  gid=> 1, # or whatever
  home   => '/home/admin',
  managehome => true
}

Alternatively, if your local user management subsystem does not support 
managing user home directories directly in concert with creating users, 
then you might need to manage the home directory explicitly, as a File 
resource.  In that case you will want to specify a relationship between 
that File and the User or Ssh::Key that causes the home directory to be 
managed first.

If you do have a permission problem after all, however, then in order to 
solve it you need to understand its nature.  Are there mandatory access 
controls (i.e. SELinux policy) preventing Puppet from doing what it needs 
to do?  Is /home on a remote file system that squashes root privileges?  Is 
puppet running as an unprivileged user?  There may be other possibilities.  
You can't solve such a problem without knowing in some detail what the 
problem is.


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/19307bc1-64db-40d2-8558-485993edcc4f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Could not find default node or by name with 'vm7012.muc.baag, if not defined in manifests/node.pp

2016-03-31 Thread Andreas Dvorak
Dear all

if I do not list a server in the directory manifests e.g. in nodes.pp the 
agent says:
puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Could not find default node or by name with 'vm7012.muc.baag, vm7012.muc, 
vm7012' on node vm7012.muc.baag
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

I know that is should work, because I have got it on an other Puppet Master 
server.
How can to solve that? It should be ignored that the server is not listed.

cat site.pp
if versioncmp($::puppetversion, '3.6.0') >= 0 {
  Package {
allow_virtual => true,
  }
}
hiera_include('classes')

cat hiera/common.yaml
classes:
  - profiles::base

Puppet 3.7.5

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/84c946c7-1b6b-40ea-8a7c-853596f86f4a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] unable to create home directory

2016-03-31 Thread Lowe Schmidt
Are you creating the user with puppet or do you have something like LDAP or
AD that manages users and access for you?



--
Lowe Schmidt | +46 723 867 157

On 31 March 2016 at 14:13, Patrick G.  wrote:

> /home does exists but /home/admin doesn’t because it is a new user.
>
> How should I give puppet permission to create this directory?
>
> On 31 mrt. 2016, at 13:14, Chad Huneycutt 
> wrote:
>
> That is actually where it is failing. Does /home and /home/admin exist?
> Does puppet have permission to create it?
>
>
> On Thursday, March 31, 2016, Patrick G.  wrote:
>
>> Nope …
>> With new users this should create the directory.
>>
>> The debug log shows:
>>
>> Debug: Creating /home/admin/.ssh
>>
>>
>> But it doesn’t create it.
>>
>> Gr. Patrick.
>>
>> On 29 mrt. 2016, at 17:09, Lowe Schmidt  wrote:
>>
>> > Notice: /Stage[main]/Ssh/Ssh_authorized_key[admin]/ensure: created
>> > Debug: Creating /home/admin/.ssh
>> > Error: /Stage[main]/Ssh/Ssh_authorized_key[admin]: Could not evaluate:
>> No such file > or directory - /home/admin/.ssh
>>
>> Well, does the directory /home/admin/.ssh exist?
>>
>> --
>> Lowe Schmidt | +46 723 867 157
>>
>> On 29 March 2016 at 16:44, Patrick G.  wrote:
>>
>>> Hi,
>>>
>>> I am using # puppet-module-ssh
>>>
>>> In the yaml file I have:
>>>
>>> ssh::keys:
>>>   admin:
>>> ensure: present
>>> user: admin
>>> type: dsa
>>> key: ...==
>>>
>>> But when running puppet agent I get:
>>>
>>> Notice: /Stage[main]/Ssh/Ssh_authorized_key[admin]/ensure: created
>>> Debug: Creating /home/admin/.ssh
>>> Error: /Stage[main]/Ssh/Ssh_authorized_key[admin]: Could not evaluate:
>>> No such file or directory - /home/admin/.ssh
>>>
>>>
>>>
>>>
>>> --
>>> 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/892b9b3a-30b3-47e5-8c0f-1e52a2309179%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/CAC-wWcRByycxjrkvWMWrOhX7EiVGLxrsQ7z2zx8m8%3DBt7Wc6Mg%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/3BE51F3A-023A-46F8-AF09-881F68CA5E92%40gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> Chad M. Huneycutt
>
> --
> 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/CAOJfo14KifBoF3pF0ZF8R1Ksweg1w_Ywws7vMYyhPrzMs_btPQ%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/9E9CAD75-F49E-4D9F-B237-390FF0F86BDE%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 

Re: [Puppet Users] unable to create home directory

2016-03-31 Thread Patrick G.
/home does exists but /home/admin doesn’t because it is a new user.

How should I give puppet permission to create this directory?

> On 31 mrt. 2016, at 13:14, Chad Huneycutt  wrote:
> 
> That is actually where it is failing. Does /home and /home/admin exist?  Does 
> puppet have permission to create it?
> 
> 
> On Thursday, March 31, 2016, Patrick G.  > wrote:
> Nope …
> With new users this should create the directory.
> 
> The debug log shows:
>> Debug: Creating /home/admin/.ssh
> 
> But it doesn’t create it.
> 
> Gr. Patrick.
> 
>> On 29 mrt. 2016, at 17:09, Lowe Schmidt > > wrote:
>> 
>> > Notice: /Stage[main]/Ssh/Ssh_authorized_key[admin]/ensure: created
>> > Debug: Creating /home/admin/.ssh
>> > Error: /Stage[main]/Ssh/Ssh_authorized_key[admin]: Could not evaluate: No 
>> > such file > or directory - /home/admin/.ssh
>> 
>> Well, does the directory /home/admin/.ssh exist? 
>> 
>> 
>> --
>> Lowe Schmidt | +46 723 867 157
>> 
>> On 29 March 2016 at 16:44, Patrick G. > > wrote:
>> Hi,
>> 
>> I am using # puppet-module-ssh
>> 
>> In the yaml file I have:
>> 
>> ssh::keys:
>>   admin:
>> ensure: present
>> user: admin
>> type: dsa
>> key: ...==
>> 
>> But when running puppet agent I get:
>> 
>> Notice: /Stage[main]/Ssh/Ssh_authorized_key[admin]/ensure: created
>> Debug: Creating /home/admin/.ssh
>> Error: /Stage[main]/Ssh/Ssh_authorized_key[admin]: Could not evaluate: No 
>> such file or directory - /home/admin/.ssh
>> 
>> 
>> 
>> 
>> -- 
>> 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/892b9b3a-30b3-47e5-8c0f-1e52a2309179%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/CAC-wWcRByycxjrkvWMWrOhX7EiVGLxrsQ7z2zx8m8%3DBt7Wc6Mg%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/3BE51F3A-023A-46F8-AF09-881F68CA5E92%40gmail.com
>  
> .
> For more options, visit https://groups.google.com/d/optout 
> .
> 
> 
> -- 
> Chad M. Huneycutt
> 
> -- 
> 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/CAOJfo14KifBoF3pF0ZF8R1Ksweg1w_Ywws7vMYyhPrzMs_btPQ%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 

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.


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

2016-03-31 Thread Afroz Hussain
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.


[Puppet Users] Resources sharing across different classes.

2016-03-31 Thread Afroz Hussain
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/3136ea33-94d7-47cd-9948-1b9dfe54de64%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] unable to create home directory

2016-03-31 Thread Chad Huneycutt
That is actually where it is failing. Does /home and /home/admin exist?
Does puppet have permission to create it?


On Thursday, March 31, 2016, Patrick G.  wrote:

> Nope …
> With new users this should create the directory.
>
> The debug log shows:
>
> Debug: Creating /home/admin/.ssh
>
>
> But it doesn’t create it.
>
> Gr. Patrick.
>
> On 29 mrt. 2016, at 17:09, Lowe Schmidt  > wrote:
>
> > Notice: /Stage[main]/Ssh/Ssh_authorized_key[admin]/ensure: created
> > Debug: Creating /home/admin/.ssh
> > Error: /Stage[main]/Ssh/Ssh_authorized_key[admin]: Could not evaluate:
> No such file > or directory - /home/admin/.ssh
>
> Well, does the directory /home/admin/.ssh exist?
>
> --
> Lowe Schmidt | +46 723 867 157
>
> On 29 March 2016 at 16:44, Patrick G.  > wrote:
>
>> Hi,
>>
>> I am using # puppet-module-ssh
>>
>> In the yaml file I have:
>>
>> ssh::keys:
>>   admin:
>> ensure: present
>> user: admin
>> type: dsa
>> key: ...==
>>
>> But when running puppet agent I get:
>>
>> Notice: /Stage[main]/Ssh/Ssh_authorized_key[admin]/ensure: created
>> Debug: Creating /home/admin/.ssh
>> Error: /Stage[main]/Ssh/Ssh_authorized_key[admin]: Could not evaluate: No
>> such file or directory - /home/admin/.ssh
>>
>>
>>
>>
>> --
>> 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/892b9b3a-30b3-47e5-8c0f-1e52a2309179%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/CAC-wWcRByycxjrkvWMWrOhX7EiVGLxrsQ7z2zx8m8%3DBt7Wc6Mg%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/3BE51F3A-023A-46F8-AF09-881F68CA5E92%40gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Chad M. Huneycutt

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


Re: [Puppet Users] Re: Variables inside variables

2016-03-31 Thread Jonathan Gazeley

Great, thanks!

On 31/03/16 11:21, Daniel Sung wrote:

I achieve this by using the getvar function in stdlib. For example:

getvar("::network_${::gateway_dev}")

Regards,
Daniel

On Thursday, 31 March 2016 11:04:45 UTC+1, Jonathan Gazeley wrote:

Hi folks,

Short version:

I want to use a variable inside a variable to access a fact. Is this
possible?

Long version:

Facter provides facts $::ipaddress and $::netmask which figure out
which
is your primary interface and then return values like $::ipaddress_eth0
and $::netmask_eth0. However there is not a $::network fact to reflect
$::network_eth0.

I have a custom fact $::gateway_dev which returns the name of the
primary interface. Is it possible to access the variable like
${::network_${::gateway_dev}} ?

Thanks,
Jonathan

--
Jonathan Gazeley
Senior Systems Administrator
IT Services
University of Bristol

--
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/44689bb5-7eff-4a03-ac80-095c5948eaaa%40googlegroups.com
.
For more options, visit https://groups.google.com/d/optout.



--
Jonathan Gazeley
Senior Systems Administrator
IT Services
University of Bristol

--
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/56FCFF95.8010205%40bristol.ac.uk.
For more options, visit https://groups.google.com/d/optout.


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

2016-03-31 Thread 'Manuela Atoui' via Puppet Users
Hello Henrik, hello Martin,

thank you both for your input, it really helped!
Was a bit stuck on this...

Best regards and have a nice day,

Manuela Atoui

-- 
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/891efca9-e0b9-41ad-bfda-c6e16b3f7ff7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Variables inside variables

2016-03-31 Thread Daniel Sung
I achieve this by using the getvar function in stdlib. For example:

getvar("::network_${::gateway_dev}")

Regards,
Daniel

On Thursday, 31 March 2016 11:04:45 UTC+1, Jonathan Gazeley wrote:
>
> Hi folks, 
>
> Short version: 
>
> I want to use a variable inside a variable to access a fact. Is this 
> possible? 
>
> Long version: 
>
> Facter provides facts $::ipaddress and $::netmask which figure out which 
> is your primary interface and then return values like $::ipaddress_eth0 
> and $::netmask_eth0. However there is not a $::network fact to reflect 
> $::network_eth0. 
>
> I have a custom fact $::gateway_dev which returns the name of the 
> primary interface. Is it possible to access the variable like 
> ${::network_${::gateway_dev}} ? 
>
> Thanks, 
> Jonathan 
>
> -- 
> Jonathan Gazeley 
> Senior Systems Administrator 
> IT Services 
> University of Bristol 
>

-- 
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/44689bb5-7eff-4a03-ac80-095c5948eaaa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Variables inside variables

2016-03-31 Thread Jonathan Gazeley

Hi folks,

Short version:

I want to use a variable inside a variable to access a fact. Is this 
possible?


Long version:

Facter provides facts $::ipaddress and $::netmask which figure out which 
is your primary interface and then return values like $::ipaddress_eth0 
and $::netmask_eth0. However there is not a $::network fact to reflect 
$::network_eth0.


I have a custom fact $::gateway_dev which returns the name of the 
primary interface. Is it possible to access the variable like 
${::network_${::gateway_dev}} ?


Thanks,
Jonathan

--
Jonathan Gazeley
Senior Systems Administrator
IT Services
University of Bristol

--
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/56FCF631.2060508%40bristol.ac.uk.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] unable to create home directory

2016-03-31 Thread Patrick G.
Nope …
With new users this should create the directory.

The debug log shows:
> Debug: Creating /home/admin/.ssh

But it doesn’t create it.

Gr. Patrick.

> On 29 mrt. 2016, at 17:09, Lowe Schmidt  wrote:
> 
> > Notice: /Stage[main]/Ssh/Ssh_authorized_key[admin]/ensure: created
> > Debug: Creating /home/admin/.ssh
> > Error: /Stage[main]/Ssh/Ssh_authorized_key[admin]: Could not evaluate: No 
> > such file > or directory - /home/admin/.ssh
> 
> Well, does the directory /home/admin/.ssh exist? 
> 
> 
> --
> Lowe Schmidt | +46 723 867 157
> 
> On 29 March 2016 at 16:44, Patrick G.  > wrote:
> Hi,
> 
> I am using # puppet-module-ssh
> 
> In the yaml file I have:
> 
> ssh::keys:
>   admin:
> ensure: present
> user: admin
> type: dsa
> key: ...==
> 
> But when running puppet agent I get:
> 
> Notice: /Stage[main]/Ssh/Ssh_authorized_key[admin]/ensure: created
> Debug: Creating /home/admin/.ssh
> Error: /Stage[main]/Ssh/Ssh_authorized_key[admin]: Could not evaluate: No 
> such file or directory - /home/admin/.ssh
> 
> 
> 
> 
> -- 
> 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/892b9b3a-30b3-47e5-8c0f-1e52a2309179%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/CAC-wWcRByycxjrkvWMWrOhX7EiVGLxrsQ7z2zx8m8%3DBt7Wc6Mg%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/3BE51F3A-023A-46F8-AF09-881F68CA5E92%40gmail.com.
For more options, visit https://groups.google.com/d/optout.