Re: [Puppet Users] Augeas: Skipping because no files were changed

2015-07-08 Thread Chris Lee
Thanks Ian,

I had tried with and without the context, also tried with set and setm, 
tried to include the values first... but nothing worked.

I was about to go insane and through to remove the trailing slash in the 
changes... 

augeas { 'grub.conf/8250_LAR':
incl => '/etc/grub.conf',
lens=> 'Grub.lns',
changes => [
'set title[1]/kernel/8250.nr_uarts 4',
'set title[1]/kernel/8250_core.nr_uarts 4',
],
}
 and now it works, with and without the context.. but I'll put it back in 
anyway just in case.

Thanks!

Chris


On Wednesday, 8 July 2015 05:23:59 UTC+2, ianm wrote:
>
>
>
> Actually in this case it needs: 
>
>context => '/files/boot/grub/grub.conf', 
>
> or: 
>
>context => '/files/etc/grub.conf', 
>incl => '/etc/grub.conf', 
>
>
> -- 
> Ian 
>

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


Re: [Puppet Users] how to use file resource with source file name unknown

2015-07-08 Thread Andreas Dvorak
Hi,

thank for the help.
I have solved the issue with the generate funktion.
  $redhatfiles = generate("/bin/bash","-c","/bin/ls 
/data/git/${zweig}/modules/networking/files/${::hostname}/network-scripts 
2>/dev/null | tr -t '\n' ':'")
  $redhat_interfaces = split($redhatfiles, ":")
  redhat::create_interface { $redhat_interfaces: }

Unfortunately spaces are not allowed in the generate funktion. But I have 
found a solution.
https://projects.puppetlabs.com/issues/5481

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/17dad4e1-1169-45a5-aeba-db4782a457c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] how to use file resource with source file name unknown

2015-07-08 Thread jcbollinger


On Tuesday, July 7, 2015 at 8:54:54 AM UTC-5, Christopher Wood wrote:
>
> In your place I would probably use a fact to get the names, see inline. 
> Fair warning that I haven't tested any of this. It may even damage your 
> server as written! 
>

I read the OP as saying that the list of files was dictated by the catalog 
compiler, not the client.  It makes little difference if those happen to be 
the same machine (i.e. with 'puppet apply'), but in a master / agent setup 
the difference is profound.  Facts are evaluated on the client, so if 
indeed the file list is governed by a Puppet master then facts cannot do 
the job in any reasonable way.


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/49883b7d-a49c-418c-9ad0-42ef239474ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: hiera and puppet environments ( directory)

2015-07-08 Thread PAN
Hi Rob ,

On the puppet agent node, when I try to install ssh packages it is failing 
with "Error 400 on SERVER: Evaluation Error: Error while evaluating a 
Function Call, 
Could not find data item ssh_packages in any Hiera data file" error.
puppet agent -t works fine when modules does not contain hiera look ups. 
The issue seems hiera looksups is not working for puppet client/agent node.

However hiera lookups and ssh_packages working fine on master node when I 
use puppet apply -e 'include openssh:sshclient' module

Both puppet master and puppet client are using
# puppet --version
3.8.0 (Puppet Enterprise 3.8.0),

# hiera -v
1.3.4

On master node:
___

[root@pupmaster manifests]# puppet apply -e 'include openssh::sshclient'
Notice: Compiled catalog for pupmaster-dpallipa.idc.oracle.com in 
environment production in 5.77 seconds
Notice: /Stage[main]/Openssh::Sshclient/Package[openssh-ldap]/ensure: 
created
Notice: Finished catalog run in 20.13 seconds
[root@pupmaster manifests]#
__

# cat /etc/hiera.yaml
 Hiera to search yaml files #
:backends:
 - yaml

:hierarchy:
# - "%{operatingsystem}"
 - "%{osfamily}"
 - common
 - defaults
:yaml:
:datadir: /var/lib/hiera/
__
# cd /var/lib/hiera/
# ls
common.yaml  defaults.yaml  RedHat.yaml

