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

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

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

You could do the following:

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

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

hth,
Martin

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

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


[Puppet Users] PE console after master install

2015-08-04 Thread Julio Guevara
Hi Puppet Users,

I been facing a problem while trying to install PE-Console after installing 
PE-Master on a VM. The initial setup was to install PE-Console on another 
VM but requirements changed so we are going to end up installing on the 
same VM that already has PE-Master install. Using the 
puppet-enterprise-installer will yield error, since it first validates that 
the PE-Master is already install and does nothing. If you know how to 
install this component after the initial setup that would be awesome.

Thanks

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


Re: [Puppet Users] Complex edits on /etc/default/grub (Setting transparent_hugepage at boot time)

2015-08-04 Thread Raphaël Pinson


On Thursday, July 30, 2015 at 12:10:36 AM UTC+2, Brad Knowles wrote:

 On Jul 29, 2015, at 5:01 PM, Tom Limoncelli t...@whatexit.org 
 javascript: wrote: 

  The Augeas people never fail to impress! 

 So long as you’re not trying to edit XML files with Augeas.  That’s 80% of 
 the way there, maybe even 90% of the way there. 


Arguably, I think a real XML type with XPath changes would be better than 
using Augeas (which has limited XML support).  So far, it's still the best 
option there is, though. Also, it's easier to make it idempotent than using 
XPath with, say, Nokogiri.


Raphaël

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


[Puppet Users] Re: Augeas failing when acting on smb.conf

2015-08-04 Thread Raphaël Pinson
Hello,


What do you have on line 2545 in your smb.conf?



Regards,

Raphaël Pinson




On Monday, August 3, 2015 at 11:04:01 PM UTC+2, Fabrizio Zelaya wrote:

 Hello everyone!

 I am trying to run puppet agent on a SL-6 Machine and one action I'm 
 trying to apply is to add the machine to our domain. However I ran into an 
 issue when running puppet agent -t

 Debug: Augeas[global](provider=augeas): Opening augeas with root /, lens 
 path /var/lib/puppet/lib/augeas/lenses, flags 64
 Debug: Augeas[global](provider=augeas): Augeas version 1.0.0 is installed
 Warning: Augeas[global](provider=augeas): Loading failed for one or more 
 files, see debug for /augeas//error output
 Debug: Augeas[global](provider=augeas): 
 /augeas/files/etc/samba/smb.conf/error = parse_failed
 Debug: Augeas[global](provider=augeas): 
 /augeas/files/etc/samba/smb.conf/error/pos = 2545
 Debug: Augeas[global](provider=augeas): 
 /augeas/files/etc/samba/smb.conf/error/line = 67
 Debug: Augeas[global](provider=augeas): 
 /augeas/files/etc/samba/smb.conf/error/char = 0
 Debug: Augeas[global](provider=augeas): 
 /augeas/files/etc/samba/smb.conf/error/lens = 
 /usr/share/augeas/lenses/dist/inifile.aug:391.25-.43:
 Debug: Augeas[global](provider=augeas): 
 /augeas/files/etc/samba/smb.conf/error/message = Get did not match entire 
 input


 Unfortunately I am very new to augeas and don't really understand the 
 references on this messages. So far I've seen that 
  /usr/share/augeas/lenses/dist/inifile.aug:391.25-.43: refers to this 
 piece of code   # *= comment* . record**


 I'm right now trying to understand if this is a permissions error or 
 augeas version or syntax error but I haven't found much about what I'm 
 reading on the debug output.

 Here's the versions of what I'm running.

 On Puppet Master

 ruby-augeas-0.4.1-3.el6.x86_64
 augeas-libs-1.0.0-7.el6.x86_64
 augeas-1.0.0-7.el6.x86_64

 puppet-3.8.1-1.el6.noarch
 puppetlabs-release-6-11.noarch
 puppet-server-3.8.1-1.el6.noarch


 On the agent

 taugeas-libs-1.0.0-7.el6.x86_64
 augeas-1.0.0-7.el6.x86_64
 ruby-augeas-0.4.1-3.el6.x86_64

 pe-puppet-enterprise-release-3.8.0.3-1.pe.el6.noarch
 puppet-3.8.1-1.el6.noarch
 puppetlabs-release-6-11.noarch

 Here's the code I'm using

 Samba init.pp

 # Samba base module.
 #
 class samba (
   $workgroup,
   $realm,
   $ensure = 'installed',
   $common_package = $samba::params::common_package,
   $server_pacakge = $samba::params::server_package,
   $winbind_package = $samba::params::winbind_package,
   $conf = $samba::params::conf,
   $winbind_service = $samba::params::winbind_service,
   $krb_package = $samba::params::krb_package,
   $krb_conf = $samba::params::krb_conf,
   $krb_keytab = $samba::params::krb_keytab,
 ) inherits samba::params {

   package { $common_package:
 ensure = $ensure,
   }

   augeas { 'global':
 incl= $conf,
 lens= 'Samba.lns',
 context = /files${conf}/*[. = \global\],
 changes = [
   set 'workgroup' ${workgroup},
   set 'realm' ${realm},
   set 'password server' *,
   set 'security' ads,
   set 'template shell' /bin/bash,
   set 'winbind use default domain' true,
   set 'winbind offline logon' true,
   set 'winbind rpc only' true,
   set 'winbind normalize names' true,
   set 'winbind refresh tickets' true,
   set 'idmap config * : backend' rid,
   set 'idmap config * : range' 16777216-33554431,
   set 'kerberos method' 'secrets and keytab',
   set 'local master' no,
   rm 'idmap uid',
   rm 'idmap gid',
   rm 'idmap backend',
 ],
   }

   exec { /bin/sed -i -r -e \/^\\s*([;#].*)?\$/ d\ -e \s/^\\s*([^[])/ 
  \\1/\ -e \s/^[[].*/\\n/\ ${conf}:
 refreshonly = true,
 subscribe   = Augeas['global'],
   }

 }

 For Samba param.pp
 # Samba module parameters.
 #
 class samba::params {

   case $::osfamily {

 'RedHat': {

   if $::operatingsystemmajrelease == '5' {
 $base_name = 'samba3x'
   } else {
 $base_name = 'samba'
   }

   $server_package = $base_name
   $common_package = ${base_name}-common
   $winbind_package = ${base_name}-winbind

   $conf = '/etc/samba/smb.conf'

   $winbind_service = 'winbind'

   $krb_package = 'krb5-workstation'
   $krb_conf = '/etc/krb5.conf'
   $krb_keytab = '/etc/krb5.keytab'

 }

 default: {
   fail('Unsupported operating system')
 }

   }

 }


 Would appreciate any help you can give me. Thanks in advance









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


