[Puppet Users] Re: facter details copy to central location

2017-07-26 Thread Amber Mehra
Thanks Peter,

I have created manifest to get details

On Tuesday, July 25, 2017 at 8:29:31 PM UTC+5:30, Amber Mehra wrote:
>
> Hey Guys,
>
> I have certain requirement to get puppet client inventory like "facter 
> operatingsystem, facter ipaddress, etc : copied all details to some where 
> in file on Puppet master server .
>
> Please advise
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/d7d0a65a-f1d9-444e-9e94-3395f4fbc891%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Browse PuppetDB resources

2017-07-26 Thread Jonathan Gazeley

Hi folks,

I'm trying to troubleshoot an issue about tagging and realising exported 
resources. Is there a way I can browse/view exported resources in 
PuppetDB to make sure the expected tags have been applied?


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/093a07a6-54e3-7097-47c1-29881f08871a%40bristol.ac.uk.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] puppet functions in EPP templates?

2017-07-26 Thread Christopher Wood
Would somebody mind passing a spare clue regarding the correct syntax?

I already know this works in an erb template:

<%= scope.call_function('test1::test1', ['input one!!']) %>

However this fails in an epp template:

<%= test1::test1('input two!!') %>

Unfortunately, that's about as far as I got using "puppet apply".

My stub test module (with the busted epp part commented out):

https://gist.github.com/christopherwood/b7e3b4c60a60a8088a2a42f1242df2d9

And the result with the epp part uncommented:

$ puppet apply --modulepath . test1.pp
Error: Evaluation Error: Error while evaluating a Function Call, Failed to 
parse template test1/two.epp:
  Filepath: /var/tmp/t1/test1/templates/two.epp
  Line: 1
  Detail: undefined local variable or method `test1' for 
#
 at /var/tmp/t1/test1/manifests/init.pp:6:16 on node cwl.me.com

I read these but couldn't find an obvious example, if somebody would like to 
point one out.

https://docs.puppet.com/puppet/4.10/lang_expressions.html
https://docs.puppet.com/puppet/4.10/lang_functions.html
https://docs.puppet.com/puppet/4.10/lang_template_epp.html

As far as use case, I wanted to see if it would work for potential upcoming 
module notions since parameterizable epp makes some things easier.

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


Re: [Puppet Users] puppet functions in EPP templates?

2017-07-26 Thread Christopher Wood
And sometimes it turns out the answer is obvious in retrospect once one's error 
has been posted up in public. I was doing:

file { '/tmp/tt2':
  content => template('test1/two.epp'),
}

When I actually invoke an epp template like I should, it works.

file { '/tmp/tt2':
  content => epp('test1/two.epp'),
}

We'll please attribute this to an unusual moment of dimness.

On Wed, Jul 26, 2017 at 09:50:11AM -0400, Christopher Wood wrote:
> Would somebody mind passing a spare clue regarding the correct syntax?
> 
> I already know this works in an erb template:
> 
> <%= scope.call_function('test1::test1', ['input one!!']) %>
> 
> However this fails in an epp template:
> 
> <%= test1::test1('input two!!') %>
> 
> Unfortunately, that's about as far as I got using "puppet apply".
> 
> My stub test module (with the busted epp part commented out):
> 
> https://gist.github.com/christopherwood/b7e3b4c60a60a8088a2a42f1242df2d9
> 
> And the result with the epp part uncommented:
> 
> $ puppet apply --modulepath . test1.pp
> Error: Evaluation Error: Error while evaluating a Function Call, Failed to 
> parse template test1/two.epp:
>   Filepath: /var/tmp/t1/test1/templates/two.epp
>   Line: 1
>   Detail: undefined local variable or method `test1' for 
> #
>  at /var/tmp/t1/test1/manifests/init.pp:6:16 on node cwl.me.com
> 
> I read these but couldn't find an obvious example, if somebody would like to 
> point one out.
> 
> https://docs.puppet.com/puppet/4.10/lang_expressions.html
> https://docs.puppet.com/puppet/4.10/lang_functions.html
> https://docs.puppet.com/puppet/4.10/lang_template_epp.html
> 
> As far as use case, I wanted to see if it would work for potential upcoming 
> module notions since parameterizable epp makes some things easier.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/20170726135011.aus2qeaqn7egtvns%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/20170726140537.xp7fp245qjkzxaxi%40iniquitous.heresiarch.ca.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Getting Hiera error in Puppet enterprise environment with non root account