#cat RedHat.yaml
permitt_root_login: 'yes'
ssh_service: 'sshd'
ssh_packages:
- 'openssh-ldap'
- 'openssh'
- 'openssh-clients'
- 'openssh-server'
__
# cat common.yaml
permit_root_login: 'no'
-
# cat defaults.yaml
environment: production
---

My ssh package instal module:
# cat sshclient.pp
class openssh::sshclient {
$ssh_packages=hiera('ssh_packages')
$permit_root_login=hiera('permitt_root_login')
 $sshservice=hiera('ssh_service')

package {$ssh_packages:
ensure => 'present',
before => File['/etc/ssh/sshd_config'],
}

file {'/etc/ssh/sshd_config':
ensure => present,
owner => 'root',
group => 'root',
mode => '0600',
content => template('openssh/sshd_config.erb'),
}

service {$sshservice:
subscribe => File['/etc/ssh/sshd_config'],
ensure => running,
enable => true,
hasstatus => true,
hasrestart => true,
}
}


On puppetclient/agent node:
---

[root@pupclient2

.
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Evaluation Error: Error while evaluating a Function Call, Could not find 
data item ssh_packages in any Hiera data file and no default supplied at 
/etc/puppetlabs/puppet/environments/production/modules/openssh/manifests/sshclient.pp:2:16
 
on node pupclient2.
Error: Could not retrieve catalog; skipping run
[root@pupclient2
-

Is there anything I am missing here /any thing I need to enable to make 
puppet agent to work fine with hiera.

Thanks,

On Friday, June 19, 2015 at 2:13:30 PM UTC+5:30, Helen Paterson wrote:
>
> Hi,
>
> I'm trying to set-up puppet environment so that our ymal files can 
> usernames and passwords for Production and test ( dq), modules will be the 
> same. I have run through the documentation but am getting the following 
> error:
>
> client error
>
> Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
> Could
> not find data item classes in any Hiera data file and no default supplied 
> at /e
> tc/puppet/environments/dq/manifests/windows-servers.pp:54 on node 
> hp-test2008r2.
>
>
> debug from master
> Cannot find datafile /var/lib/hiera/
>
>
> I don't understand why puppet is looking in  /var/lib/hiera/.  before 
> setting up environments hiera was working and looking at 
> /etc/puppethiera.yaml but default
>
>
> hiera.yaml 
> :datadir: '/etc/puppet/environments/%{::environment}/hieradata'
>
>
>
>
>

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


[Puppet Users] Re: How to make service start depend on a file existing

2015-07-08 Thread jcbollinger


On Tuesday, July 7, 2015 at 8:21:48 PM UTC-5, Mark Kirkwood wrote:
>
> I would like to prevent a service starting until a certain file exists. 
> The wrinkle is that the file is not (directly) created by puppet. 
>
> I'm thinking that I want to somehow 'declare' the file to puppet without 
> *it* trying to create it, and the use something like: 
>
> File["the-file"] -> Service["the-service"] 
>
> to make sure the service get started after the file is created. However 
> I'm stumped at the first bit (the file 'declare' idea). Any thoughts? 
>


Puppet doesn't work that way.  You cannot use a reference to an unmanaged 
resource (i.e. File["the-file"]).  It does not anyway make sense to 
establish a relationship to such a resource; at best it would be 
meaningless.  A resource relationship describes an order-of-application 
dependency.  What's Puppet supposed to do with that if one of the resources 
involved is not scheduled to be applied at all?

There may be hope, however.  You emphasize that the file is not *directly* 
created by Puppet, but that implies that it is indirectly created by 
Puppet, as a side effect of managing some other resource.  If you can rely 
on that other resource to fail in the event that it does not create or 
appropriately modify the file in question, then make that the other end of 
the relationship, maybe

package { 'the-service-package': }
->
service { 'the-service': }

Otherwise, interpose an Exec between the two that tests for the existence 
(or any other property) of the file:

package { 'the-service-package': ensure => 'latest' }
->
exec { 'ensure the-file is present': command => 'test -e the-file' }
->
service { 'the-service': ensure => 'running' }


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/3769b174-df14-4d85-9c1b-f72a53cf038e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] basic question about hiera

2015-07-08 Thread Albert Shih
Hi,

Very basic question about hiera file.

I've

  hieradata/my_host.yaml

I like at the end of my_host.yaml make something like

  include my_host_add.yaml

is it possible ?

The reason is some data is automatically extract from a database, those
data is specific to that host. And because this file is pretty big I don't
known if it's a good idea to use hierachy to include in every host (knowing
I've no way to use those data outside to my_host)

Regards.

JAS

--
Albert SHIH
DIO bâtiment 15
Observatoire de Paris
5 Place Jules Janssen
92195 Meudon Cedex
France
Téléphone : +33 1 45 07 76 26/+33 6 86 69 95 71
xmpp: j...@obspm.fr
Heure local/Local time:
mer 8 jul 2015 15:31:36 CEST

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


[Puppet Users] Re: How to make service start depend on a file existing

2015-07-08 Thread Gerard Kok
You could create a custom fact that returns the desired state of the 
service, based on the existence of the file, and then use the value of that 
fact in the service declaration. For example, like so:

The custom fact:

Facter.add(:state_of_the_service) do
 setcode do
  File.exists?(the-file) ? "running" : "stopped"
 end
end

and the service declaration:

service { 'the-service':
  ensure => $::state_of_the_service
}


The downside of this solution is that you'll require two puppet runs to get 
the service running if the file is (indirectly) created by puppet. The 
first run the file will be created, but the fact is computed at the start 
of the run, so it will still be 'stopped', and only switch to 'running' at 
the start of the second run.

  

On Wednesday, July 8, 2015 at 3:21:48 AM UTC+2, Mark Kirkwood wrote:
>
> I would like to prevent a service starting until a certain file exists. 
> The wrinkle is that the file is not (directly) created by puppet. 
>
> I'm thinking that I want to somehow 'declare' the file to puppet without 
> *it* trying to create it, and the use something like: 
>
> File["the-file"] -> Service["the-service"] 
>
> to make sure the service get started after the file is created. However 
> I'm stumped at the first bit (the file 'declare' idea). Any thoughts? 
>
> Regards 
>
> Mark 
>

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


[Puppet Users] How to call a module from another module

2015-07-08 Thread Hiranmoy Khan
Hello,

I am trying to call module A from module B if variable Y is false. 
And if module B executed successfully then variable var1 = true. 
But not sure about the syntax.

In module B.
if $y {
#do something
}
else {
  if Class["::A"] {
$var1  = true
  }
  else {
$var2= false
  }
}

In module A under init.pp
class A {
  #do something
}

Thanks
Hiranmoy

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


[Puppet Users] Hiera auto binding

2015-07-08 Thread DJ
Hello,

i was reading this doc 
"http://garylarizza.com/blog/2014/10/24/puppet-workflows-4-using-hiera-in-anger";
 
which says it's not good idea to use Hiera auto binding feature, can you 
guys suggest if you are using this feature and you have noticed any 
performance issues or any issues related to not able to find from where 
data is coming?

Any feedback please.

Regards,
DJ

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


[Puppet Users] Re: Hiera auto binding

2015-07-08 Thread DJ
Sorry correction, it's "Data binding" 

On Wednesday, 8 July 2015 21:27:44 UTC+5:30, DJ wrote:
>
> Hello,
>
> i was reading this doc "
> http://garylarizza.com/blog/2014/10/24/puppet-workflows-4-using-hiera-in-anger";
>  
> which says it's not good idea to use Hiera auto binding feature, can you 
> guys suggest if you are using this feature and you have noticed any 
> performance issues or any issues related to not able to find from where 
> data is coming?
>
> Any feedback please.
>
> Regards,
> DJ
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/44f2c779-5b72-4c2e-870a-477e6cc31935%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Need help with python msi install on windows

2015-07-08 Thread Rob Reynolds
On Tue, Jul 7, 2015 at 12:40 AM, Gene Fontanilla 
wrote:

> To verify, the file you have located at c:/PreRecap/python-2.7.5.
>
> amd64.msi is actually a downloaded MSI file correct?
>
>
> yes bob you are correct
>

So double click the file, it should come up with an install box. Exit it
without finishing the install. Then try running it from the command line:

msiexec /norestart /i c:\PreRecap\python.amd64.msi TARGETDIR=c:/python27
WHICHUSERS=ALL

Note that msiexec may not like your forward slashes, which may indicate the
issue.

If that can go all the way through, then uninstall and try adding '/qn'
(e.g. 'msiexec /qn /norestart /i ...') and running it again.

Once you have all of the switches set properly, then you can plug it into
the built-in package resource.

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



-- 
Rob Reynolds
Developer, Puppet Labs

*PuppetConf 2015  is coming to Portland,
Oregon! Join us October 5-9.*
*Register now to take advantage of the Early Adopter discount

*
*—**save $349!*

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


[Puppet Users] Re: Could not evaluate: Could not find command '/var/lib/puppet/concat/bin/concatfragments.rb'

2015-07-08 Thread Alexandre Dumont
Same error here, when using puppet module saz-ssh v2.8.1.

All my modules are:

# *puppet module lis*t
/etc/puppet/modules
├── puppetlabs-concat (v1.2.3)
├── puppetlabs-ntp (v4.0.0)
├── puppetlabs-stdlib (v4.6.0)
└── saz-ssh (v2.8.1)

Some facts from my fresh installation:

# *facter os puppetversion*
*os* => {"name"=>"Ubuntu", "release"=>{"major"=>"12.04", "full"=>"12.04"}, 
"lsb"=>{"distrelease"=>"12.04", "distcodename"=>"precise", 
"majdistrelease"=>"12.04", "distdescription"=>"Ubuntu 12.04", 
"distid"=>"Ubuntu"}, "family"=>"Debian"}
*puppetversion* => 3.8.1

My site.pp:

include ::ssh::server

Error:

*# puppet agent --test --noop *
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for ema
Info: Applying configuration version '1436379851'
Notice: /Stage[main]/Concat::Setup/File[/var/lib/puppet/concat]/ensure: 
current_value absent, should be directory (noop)
Notice: /Stage[main]/Concat::Setup/File[/var/lib/puppet/concat/bin]/ensure: 
current_value absent, should be directory (noop)
Notice: 
/Stage[main]/Concat::Setup/File[/var/lib/puppet/concat/bin/concatfragments.rb]/ensure:
 
current_value absent, should be file (noop)
Notice: Class[Concat::Setup]: Would have triggered 'refresh' from 3 events
Notice: 
/Stage[main]/Ssh::Server::Config/Concat[/etc/ssh/sshd_config]/File[/var/lib/puppet/concat/_etc_ssh_sshd_config]/ensure:
 
current_value absent, should be directory (noop)
Info: 
/Stage[main]/Ssh::Server::Config/Concat[/etc/ssh/sshd_config]/File[/var/lib/puppet/concat/_etc_ssh_sshd_config]:
 
Scheduling refresh of Exec[concat_/etc/ssh/sshd_config]
Notice: 
/Stage[main]/Ssh::Server::Config/Concat[/etc/ssh/sshd_config]/File[/var/lib/puppet/concat/_etc_ssh_sshd_config/fragments.concat.out]/ensure:
 
current_value absent, should be present (noop)
Notice: 
/Stage[main]/Ssh::Server::Config/Concat[/etc/ssh/sshd_config]/File[/var/lib/puppet/concat/_etc_ssh_sshd_config/fragments]/ensure:
 
current_value absent, should be directory (noop)
Info: 
/Stage[main]/Ssh::Server::Config/Concat[/etc/ssh/sshd_config]/File[/var/lib/puppet/concat/_etc_ssh_sshd_config/fragments]:
 
Scheduling refresh of Exec[concat_/etc/ssh/sshd_config]
Notice: /Stage[main]/Ssh::Server::Config/Concat::Fragment[global 
config]/File[/var/lib/puppet/concat/_etc_ssh_sshd_config/fragments/00_global 
config]/ensure: current_value absent, should be file (noop)
Info: /Stage[main]/Ssh::Server::Config/Concat::Fragment[global 
config]/File[/var/lib/puppet/concat/_etc_ssh_sshd_config/fragments/00_global 
config]: Scheduling refresh of Exec[concat_/etc/ssh/sshd_config]
Notice: 
/Stage[main]/Ssh::Server::Config/Concat[/etc/ssh/sshd_config]/File[/var/lib/puppet/concat/_etc_ssh_sshd_config/fragments.concat]/ensure:
 
current_value absent, should be present (noop)
Error: 
/Stage[main]/Ssh::Server::Config/Concat[/etc/ssh/sshd_config]/Exec[concat_/etc/ssh/sshd_config]:
 
Could not evaluate: Could not find command 
'/var/lib/puppet/concat/bin/concatfragments.rb'
Notice: 
/Stage[main]/Ssh::Server::Config/Concat[/etc/ssh/sshd_config]/Exec[concat_/etc/ssh/sshd_config]:
 
Would have triggered 'refresh' from 3 events
Notice: 
/Stage[main]/Ssh::Server::Config/Concat[/etc/ssh/sshd_config]/File[/etc/ssh/sshd_config]:
 
Dependency Exec[concat_/etc/ssh/sshd_config] has failures: true
Warning: 
/Stage[main]/Ssh::Server::Config/Concat[/etc/ssh/sshd_config]/File[/etc/ssh/sshd_config]:
 
Skipping because of failed dependencies
Notice: Concat[/etc/ssh/sshd_config]: Would have triggered 'refresh' from 5 
events
Info: Concat[/etc/ssh/sshd_config]: Scheduling refresh of Service[ssh]
Notice: Concat::Fragment[global config]: Would have triggered 'refresh' 
from 1 events
Notice: Class[Ssh::Server::Config]: Would have triggered 'refresh' from 2 
events
Info: Class[Ssh::Server::Config]: Scheduling refresh of 
Class[Ssh::Server::Service]
Notice: Class[Ssh::Server::Service]: Would have triggered 'refresh' from 1 
events
Info: Class[Ssh::Server::Service]: Scheduling refresh of Service[ssh]
Notice: /Stage[main]/Ssh::Server::Service/Service[ssh]: Dependency 
Exec[concat_/etc/ssh/sshd_config] has failures: true
Warning: /Stage[main]/Ssh::Server::Service/Service[ssh]: Skipping because 
of failed dependencies
Notice: /Stage[main]/Ssh::Server::Service/Service[ssh]: Would have 
triggered 'refresh' from 2 events
Notice: Class[Ssh::Server::Service]: Would have triggered 'refresh' from 1 
events
Notice: /Stage[main]/Ssh::Server/Anchor[ssh::server::end]: Dependency 
Exec[concat_/etc/ssh/sshd_config] has failures: true
Warning: /Stage[main]/Ssh::Server/Anchor[ssh::server::end]: Skipping 
because of failed dependencies
Notice: Stage[main]: Would have triggered 'refresh' from 3 events
Notice: Finished catalog run in 0.34 seconds

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To vi

Re: [Puppet Users] Re: hiera and puppet environments ( directory)

2015-07-08 Thread Rob Reynolds
On Wed, Jul 8, 2015 at 3:07 AM, PAN  wrote:

> Hi Rob ,
>
> On the puppet agent node, when I try to install ssh packages it is failing
> with "Error 400 on SERVER: Evaluation Error: Error while evaluating a
> Function Call,
> Could not find data item ssh_packages in any Hiera data file" error.
> puppet agent -t works fine when modules does not contain hiera look ups.
> The issue seems hiera looksups is not working for puppet client/agent node.
>
> However hiera lookups and ssh_packages working fine on master node when I
> use puppet apply -e 'include openssh:sshclient' module
>
> Both puppet master and puppet client are using
> # puppet --version
> 3.8.0 (Puppet Enterprise 3.8.0),
>
> # hiera -v
> 1.3.4
>
> On master node:
> ___
>
> [root@pupmaster manifests]# puppet apply -e 'include openssh::sshclient'
> Notice: Compiled catalog for pupmaster-dpallipa.idc.oracle.com in
> environment production in 5.77 seconds
> Notice: /Stage[main]/Openssh::Sshclient/Package[openssh-ldap]/ensure:
> created
> Notice: Finished catalog run in 20.13 seconds
> [root@pupmaster manifests]#
> __
>
> # cat /etc/hiera.yaml
>  Hiera to search yaml files #
> :backends:
>  - yaml
>
> :hierarchy:
> # - "%{operatingsystem}"
>  - "%{osfamily}"
>  - common
>  - defaults
> :yaml:
> :datadir: /var/lib/hiera/
> __
> # cd /var/lib/hiera/
> # ls
> common.yaml  defaults.yaml  RedHat.yaml
> 
> #cat RedHat.yaml
> permitt_root_login: 'yes'
> ssh_service: 'sshd'
> ssh_packages:
> - 'openssh-ldap'
> - 'openssh'
> - 'openssh-clients'
> - 'openssh-server'
> __
> # cat common.yaml
> permit_root_login: 'no'
> -
> # cat defaults.yaml
> environment: production
> ---
>
> My ssh package instal module:
> # cat sshclient.pp
> class openssh::sshclient {
> $ssh_packages=hiera('ssh_packages')
> $permit_root_login=hiera('permitt_root_login')
>  $sshservice=hiera('ssh_service')
>
> package {$ssh_packages:
> ensure => 'present',
> before => File['/etc/ssh/sshd_config'],
> }
>
> file {'/etc/ssh/sshd_config':
> ensure => present,
> owner => 'root',
> group => 'root',
> mode => '0600',
> content => template('openssh/sshd_config.erb'),
> }
>
> service {$sshservice:
> subscribe => File['/etc/ssh/sshd_config'],
> ensure => running,
> enable => true,
> hasstatus => true,
> hasrestart => true,
> }
> }
> 
>
> On puppetclient/agent node:
> ---
>
> [root@pupclient2
> 
> .
> Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
> Evaluation Error: Error while evaluating a Function Call, Could not find
> data item ssh_packages in any Hiera data file and no default supplied at
> /etc/puppetlabs/puppet/environments/production/modules/openssh/manifests/sshclient.pp:2:16
> on node pupclient2.
> Error: Could not retrieve catalog; skipping run
> [root@pupclient2
> -
>
> Is there anything I am missing here /any thing I need to enable to make
> puppet agent to work fine with hiera.
>


What do you get when you run facter operatingsystem and facter osfamily on
pupclient2?



>
> Thanks,
>
>
> On Friday, June 19, 2015 at 2:13:30 PM UTC+5:30, Helen Paterson wrote:
>>
>> Hi,
>>
>> I'm trying to set-up puppet environment so that our ymal files can
>> usernames and passwords for Production and test ( dq), modules will be the
>> same. I have run through the documentation but am getting the following
>> error:
>>
>> client error
>>
>> Error: Could not retrieve catalog from remote server: Error 400 on
>> SERVER: Could
>> not find data item classes in any Hiera data file and no default supplied
>> at /e
>> tc/puppet/environments/dq/manifests/windows-servers.pp:54 on node
>> hp-test2008r2.
>>
>>
>> debug from master
>> Cannot find datafile /var/lib/hiera/
>>
>>
>> I don't understand why puppet is looking in  /var/lib/hiera/.  before
>> setting up environments hiera was working and looking at
>> /etc/puppethiera.yaml but default
>>
>>
>> hiera.yaml
>> :datadir: '/etc/puppet/environments/%{::environment}/hieradata'
>>
>>
>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/a26af05d-8078-45b7-9d60-24f69e7e6af3%40googlegroups.com
> 
> .
>
> For more options, visit https://gro

Re: [Puppet Users] hiera and puppet environments ( directory)

2015-07-08 Thread Rob Reynolds
On Mon, Jul 6, 2015 at 3:02 PM, Rob Reynolds  wrote:

>
>
> On Fri, Jun 19, 2015 at 3:43 AM, Helen Paterson 
> wrote:
>
>> Hi,
>>
>> I'm trying to set-up puppet environment so that our ymal files can
>> usernames and passwords for Production and test ( dq), modules will be the
>> same. I have run through the documentation but am getting the following
>> error:
>>
>> client error
>>
>> Error: Could not retrieve catalog from remote server: Error 400 on
>> SERVER: Could
>> not find data item classes in any Hiera data file and no default supplied
>> at /e
>> tc/puppet/environments/dq/manifests/windows-servers.pp:54 on node
>> hp-test2008r2.
>>
>>
>> debug from master
>> Cannot find datafile /var/lib/hiera/
>>
>>
>> I don't understand why puppet is looking in  /var/lib/hiera/.  before
>> setting up environments hiera was working and looking at
>> /etc/puppethiera.yaml but default
>>
>
What version of Puppet?


>
>>
>> hiera.yaml
>> :datadir: '/etc/puppet/environments/%{::environment}/hieradata'
>>
>
> If this is what you have/had in your yaml file, you've probably realized
> this is not a valid Windows path, which is necessary for the yaml files on
> the Windows clients.
>

This may not be correct - Hiera evaluates wherever the catalog is compiled
I believe.


>
>
>>
>>
>>
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Puppet Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to puppet-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/puppet-users/220c601e-b537-4d9b-b0d9-3c94bb6d68e7%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Rob Reynolds
> Developer, Puppet Labs
>
> *PuppetConf 2015  is coming to Portland,
> Oregon! Join us October 5-9.*
> *Register now to take advantage of the Early Adopter discount
> 
>  *
> *—**save $349!*
>



-- 
Rob Reynolds
Developer, Puppet Labs

*PuppetConf 2015  is coming to Portland,
Oregon! Join us October 5-9.*
*Register now to take advantage of the Early Adopter discount

*
*—**save $349!*

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


Re: [Puppet Users] Re: hiera and puppet environments ( directory)

2015-07-08 Thread PAN dheepak kumar
Hi Rob.
Thanks for the reply.

[root@pupclient2]# facter osfamily
RedHat
[root@pupclient2]# facter operatingsystem
OracleLinux
[root@pupclient2]#

[root@pupmaster]# facter osfamily
RedHat
[root@pupmaster]# facter operatingsystem
OracleLinux
[root@pupmaster]#

Both Master and client are running same OS and same version.

[root@pupclient2]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.5 (Santiago)
[root@pupclient2]#
---
[root@pupmaster]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.5 (Santiago)
[root@pupmaster]
---

Thanks

On Thu, Jul 9, 2015 at 12:19 AM, Rob Reynolds  wrote:

>
>
> On Wed, Jul 8, 2015 at 3:07 AM, PAN  wrote:
>
>> Hi Rob ,
>>
>> On the puppet agent node, when I try to install ssh packages it is
>> failing with "Error 400 on SERVER: Evaluation Error: Error while evaluating
>> a Function Call,
>> Could not find data item ssh_packages in any Hiera data file" error.
>> puppet agent -t works fine when modules does not contain hiera look ups.
>> The issue seems hiera looksups is not working for puppet client/agent node.
>>
>> However hiera lookups and ssh_packages working fine on master node when I
>> use puppet apply -e 'include openssh:sshclient' module
>>
>> Both puppet master and puppet client are using
>> # puppet --version
>> 3.8.0 (Puppet Enterprise 3.8.0),
>>
>> # hiera -v
>> 1.3.4
>>
>> On master node:
>> ___
>>
>> [root@pupmaster manifests]# puppet apply -e 'include openssh::sshclient'
>> Notice: Compiled catalog for pupmaster-dpallipa.idc.oracle.com in
>> environment production in 5.77 seconds
>> Notice: /Stage[main]/Openssh::Sshclient/Package[openssh-ldap]/ensure:
>> created
>> Notice: Finished catalog run in 20.13 seconds
>> [root@pupmaster manifests]#
>> __
>>
>> # cat /etc/hiera.yaml
>>  Hiera to search yaml files #
>> :backends:
>>  - yaml
>>
>> :hierarchy:
>> # - "%{operatingsystem}"
>>  - "%{osfamily}"
>>  - common
>>  - defaults
>> :yaml:
>> :datadir: /var/lib/hiera/
>> __
>> # cd /var/lib/hiera/
>> # ls
>> common.yaml  defaults.yaml  RedHat.yaml
>> 
>> #cat RedHat.yaml
>> permitt_root_login: 'yes'
>> ssh_service: 'sshd'
>> ssh_packages:
>> - 'openssh-ldap'
>> - 'openssh'
>> - 'openssh-clients'
>> - 'openssh-server'
>> __
>> # cat common.yaml
>> permit_root_login: 'no'
>> -
>> # cat defaults.yaml
>> environment: production
>> ---
>>
>> My ssh package instal module:
>> # cat sshclient.pp
>> class openssh::sshclient {
>> $ssh_packages=hiera('ssh_packages')
>> $permit_root_login=hiera('permitt_root_login')
>>  $sshservice=hiera('ssh_service')
>>
>> package {$ssh_packages:
>> ensure => 'present',
>> before => File['/etc/ssh/sshd_config'],
>> }
>>
>> file {'/etc/ssh/sshd_config':
>> ensure => present,
>> owner => 'root',
>> group => 'root',
>> mode => '0600',
>> content => template('openssh/sshd_config.erb'),
>> }
>>
>> service {$sshservice:
>> subscribe => File['/etc/ssh/sshd_config'],
>> ensure => running,
>> enable => true,
>> hasstatus => true,
>> hasrestart => true,
>> }
>> }
>> 
>>
>> On puppetclient/agent node:
>> ---
>>
>> [root@pupclient2
>> 
>> .
>> Error: Could not retrieve catalog from remote server: Error 400 on
>> SERVER: Evaluation Error: Error while evaluating a Function Call, Could not
>> find data item ssh_packages in any Hiera data file and no default supplied
>> at
>> /etc/puppetlabs/puppet/environments/production/modules/openssh/manifests/sshclient.pp:2:16
>> on node pupclient2.
>> Error: Could not retrieve catalog; skipping run
>> [root@pupclient2
>> -
>>
>> Is there anything I am missing here /any thing I need to enable to make
>> puppet agent to work fine with hiera.
>>
>
>
> What do you get when you run facter operatingsystem and facter osfamily on
> pupclient2?
>
>
>
>>
>> Thanks,
>>
>>
>> On Friday, June 19, 2015 at 2:13:30 PM UTC+5:30, Helen Paterson wrote:
>>>
>>> Hi,
>>>
>>> I'm trying to set-up puppet environment so that our ymal files can
>>> usernames and passwords for Production and test ( dq), modules will be the
>>> same. I have run through the documentation but am getting the following
>>> error:
>>>
>>> client error
>>>
>>> Error: Could not retrieve catalog from remote server: Error 400 on
>>> SERVER: Could
>>> not find data item classes in any Hiera data file and no default
>>> supplied at /e
>>> tc/puppet/environments/dq/manifests/windows-servers.pp:54 on node
>>> hp-test2008r2.
>>>
>>>
>>> debug from master
>>> Cannot find datafile /var/lib/hiera/
>>>
>>>
>>> I don't understand why puppet is looking in  /va

Re: [Puppet Users] Hiera auto binding

2015-07-08 Thread Angel L. Mateo

El 08/07/15 a las 17:57, DJ escribió:

Hello,

i was reading this doc
"http://garylarizza.com/blog/2014/10/24/puppet-workflows-4-using-hiera-in-anger";
which says it's not good idea to use Hiera auto binding feature, can you
guys suggest if you are using this feature and you have noticed any
performance issues or any issues related to not able to find from where
data is coming?

	We are using it without any problem. The only dissapointed thing I've 
found is that hiera data is not merged in auto binding calls, but it is 
when hiera function is used 
(https://docs.puppetlabs.com/hiera/1/puppet.html#priority-only).


--
Angel L. Mateo Martínez
Sección de Telemática
Área de Tecnologías de la Información
y las Comunicaciones Aplicadas (ATICA)
http://www.um.es/atica
Tfo: 868887590
Fax: 86337

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