[Puppet Users] Re: Complex edits on /etc/default/grub (Setting transparent_hugepage at boot time)

2015-08-04 Thread Raphaël Pinson

On Thursday, July 30, 2015 at 12:02:11 AM UTC+2, Tom Limoncelli wrote:

 Of course, minutes after emailing that I found the answer to my own 
 question.

 If you install the augeasproviders_grub module (
 https://github.com/hercules-team/augeasproviders_grub) then it becomes as 
 simple as:

 kernel_parameter { 'transparent_hugepage':
   value = 'never',
   ensure = present,
 }

 In CentOS7, the module is smart enough to make the change to 
 /etc/default/grub's GRUB_CMDLINE_LINUX variable.  From a quick look at the 
 code, it seems to do the right thing for other OSs too.

 The Augeas people never fail to impress!



Glad it's useful to someone :-)


Raphaël



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


[Puppet Users] Announcing the augeas_file module

2015-08-04 Thread Raphaël Pinson
Hello,


Some time ago, we had a need to generate a file idempotently using a local 
file on the agent as a template. It took a few months of thinking to get to 
a working PoC, but here it is, in case someone is interested:

https://forge.puppetlabs.com/camptocamp/augeas_file

This module allows to apply Augeas changes to a base file in order to 
generate the target file (instead of applying them to the target file 
itself). As a result, the file is managed as a whole, and there is no need 
to keep a template for each OS/software version in your module.


Feedback is obviously welcome!


Raphaël Pinson

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


[Puppet Users] Re: PE windows agent ?

2015-08-04 Thread Stefan Lock
Hi,

you can use the following link and just use msiexec:

https://downloads.puppetlabs.com/windows/

Regards

On Monday, August 3, 2015 at 4:33:53 PM UTC+1, max scalf wrote:

 Hello all,

 I am trying to figure out how to install puppet enterprise agent on a 
 windows box...while on LInux we just simple do below to install PE agent

 curl -k https://MASTER HOSTNAME:8140/packages/current/install.bash | 
 sudo bash

 but on windows, i need to download an msi file(looking at the 
 docs)where would i find that msi file ?? the download link given in the 
 below docs (even when i fill out the info), takes me to installation 
 binaries of the master...i need it for the puppet agent...


 https://docs.puppetlabs.com/pe/latest/install_windows.html#installing-puppet

 so my question is -

 1. Where can i download the puppet agent(Enterprise) for windows
 2. Are there any other step-step docs/reference on puppet on windows ?? 




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


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

2015-08-04 Thread Arnaud Gomes-do-Vale
Martin Alfke tux...@gmail.com writes:

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

I am quite sure it won't. :-)

I may try to query the PuppetDB from a parser function to get the list
of paths on the client; I am reading the docs at the moment.

-- 
Arnaud

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


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

2015-08-04 Thread Ken Barber
 I may try to query the PuppetDB from a parser function to get the list
 of paths on the client; I am reading the docs at the moment.

 Here is what I came up with, and it works for me. It assumes the
 PuppetDB is on localhost:8080 as seen from the Puppet master, though; I
 don't know if it would be easy to make it generic.



 # 2015-08-04 Arnaud Gomes-do-Vale
 #This function returns the list of files needed for file_line
 #resources with a given tag.

 module Puppet::Parser::Functions
   newfunction(:files_with_lines, :type = :rvalue) do |args|
 # Argument parsing and some sanity checking.
 if args.length != 1
   raise Puppet::ParseError, Must provide a single argument.
 end
 tag = args[0]
 unless tag.instance_of? String
   raise Puppet::ParseError, I want a string.
 end

 # Initialise return value.
 file_list = []

 # Query PuppetDB.
 # FIXME Do not hardcode!
 uri = URI('http://localhost:8080/v3/resources/File_line')
 params = {:query = '[=, tag, dsh_group]'}
 uri.query = URI.encode_www_form(params)
 resp = Net::HTTP.get_response(uri)

 # Grab list of files from PuppetDB response.
 if resp.is_a?(Net::HTTPSuccess)
   entries = JSON.load(resp.body)
   entries.each do |ent|
 file_list.push ent[parameters][path]
   end
 end

 return file_list.uniq
   end
 end

 # EOF

Probably worth taking a look at how todays resource collection in the
terminus performs its HTTP queries:

https://github.com/puppetlabs/puppetdb/blob/master/puppet/lib/puppet/indirector/resource/puppetdb.rb#L18-L35

If you use that action facility, it does all the right stuff for you,
reads the puppetdb.conf file, does failover if necessary, uses SSL.
Its not necessarily something that is a public API per se, but worth
considering over doing your own HTTP work.

ken.

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


Re: [Puppet Users] Re: Augeas failing when acting on smb.conf

2015-08-04 Thread Werner Flamme
Raphaël Pinson [04.08.2015 14:03]:
 Hello,
 
 
 What do you have on line 2545 in your smb.conf?

Isn't this line 67, character 2545?

I guess the characters are counted through the whole file and not for
each line ;)

 
 
 
 Regards,
 
 Raphaël Pinson
 
 
 
 
 On Monday, August 3, 2015 at 11:04:01 PM UTC+2, Fabrizio Zelaya wrote:

 Hello everyone!

 I am trying to run puppet agent on a SL-6 Machine and one action I'm 
 trying to apply is to add the machine to our domain. However I ran into an 
 issue when running puppet agent -t

 Debug: Augeas[global](provider=augeas): Opening augeas with root /, lens 
 path /var/lib/puppet/lib/augeas/lenses, flags 64
 Debug: Augeas[global](provider=augeas): Augeas version 1.0.0 is installed
 Warning: Augeas[global](provider=augeas): Loading failed for one or more 
 files, see debug for /augeas//error output
 Debug: Augeas[global](provider=augeas): 
 /augeas/files/etc/samba/smb.conf/error = parse_failed
 Debug: Augeas[global](provider=augeas): 
 /augeas/files/etc/samba/smb.conf/error/pos = 2545
 Debug: Augeas[global](provider=augeas): 
 /augeas/files/etc/samba/smb.conf/error/line = 67
 Debug: Augeas[global](provider=augeas): 
 /augeas/files/etc/samba/smb.conf/error/char = 0
 Debug: Augeas[global](provider=augeas): 
 /augeas/files/etc/samba/smb.conf/error/lens = 
 /usr/share/augeas/lenses/dist/inifile.aug:391.25-.43:
 Debug: Augeas[global](provider=augeas): 
 /augeas/files/etc/samba/smb.conf/error/message = Get did not match entire 
 input



