Ask Your Question
0

How to manage NIS client - Could not evaluate: Could not find init script or upstart conf file for 'nis'

asked 2016-11-01 16:03:21 -0500

gene gravatar image

I'm trying to manage nis client on Ubuntu 14.04. I'm getting "Could not evaluate: Cold not find init script or upstart conf file for 'nis'".

Here is the module being called:

class profile::buildserver::nisclient {
  package { 'nis':
    ensure  => 'installed',
    before  => File['/etc/yp.conf'],
  }
  file { '/etc/yp.conf' :
    ensure  => file,
    owner   => 'root',
    group   => 'root',
    mode    => '0600',
    require => Package['nis'],
    # the path below translates to /etc/puppetlabs/code/environment/production/modules/profile/files/yp.conf
    source  => "puppet:///modules/profile/yp.conf",
  }
  service { 'nis':
    ensure     => running,
    enable     => true,
    subscribe  => File['/etc/yp.conf'],
  }
}

When I run 'puppet agent -t' on the node I get:

root@nervy:~# puppet agent -t
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for nervy.
Info: Applying configuration version '1478028109'
Error: /Stage[main]/Profile::Buildserver::Nisclient/Service[nis]: Could not evaluate: Could not find init script or upstart conf file for 'nis'
Notice: Applied catalog in 1.86 seconds

I see that the /etc/yp.conf file is deployed but I'm guessing it is failing on trying to restart nis... In my searching on ask.puppet.com, i found a similar problem with sshd but that was related to an incorrect service name (yum vs apt) which I don't think is the case here. If anyone can point me in the right direction, I would be most grateful.

Puppet agent version is 4.7.0 and server is 4.5.2.

thanks,

Gene

edit retag flag offensive close merge delete

Comments

Seems to me that the nis service is not listed in /etc/init.d/ or /etc/init. I take it you can 'service' status and restart nis on this server and its only puppet that you have the issue with not the actual installation of the nis client.

Kevin T gravatar imageKevin T ( 2016-11-02 08:47:09 -0500 )edit

Hmm. There is no /etc/init.d/nis. This is Ubuntu 14.04. There is an /etc/init/ypbind.conf I see. 'service ypbind status' returns valid status. I have a vm i'm running the same manifests against. It is Ubuntu 16.04 though and it doesn't see this issue. On that system, /etc/init.d/nis exists.

gene gravatar imagegene ( 2016-11-02 14:22:09 -0500 )edit

I'm thinking I need to put code in that says the service name is ypbind if ubnunt 14.04?? I've seen examples of something similar but haven't done that myself yet. I'll see if that does the trick.

gene gravatar imagegene ( 2016-11-02 14:45:43 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-11-02 15:07:11 -0500

gene gravatar image

updated 2016-11-02 15:16:47 -0500

I got around this by adding code in the manifest to detect the operating system major release and setting the service name accordingly. I'm open to suggestions if this is best practice or not.... I'm pretty new still with puppet but something is nagging me telling me I should do this with hiera somehow, but I'm not sure how to do that yet.

class profile::buildserver::nisclient {

    case $::osfamily {
        'Debian': {
            case $::operatingsystemmajrelease {
                '14.04': {
                    $servicename = 'ypbind'
                 }
                 default: {
                    $servicename = 'nis'
                 }
             }
          }
      default: {
          $servicename = 'nis'
       }
    }

  package { 'nis':
    ensure  => 'installed',
    before  => File['/etc/yp.conf'],
  }

  file { '/etc/yp.conf' :
    ensure  => file,
    owner   => 'root',
    group   => 'root',
    mode    => '0600',
    require => Package['nis'],
    # the path below translates to /etc/puppetlabs/code/environment/production/modules/profile/files/yp.conf
    source  => "puppet:///modules/profile/yp.conf",
  }

  service { $servicename :
    ensure     => running,
    enable     => true,
    subscribe  => File['/etc/yp.conf'],
  }

}
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-11-01 16:03:21 -0500

Seen: 49 times

Last updated: Nov 02 '16