notify exec

asked 2016-02-15 13:39:53 -0500

updated 2016-02-15 21:24:13 -0500

I'm new to to puppet I'm trying to create a module that will install centrify and connect to our AD. When it runs for some reason it will create a krb5.conf.pre_ file instead of the krb5.conf. It always says that the module completed successfully. I also notice there isn't a krb5.conf file in /etc/. I don't know how It triggers my exec{} when there isn't any krb5.conf file If I comment out the exec {} and run the module the krb5.conf file is created. Once the krb5.conf file is created I'll manipulate my module and uncomment the exec{} and the machine is successfully joined to the Domain. I realize that there is a puppet module in puppetlabs for centrify but I wanted to try to create some on my own first.

class centrify {
  package { 'CentrifyDC-5.0.2-388.x86_64':
    ensure => installed,
  }->
  file { '/usr/bin/kerberos.sh':
    ensure => present,
    owner  => root,
    group => root,
    mode => 755,
    source => "puppet:///modules/centrify/kerberos.sh",
  }->
  file {'/usr/bin/unixjoin.keytab':
    ensure => present,
    owner  => root,
    group => root,
    mode => 755,
    source => "puppet:///modules/centrify/unixjoin.keytab",
  }->
  file { '/etc/krb5.conf':
    ensure => present,
    owner  => root,
    group => root,
    mode => 755,
    content => template('centrify/krb5.conf.erb'),
    notify => Exec['/usr/bin/kerberos.sh'],
  }->
  exec { '/usr/bin/kerberos.sh':
    command => ['/bin/bash /usr/bin/kerberos.sh'],
    refreshonly => true,
  }
}
edit retag flag offensive close merge delete

Comments

What output, if any, do you get from running puppet parser validate against your manifest?

UBPClaw gravatar imageUBPClaw ( 2016-02-15 18:39:27 -0500 )edit

I added some line breaks and formatting so people can read it more easily.

Alex Harvey gravatar imageAlex Harvey ( 2016-02-15 21:24:31 -0500 )edit

I just ran a puppet parser validate on the file and there's no issue.

Alex Harvey gravatar imageAlex Harvey ( 2016-02-15 21:26:52 -0500 )edit

I don't see how that's possible based on the code @mcell0042 - can you update your post to include the output you see when you apply this for the first time on a clean box? Thanks.

Alex Harvey gravatar imageAlex Harvey ( 2016-02-15 21:28:04 -0500 )edit