-- 


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


smime.p7s
Description: S/MIME Cryptographic Signature


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

2015-08-04 Thread Martin Alfke

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

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

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

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


 notify {My Kernel version is = ${kernel_test_version} and I'm going to 
 upgrade : }
 
 file { 
 /usr/src/linux-headers-${kernel_test_version}_${kernel_release_test_version}~precise1_all.deb
  :
   mode   = '755',
   ensure = 'present',
   source = 
 puppet:///modules/kernel/${kernel_test_version}_${kernel_release_test_version}~precise1_all.deb
  }
   }
   
   elsif ($::class == 'workstation') and ($::kernelmajversion = '3.11') {
 notify {My Kernel version is = ${kernel_test_version} so I don't need 
 to upgrade: }
   }
 
 
 After invoking a puppet run, I can never get the evaluation of if to 
 actually take place and as a result, the elsif is invoked and regardless of 
 whether or not the kernel version is = 3.11, the if statement is never 
 run.  From what I gather, this means that the evaluation of if is never 
 happening and the resulting elsif is automatically invoked.
 
 I've also seen some errors that pertain to string/float comparisons and to my 
 knowledge, facter data is coming back as a string and my version number in 
 the if statement (3.11) is a float and therefore can't be compared due to 
 comparison rules of different data types.
 
 Does anybody have some words of wisdom that may lead me to the correct syntax 
 for what I'm trying to achieve?
 
 Thanks in advance to the community for the help.
 
 Cheers,
 
 Mike
 
 
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to puppet-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/puppet-users/5f9249a2-1bab-4f7e-84b5-f5fa6afd3ad7%40googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

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


Re: [Puppet Users] Augeas failing when acting on smb.conf

2015-08-04 Thread Martin
Hi,

While no help at all for Augeas: Why don't you simply use a template? It
would also get rid of the exec at the end?

/Martin
On Mon 3 Aug 2015 at 23:04 Fabrizio Zelaya fabr...@gmail.com wrote:

 Hello everyone!

 I am trying to run puppet agent on a SL-6 Machine and one action I'm
 trying to apply is to add the machine to our domain. However I ran into an
 issue when running puppet agent -t

 Debug: Augeas[global](provider=augeas): Opening augeas with root /, lens
 path /var/lib/puppet/lib/augeas/lenses, flags 64
 Debug: Augeas[global](provider=augeas): Augeas version 1.0.0 is installed
 Warning: Augeas[global](provider=augeas): Loading failed for one or more
 files, see debug for /augeas//error output
 Debug: Augeas[global](provider=augeas):
 /augeas/files/etc/samba/smb.conf/error = parse_failed
 Debug: Augeas[global](provider=augeas):
 /augeas/files/etc/samba/smb.conf/error/pos = 2545
 Debug: Augeas[global](provider=augeas):
 /augeas/files/etc/samba/smb.conf/error/line = 67
 Debug: Augeas[global](provider=augeas):
 /augeas/files/etc/samba/smb.conf/error/char = 0
 Debug: Augeas[global](provider=augeas):
 /augeas/files/etc/samba/smb.conf/error/lens =
 /usr/share/augeas/lenses/dist/inifile.aug:391.25-.43:
 Debug: Augeas[global](provider=augeas):
 /augeas/files/etc/samba/smb.conf/error/message = Get did not match entire
 input


 Unfortunately I am very new to augeas and don't really understand the
 references on this messages. So far I've seen that
  /usr/share/augeas/lenses/dist/inifile.aug:391.25-.43: refers to this
 piece of code   # *= comment* . record**


 I'm right now trying to understand if this is a permissions error or
 augeas version or syntax error but I haven't found much about what I'm
 reading on the debug output.

 Here's the versions of what I'm running.

 On Puppet Master

 ruby-augeas-0.4.1-3.el6.x86_64
 augeas-libs-1.0.0-7.el6.x86_64
 augeas-1.0.0-7.el6.x86_64

 puppet-3.8.1-1.el6.noarch
 puppetlabs-release-6-11.noarch
 puppet-server-3.8.1-1.el6.noarch


 On the agent

 taugeas-libs-1.0.0-7.el6.x86_64
 augeas-1.0.0-7.el6.x86_64
 ruby-augeas-0.4.1-3.el6.x86_64

 pe-puppet-enterprise-release-3.8.0.3-1.pe.el6.noarch
 puppet-3.8.1-1.el6.noarch
 puppetlabs-release-6-11.noarch

 Here's the code I'm using

 Samba init.pp

 # Samba base module.
 #
 class samba (
   $workgroup,
   $realm,
   $ensure = 'installed',
   $common_package = $samba::params::common_package,
   $server_pacakge = $samba::params::server_package,
   $winbind_package = $samba::params::winbind_package,
   $conf = $samba::params::conf,
   $winbind_service = $samba::params::winbind_service,
   $krb_package = $samba::params::krb_package,
   $krb_conf = $samba::params::krb_conf,
   $krb_keytab = $samba::params::krb_keytab,
 ) inherits samba::params {

   package { $common_package:
 ensure = $ensure,
   }

   augeas { 'global':
 incl= $conf,
 lens= 'Samba.lns',
 context = /files${conf}/*[. = \global\],
 changes = [
   set 'workgroup' ${workgroup},
   set 'realm' ${realm},
   set 'password server' *,
   set 'security' ads,
   set 'template shell' /bin/bash,
   set 'winbind use default domain' true,
   set 'winbind offline logon' true,
   set 'winbind rpc only' true,
   set 'winbind normalize names' true,
   set 'winbind refresh tickets' true,
   set 'idmap config * : backend' rid,
   set 'idmap config * : range' 16777216-33554431,
   set 'kerberos method' 'secrets and keytab',
   set 'local master' no,
   rm 'idmap uid',
   rm 'idmap gid',
   rm 'idmap backend',
 ],
   }

   exec { /bin/sed -i -r -e \/^\\s*([;#].*)?\$/ d\ -e \s/^\\s*([^[])/
  \\1/\ -e \s/^[[].*/\\n/\ ${conf}:
 refreshonly = true,
 subscribe   = Augeas['global'],
   }

 }

 For Samba param.pp
 # Samba module parameters.
 #
 class samba::params {

   case $::osfamily {

 'RedHat': {

   if $::operatingsystemmajrelease == '5' {
 $base_name = 'samba3x'
   } else {
 $base_name = 'samba'
   }

   $server_package = $base_name
   $common_package = ${base_name}-common
   $winbind_package = ${base_name}-winbind

   $conf = '/etc/samba/smb.conf'

   $winbind_service = 'winbind'

   $krb_package = 'krb5-workstation'
   $krb_conf = '/etc/krb5.conf'
   $krb_keytab = '/etc/krb5.keytab'

 }

 default: {
   fail('Unsupported operating system')
 }

   }

 }


 Would appreciate any help you can give me. Thanks in advance







 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to puppet-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/puppet-users/2fab346b-e0a4-42eb-85c3-d81fc37f6b0e%40googlegroups.com
 