2017-07-26 Thread Henrik Lindberg

On 24/07/17 22:37, Siva nagi reddy wrote:

Hi,

We had setup Puppet enterprise master agent environment to deploy one 
application. We setup non-root user account by following Puppet dcos to 
deploy application as we dont have permissions for root account.


1) Installed the Sample module helloworld by following below steps and 
it worked with non -root account


https://docs.puppet.com/puppet/5.0/quick_start_helloworld.html


2) Installed motd module from puppet forge and getting below error while 
installing with non -root account


Error: Could not retrieve catalog from remote server: Error 400 on 
SERVER: Evaluation Error: Error while evaluating a Resource Statement, 
Error from DataBinding 'hiera' while looking up 'motd::dynamic_motd': 
can't convert Symbol into Integer at 
/etc/puppetlabs/puppet/environments/production/manifests/site.pp:23:2 on 
node username.hostname

Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

Site .pp:

node "default" {
 class { 'helloworld': }
 class { 'helloworld::motd': }
23:class { 'motd': }
}


3) Configured my application module to install and getting below error

Error: Could not retrieve catalog from remote server: Error 400 on 
SERVER: Evaluation Error: Error while evaluating a Function Call, Error 
from DataBinding 'hiera' while looking up 'motd::dynamic_motd': can't 
convert Symbol into Integer at 
/etc/puppetlabs/puppet/environments/production/manifests/site.pp:21:2 on 
node username.hostname

Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run



node "default" {
   if $::use_hieradata == "true" {
21hiera_include('classes')
   }
}

hiera.yaml file location : /etc/puppetlabs/puppet/hiera.yaml
modules location: /etc/puppetlabs/puppet/environment/production/modules

Gone through multiple links and verified all configuration files but 
still we are not able to fix the issue. Could you please let us know if 
you have any suggestions why we are seeing this issue with non root account.


Regards,
Siva.



The stacktrace logged server side for the error may reveal more about 
the location of the problem. Also, since you are a PE user you can 
contact Puppet Support to get help.


Best,
- henrik


--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

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


Re: [Puppet Users] Error: Could not autoload puppet/type/dism: Attempt to redefine method set_present with block

2017-07-26 Thread Henrik Lindberg

On 21/07/17 08:39, Vikram Varma wrote:

Hi All,

I am getting the following error wheile running "puppet apply -v 
d:\default.pp"


Error: Could not autoload puppet/type/dism: Attempt to redefine method 
set_present with block
Error: Evaluation Error: Error while evaluating a Resource Statement, 
Could not autoload puppet/type/dism: Attempt to re
define method set_present with block at 
C:/ProgramData/PuppetLabs/code/modules/chocoserver/manifests/init.pp:8:3 
on node

  server.com

The piece of code where my error is referring is at:

   dism { 'IIS-WebServerRole':
 ensure => present,
   }

I am using puppet opensource 4.10 on Windows server 2012 server.

Any quick response would be appreciated.



Can you run that with a --trace
you will then get the full stack trace which will reveal more about what 
is going on.


Best,
- henrik


Thanks,
Vikram

--
You received this message because you are subscribed to the Google 
Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to puppet-users+unsubscr...@googlegroups.com 
.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/de9264fb-d083-41f5-af61-ff846c0fafe9%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.



--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

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


[Puppet Users] Re: Browse PuppetDB resources

2017-07-26 Thread Russell Mull
Hi Jonathan, 

You can use the PuppetDB CLI to do queries 
directly. https://docs.puppet.com/puppetdb/5.0/pdb_client_tools.html

- Russ

On Wednesday, July 26, 2017 at 3:57:37 AM UTC-7, Jonathan Gazeley wrote:
>
> Hi folks, 
>
> I'm trying to troubleshoot an issue about tagging and realising exported 
> resources. Is there a way I can browse/view exported resources in 
> PuppetDB to make sure the expected tags have been applied? 
>
> 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/f58d0f3c-14ed-4214-878e-e967248736cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Puppet newbie question.

