Ask Your Question
0

stuck in a reboot loop

asked 2016-06-27 13:56:17 -0500

tylerecouture gravatar image

I have Ubuntu 16.04 Desktop clients controlled with puppet.

After an install completes, the first puppet sets up LDAP then reboots the computer, however it seems to be stuck in an infinite reboot loop.

Here is the puppet manifest that triggers the reboot. Can anyone see why this results in an infinite reboot loop?

Note that it all works if I remove the reboot (and instead manually reboot after an install)

class ldap_client {

  package { libnss-ldap:
    ensure => present,
    notify => Reboot['after_run'],
  }

  file { 'ldap.conf':
    path    => '/etc/ldap.conf',
    ensure  => file,
    require => Package['libnss-ldap'],
    source  => "puppet:///modules/ldap_client/ldap.conf",
    notify  => Reboot['after_run'],
  }

  file { 'ldap.secret':
    path    => '/etc/ldap.secret',
    ensure  => file,
    require => Package['libnss-ldap'],
    mode    => '0400',
    source  => "puppet:///modules/ldap_client/ldap.secret",
    notify  => Reboot['after_run'],
  }

  file { 'nsswitch.conf':
    path    => '/etc/nsswitch.conf',
    ensure  => file,
    require => Package['libnss-ldap'],
    source  => "puppet:///modules/ldap_client/nsswitch.conf",
    notify  => Reboot['after_run'],
    # This file is in: modules/ldap_client/files
  }

  file { 'common-session':
    path    => '/etc/pam.d/common-session',
    ensure  => file,
    require => Package['libnss-ldap'],
    source  => "puppet:///modules/ldap_client/pam.d/common-session",
    notify  => Reboot['after_run'],
  }

  class { 'fstab' : }

  fstab::mount { '/home':
    ensure  => 'mounted',
    device  => '192.168.0.6:/nfshome',
    options => 'auto,noatime,bg,tcp,hard',
    fstype  => 'nfs',
    notify  => Reboot['after_run'],

  }

  reboot { 'after_run':
    apply  => finished,
  }

  file { '/etc/lightdm':
    ensure  => directory,
  }

  file { 'lightdm.conf':
    path    => '/etc/lightdm/lightdm.conf',
    ensure  => file,
    source  => "puppet:///modules/ldap_client/lightdm/lightdm.conf",
    require => File['/etc/lightdm'],
  }

}
edit retag flag offensive close merge delete

Comments

What if you change apply => finished And instead use when => pending

UBPClaw gravatar imageUBPClaw ( 2016-06-27 16:57:15 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2016-06-27 20:16:52 -0500

lupin gravatar image

You can re-arrange your dependency such that you only have to call Reboot after all the other stuff are done/complete.

package { 'libnss-ldap':
    ensure => 'installed'
} ->
file { ...
} ->
file { ..
} ~>
Reboot { 'foo':
   when => 'refreshed':
}
edit flag offensive delete link more

Comments

Thanks! Note: Invalid value at "refreshed". Valid values are immediately, finished

tylerecouture gravatar imagetylerecouture ( 2016-06-28 17:12:46 -0500 )edit

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-06-27 13:55:48 -0500

Seen: 54 times

Last updated: Jun 27 '16