[Puppet Users] Puppet noop and Rsync

2015-08-04 Thread Sergiu Cornea
Good morning guys,

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

Or I am missing something?

Thank you,

Regards,
Sergiu

-- 


This message and its attachments are private and confidential. If you have 
received this message in error, please notify the sender and remove it and 
its attachments from your system.

The University of Westminster is a charity and a company 
limited by guarantee. Registration number: 977818 England. 
Registered Office: 309 Regent Street, London W1B 2UW.

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/90beeac3-a06c-461f-a4b7-3fab1132525d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2015-08-04 Thread Arnaud Gomes-do-Vale
Martin Alfke tux...@gmail.com writes:

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

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

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: A 
duplicate resource was found while collecting exported resources, with the type 
and title File[/etc/dsh/group/mobius-backoffice] on node 
access.syltest.ymagis.com

I hadn't even tried it, but this is what I expected.

-- 
Arnaud

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


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

2015-08-04 Thread Martin Alfke

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

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

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

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

On the servers:

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

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

On the Client:

Dsh_group  | tag == ‘ssh’ |


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

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


Re: [Puppet Users] Re: Augeas failing when acting on smb.conf

2015-08-04 Thread Fabrizio Zelaya
Martin: We don't use templates because our server have different shares and
printers declare on smb.conf and we don't want to touch that. We want
puppet to manage only the part that's relevant to DC.

Werner and Raphael: Thanks for clarifying a little bit, as I mentioned I'm
very new to augeas and I'm trying to make sense of the messages too.

There's no line 2545 and on line 67 I got
idmap config * : backend = rid

There's no column 2545 either following lines are
   winbind rpc only = true
   winbind normalize names = true





On Tue, Aug 4, 2015 at 10:29 AM, Raphaël Pinson 
raphael.pin...@camptocamp.com wrote:

 Sorry, my bad. What's on line 67 of your file?


 On Tuesday, August 4, 2015 at 3:05:12 PM UTC+2, Werner Flamme wrote:

 Raphaël Pinson [04.08.2015 14:03]:
  Hello,
 
 
  What do you have on line 2545 in your smb.conf?

 Isn't this line 67, character 2545?

 I guess the characters are counted through the whole file and not for
 each line ;)

 
 
 
  Regards,
 
  Raphaël Pinson
 
 
 
 
  On Monday, August 3, 2015 at 11:04:01 PM UTC+2, Fabrizio Zelaya wrote:
 
  Hello everyone!
 
  I am trying to run puppet agent on a SL-6 Machine and one action I'm
  trying to apply is to add the machine to our domain. However I ran
 into an
  issue when running puppet agent -t
 
  Debug: Augeas[global](provider=augeas): Opening augeas with root /,
 lens
  path /var/lib/puppet/lib/augeas/lenses, flags 64
  Debug: Augeas[global](provider=augeas): Augeas version 1.0.0 is
 installed
  Warning: Augeas[global](provider=augeas): Loading failed for one or
 more
  files, see debug for /augeas//error output
  Debug: Augeas[global](provider=augeas):
  /augeas/files/etc/samba/smb.conf/error = parse_failed
  Debug: Augeas[global](provider=augeas):
  /augeas/files/etc/samba/smb.conf/error/pos = 2545
  Debug: Augeas[global](provider=augeas):
  /augeas/files/etc/samba/smb.conf/error/line = 67
  Debug: Augeas[global](provider=augeas):
  /augeas/files/etc/samba/smb.conf/error/char = 0
  Debug: Augeas[global](provider=augeas):
  /augeas/files/etc/samba/smb.conf/error/lens =
  /usr/share/augeas/lenses/dist/inifile.aug:391.25-.43:
  Debug: Augeas[global](provider=augeas):
  /augeas/files/etc/samba/smb.conf/error/message = Get did not match
 entire
  input
 


 --


 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to puppet-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/puppet-users/6a25b9c4-0cd8-4189-a54c-0b90bfeac924%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/6a25b9c4-0cd8-4189-a54c-0b90bfeac924%40googlegroups.com?utm_medium=emailutm_source=footer
 .

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




-- 
Faltan 43 en Ayotzinapa!
Faltan 43 en Mi Casa!

Fabrizio Zelaya
Systems Administrator

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


[Puppet Users] Failed to apply catalog: no 'environments' in ... error

2015-08-04 Thread George Macon
I recently upgraded my deployment from 2.7 to 3.8.1.  I'm using the
apt.puppetlabs.com package for Ubuntu Precise.  Since that upgrade,
I've been periodically seeing this error from my agents in the puppet
dashboard.