2017-07-26 Thread Randy Gould
Hello I am a newbie with puppet 

I am trying to take a module I cobbled together to run a script

class mymodule::myscript {
  file {
'myscript':
  ensure => 'file',
  source => 'puppet:///modules/mymodule/myscript.sh',
  path => '/usr/local/bin/myscript.sh',
  owner => 'root'
  group => 'root'
  mode  => '755'
  notify => Exec['confrm'],
  }
  exec {
'myscript':
 command => '/usr/local/bin/myscript.sh',
 refreshonly => true,
  }

What I need to make is something  that does the following

1. Install a set of files (if they are not there copy them)
2. check to see if a config file exists (if not copy them)
3. populate the config file with a variable from a custom fact
4. Check to see if my script is running (restart if its not running)


Any guidance is appreciated. 

RG

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


Re: [Puppet Users] Automated PuppetDB/PostgreSQL install?

2017-07-26 Thread Keith Miller
I ended up having to do the same thing. Thanks for the guidance! 

On Monday, July 24, 2017 at 6:37:23 AM UTC-7, Andrew Grimberg wrote:
>
> On 07/22/2017 09:50 AM, Keith Miller wrote: 
> > Hey guys, new to Puppet and looking for some help. Some facts first: 
> > 
> >   * Using Ubuntu 16.04 
> >   * Cluster will be of about 60-80 nodes 
> >   * Building the infrastructure with Terraform 
> >   * Have Puppet Server and Puppet Agents installing through automated 
> > startup scripts and working. 
> > 
> > So I'm looking to see if it's possible to automate the install of 
> > PuppetDB and PostgreSQL, hopefully on the Puppet Server machine. I found 
> > multiple instructions on how to install, but they all seem to involve 
> > manual setup of the PostgreSQL database. Any help would be appreciated. 
> > 
> > Thanks! 
>
> When we were building up our Puppet infrastructure we initially 
> configured the puppet master to not use PuppetDB. Then we added in the 
> PuppetDB module and PostgreQL modules and had them properly configure 
> things. Once that was done we stepped the puppet master into using 
> PuppetDB. 
>
> -Andy- 
>
>

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


Re: [Puppet Users] Automated PuppetDB/PostgreSQL install?

2017-07-26 Thread Keith Miller
It could, I don't know. I'm new to Puppet so installing PuppetDB as a 
module before Puppet Server was installed was very confusing starting out. 
I ended up writing a Bash script following Andrew Grimberg's flow. 

Thanks

On Sunday, July 23, 2017 at 2:27:17 AM UTC-7, Lowe Schmidt wrote:
>
> Doesn't the puppetdb module do what you want? 
> https://forge.puppet.com/puppetlabs/puppetdb#setup
>
> --
> Lowe Schmidt | +46 723 867 157
>
> On 22 July 2017 at 18:50, Keith Miller > 
> wrote:
>
>> Hey guys, new to Puppet and looking for some help. Some facts first:
>>
>>- Using Ubuntu 16.04
>>- Cluster will be of about 60-80 nodes
>>- Building the infrastructure with Terraform
>>- Have Puppet Server and Puppet Agents installing through automated 
>>startup scripts and working.
>>
>> So I'm looking to see if it's possible to automate the install of 
>> PuppetDB and PostgreSQL, hopefully on the Puppet Server machine. I found 
>> multiple instructions on how to install, but they all seem to involve 
>> manual setup of the PostgreSQL database. Any help would be appreciated. 
>>
>> 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/6a57ce96-c30a-478d-aeaf-0c7d230ffc24%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/6021ae49-cc42-4897-80d6-50a22ca53480%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Puppet agent 1.10.5 released

2017-07-26 Thread Jorie Tappa
Today, we released Puppet agent 1.10.5.

This release includes mostly bug fixes for Puppet and Facter, and adds
package support for a few new platforms.

Read the Puppet agent 1.10.5 release notes:
https://docs.puppet.com/puppet/4.10/release_notes_agent.html#puppet-agent-1105
Read the Puppet 4.10.5 release notes:
https://docs.puppet.com/puppet/4.10/release_notes.html#puppet-4105

--
Jorie Tappa
Technical Writer @ Puppet

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