Augeas failing when acting on smb.conf

383 views
Skip to first unread message

Fabrizio Zelaya

unread,
Aug 3, 2015, 5:04:01 PM8/3/15
to Puppet Users
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







Martin

unread,
Aug 4, 2015, 3:34:30 AM8/4/15
to Puppet Users
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
--
You received this message because you are subscribed 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/2fab346b-e0a4-42eb-85c3-d81fc37f6b0e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Raphaël Pinson

unread,
Aug 4, 2015, 8:08:15 AM8/4/15
to Puppet Users
Hello,


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



Regards,

Raphaël Pinson

Werner Flamme

unread,
Aug 4, 2015, 9:05:12 AM8/4/15
to puppet...@googlegroups.com
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 ;)
--


Raphaël Pinson

unread,
Aug 4, 2015, 10:29:44 AM8/4/15
to Puppet Users, werner...@ufz.de
Sorry, my bad. What's on line 67 of your file?

Fabrizio Zelaya

unread,
Aug 4, 2015, 10:35:38 AM8/4/15
to puppet...@googlegroups.com
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





--
You received this message because you are subscribed 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.

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



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

Fabrizio Zelaya
Systems Administrator

Raphaël Pinson

unread,
Aug 4, 2015, 10:42:58 AM8/4/15
to Puppet Users
Is there a way you can post the entire file somewhere maybe? Ideally even open a bug report on Augeas, with the file.

Fabrizio Zelaya

unread,
Aug 4, 2015, 10:56:08 AM8/4/15
to puppet...@googlegroups.com
Here's the file and I will open a bug report too. Maybe between here and there we can find the issue.

Thank you!


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

Josh Sinfield

unread,
Feb 25, 2016, 7:41:29 AM2/25/16
to Puppet Users
Hi,

I think this is the error you are seeing:

We also receive this error.
There seems to be no rpm package available for RHEL6 >1.0.0 nor >1.1.0 for RHEL7. >=1.2.0 contains the fix we need. 1.2.0 is available on RHEL5 however?!?!

I am going to look at building our own rpm from source, but don't have time right now. I tried yesterday but it failed near the end.

Cheers,
Josh

David Lutterkort

unread,
Feb 26, 2016, 12:20:12 PM2/26/16
to Puppet Users
On Thursday, February 25, 2016 at 4:41:29 AM UTC-8, Josh Sinfield wrote:
Hi,

I think this is the error you are seeing:

We also receive this error.
There seems to be no rpm package available for RHEL6 >1.0.0 nor >1.1.0 for RHEL7. >=1.2.0 contains the fix we need. 1.2.0 is available on RHEL5 however?!?!

I am going to look at building our own rpm from source, but don't have time right now. I tried yesterday but it failed near the end.

You don't necessarily have to rebuild the RPM. Try to drop a newer samba.aug (e.g., from augeas 1.4.0) into /usr/share/augeas/lenses/ and see if that resolves the issue. By default, Augeas loads lenses from /usr/share/augeas/lenses and /usr/share/augeas/lenses/dist, in that order; the latter is reserved for the lenses that ship with Augeas, but the former is the right place to drop user-defined lenses, or overrides of lenses that ship with it.

David

Josh Sinfield

unread,
Mar 10, 2016, 6:42:57 AM3/10/16
to Puppet Users
Hi David,

Thanks very much for your message, I can confirm this worked! 
I dropped the new samba.aug into /usr/share/augeas/lenses and it fixed the issue.

Appreciate your help.

Cheers,
Josh
Reply all
Reply to author
Forward
0 new messages