Failed to apply catalog: no 'environments' in
{:root_environment=#Puppet::Node::Environment:0x7f4602a679b8
@watching=true, @config_version=nil, @manifest=:no_manifest,
@modulepath=[], @name=:*root*,
:http_pool=#Puppet::Network::HTTP::Pool:0x7f45ff6ab638
@factory=#Puppet::Network::HTTP::Factory:0x7f45ff6ab4f8,
@keepalive_timeout=4,
@pool={#Puppet::Network::HTTP::Site:0x7f45ff5c16a0 @scheme=https,
@port=8140, @host=puppet=[#Puppet::Network::HTTP::Session:0x7f45ffb73300
@expiration_time=Tue Aug 04 08:25:30 -0400 2015,
@connection=#Net::HTTP puppet:8140 open=true]},
:current_environment=#Puppet::Node::Environment:0x7f45ff5b9d88
@watching=true, @config_version=nil, @manifest=:no_manifest,
@modulepath=[], @name=production} at top of [[0, nil, nil], [14,
{:root_environment=#Puppet::Node::Environment:0x7f4602a679b8
@watching=true, @config_version=nil, @manifest=:no_manifest,
@modulepath=[], @name=:*root*,
:current_environment=#Puppet::Node::Environment:0x7f4602a679b8
@watching=true, @config_version=nil, @manifest=:no_manifest,
@modulepath=[], @name=:*root*}, root], [15,
{:root_environment=#Puppet::Node::Environment:0x7f4602a679b8
@watching=true, @config_version=nil, @manifest=:no_manifest,
@modulepath=[], @name=:*root*,
:http_pool=#Puppet::Network::HTTP::Pool:0x7f45ff6ab638
@factory=#Puppet::Network::HTTP::Factory:0x7f45ff6ab4f8,
@keepalive_timeout=4,
@pool={#Puppet::Network::HTTP::Site:0x7f45ff5c16a0 @scheme=https,
@port=8140, @host=puppet=[#Puppet::Network::HTTP::Session:0x7f45ffb73300
@expiration_time=Tue Aug 04 08:25:30 -0400 2015,
@connection=#Net::HTTP puppet:8140 open=true]},
:current_environment=#Puppet::Node::Environment:0x7f4602a679b8
@watching=true, @config_version=nil, @manifest=:no_manifest,
@modulepath=[], @name=:*root*}, ]]

I think this messages comes from here:
https://github.com/puppetlabs/puppet/blob/3.8.1/lib/puppet/context.rb#L54.

I'm using directory environments (though there's only one environment:
production).  My puppetmaster is running on passenger 5.0.14.  Here
are the Passenger configuration lines from my apache config:

PassengerHighPerformance on
PassengerMaxPoolSize 12
PassengerPoolIdleTime 1500
PassengerStatThrottleRate 120
PassengerSpawnMethod direct

These are what I think are the relevant lines from puppet.conf:

[master]
environmentpath=$confdir/environments
environment_timeout=unlimited
always_cache_features=true

In attempting to fix the issue, I've cleaned the /var/lib/puppet
directories (except for the ssl subdir) on the agents and the master.

As of now, I've never noticed this error when running puppet agent -t,
only during natural runs.

-- 
George Macon
george.ma...@gmail.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/CAJtuvcmMa%3DUQT220%2B0SpZ5KzcP2bj_Boeu2MZkUi8Ur%3DPOqe5w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Augeas failing when acting on smb.conf

2015-08-04 Thread Fabrizio Zelaya
Here's the file and I will open a bug report too. Maybe between here and
there we can find the issue.

Thank you!

On Tue, Aug 4, 2015 at 10:42 AM, Raphaël Pinson 
raphael.pin...@camptocamp.com wrote:

 Is there a way you can post the entire file somewhere maybe? Ideally even
 open a bug report on Augeas, with the file.



 On Tuesday, August 4, 2015 at 4:35:38 PM UTC+2, Fabrizio Zelaya wrote:

 Martin: We don't use templates because our server have different shares
 and printers declare on smb.conf and we don't want to touch that. We want
 puppet to manage only the part that's relevant to DC.

 Werner and Raphael: Thanks for clarifying a little bit, as I mentioned
 I'm very new to augeas and I'm trying to make sense of the messages too.

 There's no line 2545 and on line 67 I got
 idmap config * : backend = rid

 There's no column 2545 either following lines are
winbind rpc only = true
winbind normalize names = true





 On Tue, Aug 4, 2015 at 10:29 AM, Raphaël Pinson 
 raphael...@camptocamp.com wrote:

 Sorry, my bad. What's on line 67 of your file?


 On Tuesday, August 4, 2015 at 3:05:12 PM UTC+2, Werner Flamme wrote:

 Raphaël Pinson [04.08.2015 14:03]:
  Hello,
 
 
  What do you have on line 2545 in your smb.conf?

 Isn't this line 67, character 2545?

 I guess the characters are counted through the whole file and not for
 each line ;)

 
 
 
  Regards,
 
  Raphaël Pinson
 
 
 
 
  On Monday, August 3, 2015 at 11:04:01 PM UTC+2, Fabrizio Zelaya
 wrote:
 
  Hello everyone!
 
  I am trying to run puppet agent on a SL-6 Machine and one action I'm
  trying to apply is to add the machine to our domain. However I ran
 into an
  issue when running puppet agent -t
 
  Debug: Augeas[global](provider=augeas): Opening augeas with root /,
 lens
  path /var/lib/puppet/lib/augeas/lenses, flags 64
  Debug: Augeas[global](provider=augeas): Augeas version 1.0.0 is
 installed
  Warning: Augeas[global](provider=augeas): Loading failed for one or
 more
  files, see debug for /augeas//error output
  Debug: Augeas[global](provider=augeas):
  /augeas/files/etc/samba/smb.conf/error = parse_failed
  Debug: Augeas[global](provider=augeas):
  /augeas/files/etc/samba/smb.conf/error/pos = 2545
  Debug: Augeas[global](provider=augeas):
  /augeas/files/etc/samba/smb.conf/error/line = 67
  Debug: Augeas[global](provider=augeas):
  /augeas/files/etc/samba/smb.conf/error/char = 0
  Debug: Augeas[global](provider=augeas):
  /augeas/files/etc/samba/smb.conf/error/lens =
  /usr/share/augeas/lenses/dist/inifile.aug:391.25-.43:
  Debug: Augeas[global](provider=augeas):
  /augeas/files/etc/samba/smb.conf/error/message = Get did not match
 entire
  input
 


 --


 --
 You received this message because you are subscribed 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/6a25b9c4-0cd8-4189-a54c-0b90bfeac924%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/6a25b9c4-0cd8-4189-a54c-0b90bfeac924%40googlegroups.com?utm_medium=emailutm_source=footer
 .

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




 --
 Faltan 43 en Ayotzinapa!
 Faltan 43 en Mi Casa!

 Fabrizio Zelaya
 Systems Administrator

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to puppet-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/puppet-users/9b2bb310-1dc9-43cd-8865-b4f73b0c3978%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/9b2bb310-1dc9-43cd-8865-b4f73b0c3978%40googlegroups.com?utm_medium=emailutm_source=footer
 .

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




-- 
Faltan 43 en Ayotzinapa!
Faltan 43 en Mi Casa!

Fabrizio Zelaya
Systems Administrator

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


smb.conf
Description: Binary data


Re: [Puppet Users] Re: Augeas failing when acting on smb.conf

2015-08-04 Thread Raphaël Pinson
Sorry, my bad. What's on line 67 of your file?

On Tuesday, August 4, 2015 at 3:05:12 PM UTC+2, Werner Flamme wrote:

 Raphaël Pinson [04.08.2015 14:03]: 
  Hello, 
  
  
  What do you have on line 2545 in your smb.conf? 

 Isn't this line 67, character 2545? 

 I guess the characters are counted through the whole file and not for 
 each line ;) 

  
  
  
  Regards, 
  
  Raphaël Pinson 
  
  
  
  
  On Monday, August 3, 2015 at 11:04:01 PM UTC+2, Fabrizio Zelaya wrote: 
  
  Hello everyone! 
  
  I am trying to run puppet agent on a SL-6 Machine and one action I'm 
  trying to apply is to add the machine to our domain. However I ran into 
 an 
  issue when running puppet agent -t 
  
  Debug: Augeas[global](provider=augeas): Opening augeas with root /, 
 lens 
  path /var/lib/puppet/lib/augeas/lenses, flags 64 
  Debug: Augeas[global](provider=augeas): Augeas version 1.0.0 is 
 installed 
  Warning: Augeas[global](provider=augeas): Loading failed for one or 
 more 
  files, see debug for /augeas//error output 
  Debug: Augeas[global](provider=augeas): 
  /augeas/files/etc/samba/smb.conf/error = parse_failed 
  Debug: Augeas[global](provider=augeas): 
  /augeas/files/etc/samba/smb.conf/error/pos = 2545 
  Debug: Augeas[global](provider=augeas): 
  /augeas/files/etc/samba/smb.conf/error/line = 67 
  Debug: Augeas[global](provider=augeas): 
  /augeas/files/etc/samba/smb.conf/error/char = 0 
  Debug: Augeas[global](provider=augeas): 
  /augeas/files/etc/samba/smb.conf/error/lens = 
  /usr/share/augeas/lenses/dist/inifile.aug:391.25-.43: 
  Debug: Augeas[global](provider=augeas): 
  /augeas/files/etc/samba/smb.conf/error/message = Get did not match 
 entire 
  input 
  


 -- 




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


Re: [Puppet Users] Re: Augeas failing when acting on smb.conf

2015-08-04 Thread Raphaël Pinson
Is there a way you can post the entire file somewhere maybe? Ideally even 
open a bug report on Augeas, with the file.



On Tuesday, August 4, 2015 at 4:35:38 PM UTC+2, Fabrizio Zelaya wrote:

 Martin: We don't use templates because our server have different shares 
 and printers declare on smb.conf and we don't want to touch that. We want 
 puppet to manage only the part that's relevant to DC.

 Werner and Raphael: Thanks for clarifying a little bit, as I mentioned I'm 
 very new to augeas and I'm trying to make sense of the messages too.

 There's no line 2545 and on line 67 I got 
 idmap config * : backend = rid

 There's no column 2545 either following lines are 
winbind rpc only = true
winbind normalize names = true





 On Tue, Aug 4, 2015 at 10:29 AM, Raphaël Pinson raphael...@camptocamp.com 
 javascript: wrote:

 Sorry, my bad. What's on line 67 of your file?


 On Tuesday, August 4, 2015 at 3:05:12 PM UTC+2, Werner Flamme wrote:

 Raphaël Pinson [04.08.2015 14:03]: 
  Hello, 
  
  
  What do you have on line 2545 in your smb.conf? 

 Isn't this line 67, character 2545? 

 I guess the characters are counted through the whole file and not for 
 each line ;) 

  
  
  
  Regards, 
  
  Raphaël Pinson 
  
  
  
  
  On Monday, August 3, 2015 at 11:04:01 PM UTC+2, Fabrizio Zelaya wrote: 
  
  Hello everyone! 
  
  I am trying to run puppet agent on a SL-6 Machine and one action I'm 
  trying to apply is to add the machine to our domain. However I ran 
 into an 
  issue when running puppet agent -t 
  
  Debug: Augeas[global](provider=augeas): Opening augeas with root /, 
 lens 
  path /var/lib/puppet/lib/augeas/lenses, flags 64 
  Debug: Augeas[global](provider=augeas): Augeas version 1.0.0 is 
 installed 
  Warning: Augeas[global](provider=augeas): Loading failed for one or 
 more 
  files, see debug for /augeas//error output 
  Debug: Augeas[global](provider=augeas): 
  /augeas/files/etc/samba/smb.conf/error = parse_failed 
  Debug: Augeas[global](provider=augeas): 
  /augeas/files/etc/samba/smb.conf/error/pos = 2545 
  Debug: Augeas[global](provider=augeas): 
  /augeas/files/etc/samba/smb.conf/error/line = 67 
  Debug: Augeas[global](provider=augeas): 
  /augeas/files/etc/samba/smb.conf/error/char = 0 
  Debug: Augeas[global](provider=augeas): 
  /augeas/files/etc/samba/smb.conf/error/lens = 
  /usr/share/augeas/lenses/dist/inifile.aug:391.25-.43: 
  Debug: Augeas[global](provider=augeas): 
  /augeas/files/etc/samba/smb.conf/error/message = Get did not match 
 entire 
  input 
  


 -- 


 -- 
 You received this message because you are subscribed 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 javascript:.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/puppet-users/6a25b9c4-0cd8-4189-a54c-0b90bfeac924%40googlegroups.com
  
 https://groups.google.com/d/msgid/puppet-users/6a25b9c4-0cd8-4189-a54c-0b90bfeac924%40googlegroups.com?utm_medium=emailutm_source=footer
 .

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




 -- 
 Faltan 43 en Ayotzinapa!
 Faltan 43 en Mi Casa!

 Fabrizio Zelaya
 Systems Administrator



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/9b2bb310-1dc9-43cd-8865-b4f73b0c3978%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] How to make file_line autocreate files?

2015-08-04 Thread Arnaud Gomes-do-Vale
Hello,

I am trying to manage my dsh groups with Puppet. The way I'm trying to
do this:

- each node has a block like this in its manifest:

  @@file_line { ${::fqdn} in dsh group ${group}:
line = $::fqdn,
path = /etc/dsh/group/${group},
tag  = 'dsh',
  }

- each dsh client collects those File_line resources.

  File_line | tag == 'dsh' |

Of course, this fails:

Error: /Stage[main]/Dsh::Client/File_line[my.host in dsh group mygroup]: Could 
not evaluate: No such file or directory - /etc/dsh/group/mygroup

I can't manage every file in /etc/dsh/group/ explicitely, as the list is
not fixed (basically I want to create whatever group nodes register
themselves in).

How would you do this kind of thing? Modifying the file_line provider is
probably the easiest way (basically, you just have to change method
lines to return an empty list if the file does not exist), but I'm not
sure of the possible side effects.

-- 
Arnaud

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


Re: [Puppet Users] Puppet noop and Rsync

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

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

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

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

hth,
Martin

 
 Or I am missing something?
 
 Thank you,
 
 Regards,
 Sergiu
 
 This message and its attachments are private and confidential. If you have 
 received this message in error, please notify the sender and remove it and 
 its attachments from your system.
 
 The University of Westminster is a charity and a company limited by 
 guarantee. Registration number: 977818 England. Registered Office: 309 Regent 
 Street, London W1B 2UW.
 
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to puppet-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/puppet-users/90beeac3-a06c-461f-a4b7-3fab1132525d%40googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/0AE595FF-0393-44C1-91F2-9F731A9DC6CA%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


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

2015-08-04 Thread Arnaud Gomes-do-Vale
Arnaud Gomes-do-Vale arn...@glou.org writes:

 I may try to query the PuppetDB from a parser function to get the list
 of paths on the client; I am reading the docs at the moment.

Here is what I came up with, and it works for me. It assumes the
PuppetDB is on localhost:8080 as seen from the Puppet master, though; I
don't know if it would be easy to make it generic.



# 2015-08-04 Arnaud Gomes-do-Vale
#This function returns the list of files needed for file_line
#resources with a given tag.

module Puppet::Parser::Functions
  newfunction(:files_with_lines, :type = :rvalue) do |args|
# Argument parsing and some sanity checking.
if args.length != 1
  raise Puppet::ParseError, Must provide a single argument.
end
tag = args[0]
unless tag.instance_of? String
  raise Puppet::ParseError, I want a string.
end

# Initialise return value.
file_list = []

# Query PuppetDB.
# FIXME Do not hardcode!
uri = URI('http://localhost:8080/v3/resources/File_line')
params = {:query = '[=, tag, dsh_group]'}
uri.query = URI.encode_www_form(params)
resp = Net::HTTP.get_response(uri)

# Grab list of files from PuppetDB response.
if resp.is_a?(Net::HTTPSuccess)
  entries = JSON.load(resp.body)
  entries.each do |ent|
file_list.push ent[parameters][path]
  end
end

return file_list.uniq
  end
end

# EOF


-- 
Arnaud

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


[Puppet Users] PuppetDB - Report processor failed

2015-08-04 Thread Natraj L
Hi,

Iam seeing this error in my puppet master when there's a failed puppet run,

puppet-master[13195]: Report processor failed: Report from xxx contained no 
metrics, which is often caused by a failed catalog compilation. Unable to 
process.

These are my versions,

puppetdb-1.6.3-1.el6.noarch
puppetdb-terminus-1.6.3-1.el6.noarch
puppet-server-3.4.2-1.el6.noarch
puppet-3.4.2-1.el6.noarch


Puppet client : puppet-3.2.2-1.el6.noarch

I thought this issue is fixed with PuppetDB 1.6.2 
https://tickets.puppetlabs.com/browse/PDB-106, can someone please advise 
why i still see this error during failed puppet run.

Because of this the last puppet run report is not stored in the puppet DB 
so iam unable to query the last run report.

Is this issue can be resolved or are there other ways to query the last run 
summary report.


Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/33abd321-84ba-4b67-8046-b94cfae7b552%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Announce: PuppetDB 3.0.2 is available!

2015-08-04 Thread AJ Roetker
PuppetDB 3.0.2 - August 4, 2015

PuppetDB 3.0.2 Downloads



Available in native package format as part of Puppet Collection 1 (PC1).
More information on the PC1 repositories is available here:
http://bit.ly/1HQJDNb

Binary tarball: http://downloads.puppetlabs.com/puppetdb/

Source: http://github.com/puppetlabs/puppetdb

Please report feedback via the Puppet Labs tickets site, using an affected
PuppetDB version of 3.0.2: https://tickets.puppetlabs.com/browse/PDB

Documentation: http://docs.puppetlabs.com/puppetdb/3.0/

Puppet module: http://forge.puppetlabs.com/puppetlabs/puppetdb

PuppetDB 3.0.2 Release Notes




PuppetDB 3.0.2 is a bugfix release to address performance issues with the
aggregate-event-count and fact-paths endpoints as well as memory starvation
involving structured-facts.


   -

   Previously PuppetDB cached prepared statements for SQL queries. This
   caused memory starvation involving structured-facts where large
   structured-facts would create a new prepared statement object for each
   update. The large objects would accumulate in the cache due to the non-zero
   cache size. This release addresses this issue in two ways, by disabling the
   cache and changing the structured-facts update queries to be more
   efficient. (https://tickets.puppetlabs.com/browse/PDB-1721)

   -

   Given a large number of nodes and reports, consumers of the
   aggregate-event-counts endpoint were experiencing slow response times.
   These performance issues have have been addressed in this release. One
   notable outcome from these fixes is that the endpoint no longer requires a
   query parameter. (https://tickets.puppetlabs.com/browse/PDB-1809)



   -

   Some PuppetDB tables were never analyzed by the autovacuum analyzer
   which led to performance issues with the fact-paths endpoint. This release
   adds code to perform the analyze whenever PuppetDB schema are updated. (
   https://tickets.puppetlabs.com/browse/PDB-1812)



   -

   This release fixes an issue where the `max-frame-size` parameter was
   being ignored by consumers of the command queue, causing large commands to
   produce stacktraces in the PuppetDB log. (
   https://tickets.puppetlabs.com/browse/PDB-1812)


Contributors
---

Andrew Roetker, Jorie Tappa, Ken Barber, Melissa Stone, Nick Fagerlund, Rob
Browning, Russell Mull, Wyatt Alt

Cheers,
PuppetDB Team

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


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

2015-08-04 Thread Mike Reed
Thanks you Martin, that is exactly what I needed.

Cheers,

m.

On Monday, August 3, 2015 at 11:07:09 PM UTC-7, Martin Alfke wrote:


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

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

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

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


  notify {My Kernel version is = ${kernel_test_version} and I'm 
 going to upgrade : } 
  
  file { 
 /usr/src/linux-headers-${kernel_test_version}_${kernel_release_test_version}~precise1_all.deb
  
 : 
mode   = '755', 
ensure = 'present', 
source = 
 puppet:///modules/kernel/${kernel_test_version}_${kernel_release_test_version}~precise1_all.deb
  

   } 
} 

elsif ($::class == 'workstation') and ($::kernelmajversion = '3.11') 
 { 
  notify {My Kernel version is = ${kernel_test_version} so I don't 
 need to upgrade: } 
} 
  
  
  After invoking a puppet run, I can never get the evaluation of if to 
 actually take place and as a result, the elsif is invoked and regardless of 
 whether or not the kernel version is = 3.11, the if statement is never 
 run.  From what I gather, this means that the evaluation of if is never 
 happening and the resulting elsif is automatically invoked. 
  
  I've also seen some errors that pertain to string/float comparisons and 
 to my knowledge, facter data is coming back as a string and my version 
 number in the if statement (3.11) is a float and therefore can't be 
 compared due to comparison rules of different data types. 
  
  Does anybody have some words of wisdom that may lead me to the correct 
 syntax for what I'm trying to achieve? 
  
  Thanks in advance to the community for the help. 
  
  Cheers, 
  
  Mike 
  
  
  
  -- 
  You received this message because you are subscribed to the Google 
 Groups Puppet Users group. 
  To unsubscribe from this group and stop receiving emails from it, send 
 an email to puppet-users...@googlegroups.com javascript:. 
  To view this discussion on the web visit 
 https://groups.google.com/d/msgid/puppet-users/5f9249a2-1bab-4f7e-84b5-f5fa6afd3ad7%40googlegroups.com.
  

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



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


[Puppet Users] Puppet Module spec testing

2015-08-04 Thread Peter Berghold
Is there a newer set of documents on doing Spec testing of Puppet modules
than this link?
https://puppetlabs.com/blog/the-next-generation-of-puppet-module-testing

I am running into a brick wall getting this to work so I have to assume I'm
doing something wrong...

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


Re: [Puppet Users] Re: Windows batch file execution

2015-08-04 Thread Rob Reynolds
On Mon, Aug 3, 2015 at 8:47 AM, Dimitri Yioulos dyiou...@gmail.com wrote:

 Again, I'm close on this.  Using the correct path, as per Rob's write-up,
 did help.  If I run the manifest interactively from the node, it works.
 But, running it on schedule from the puppetmaster doesn't.  Any additional
 help would be greatly appreciated.


It might be time to explore shifting that quick script over to puppet
manifests so that Puppet can better handle the settings.

puppet module install puppetlabs/windows ;)


Here is what your first one should look like:

registry_key {
'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Active
Setup Temp Folders':
  ensure = present,
}

registry_value {
'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Active
Setup Temp Folders\StateFlags0100':
  ensure = present,
  data   = 2,
  type = 'dword',
}


Plus it doesn't have the issue of always running if there is nothing to do.
The exec you have will run every time and report on it.






 On Wednesday, July 29, 2015 at 3:48:50 PM UTC-4, Dimitri Yioulos wrote:

 Hello, all.

 I'm trying to execute the following batch file (sageset.bat) on Win2k8
 servers:

 @ECHO OFF
 REM Enable components to cleanup
 REG ADD
 HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Active
 Setup Temp Folders /v StateFlags0100 /d 2 /t REG_DWORD /f
 REG ADD
 HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\BranchCache
 /v StateFlags0100 /d 2 /t REG_DWORD /f
 REG ADD
 HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Downloaded
 Program Files /v StateFlags0100 /d 2 /t REG_DWORD /f
 REG ADD
 HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\GameNewsFiles
 /v StateFlags0100 /d 2 /t REG_DWORD /f
 ~

 It makes changes to registry settings so that the disk cleanup utility
 will do a more thorough job of cleanup.  It's the equivalent of running
 cleanmgr /d c: /sageset:100, which opens a dialog box that presents a
 list of files to clean that one can check.

 The following is in my manifest:

 exec { 'sageset.bat':
  path = $::path,
  command = cmd.exe /c c:\temp\sageset.bat,
  provider = windows,
  logoutput = true,
 }

 The results of the manifest run are that everything executed
 successfully.  However, if I run cleanmgr /d c: /sageset:100 after that,
 none of the boxes is checked.  Running the batch file in a Windows CLI does
 work, and if I run cleanmgr /d c: /sageset:100 after that, all of the
 boxes are checked.

 Why am I not getting this to work?

 Dimitri

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to puppet-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/puppet-users/5e717c33-6815-4e16-8833-fd12be0699a4%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/5e717c33-6815-4e16-8833-fd12be0699a4%40googlegroups.com?utm_medium=emailutm_source=footer
 .

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




-- 
Rob Reynolds
Developer, Puppet Labs

*PuppetConf 2015 http://2015.puppetconf.com/ is coming to Portland,
Oregon! Join us October 5-9.*
*Register now to take advantage of the Early Bird discount
https://www.eventbrite.com/e/puppetconf-2015-october-5-9-tickets-13115894995?discount=EarlyBird
*
*—**save $249!*

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