Ask Your Question
0

NTP package does not install on first puppet run on EC2 bootup

asked 2016-12-06 18:24:37 -0600

BellaXie gravatar image

updated 2016-12-06 19:07:08 -0600

DarylW gravatar image

Puppet version: 4.5.2

In the site manifest file, ntp module is included to install ntp service:

  class { '::ntp':
    servers         => [
      '0.au.pool.ntp.org',
      '1.au.pool.ntp.org',
      '2.au.pool.ntp.org',
      '3.au.pool.ntp.org'
    ],
    disable_monitor => true,
    package_ensure  => 'present',
    service_ensure  => 'running',
    service_enable  => true,
    restrict        => [
      'default kod nomodify notrap nopeer noquery',
      '-6 default kod nomodify notrap nopeer noquery',
      '127.0.0.1',
      '-6 ::1',
    ]
  }

The command of Puppet run is configured in the user data of the EC2 instance, puppet runs when the EC2 instance boot up and log to the file I specified so that I can check what's wrong there with the ntp service install, here is what I found in the log related to ntp:

^[[0;32mInfo: Caching catalog for nfs.demo-project2.com^[[0m
^[[0;36mDebug: /Package[ntp]: Provider apt does not support features virtual_packages; not managing attribute allow_virtual^[[0m

^[[0;32mInfo: Applying configuration version '1481067287'^[[0m
^[[0;36mDebug: /Stage[main]/Ntp/Anchor[ntp::begin]/before: subscribes to Class[Ntp::Install]^[[0m
^[[0;36mDebug: /Stage[main]/Ntp::Install/before: subscribes to Class[Ntp::Config]^[[0m
^[[0;36mDebug: /Stage[main]/Ntp::Config/notify: subscribes to Class[Ntp::Service]^[[0m
^[[0;36mDebug: /Stage[main]/Ntp::Service/before: subscribes to Anchor[ntp::end]^[[0m

^[[mNotice: Bella::debug::pkgname:ntp^[[0m

^[[mNotice: /Stage[main]/Ntp::Install/Notify[Bella::debug::pkgname:ntp]/message: defined 'message' as 'Bella::debug::pkgname:ntp'^[[0m

^[[0;36mDebug: /Stage[main]/Ntp::Install/Notify[Bella::debug::pkgname:ntp]: The container Class[Ntp::Install] will propagate my refresh event^[[0m

^[[0;36mDebug: Prefetching apt resources for package^[[0m

^[[0;36mDebug: Executing '/usr/bin/dpkg-query -W --showformat '${Status} ${Package} ${Version}\n''^[[0m

^[[0;36mDebug: Executing: '/usr/bin/dpkg-query -W --showformat '${Status} ${Package} ${Version}\n' ntp'^[[0m

^[[0;36mDebug: Executing: '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install ntp'^[[0m

^[[0;36mDebug: Class[Ntp::Install]: Resource is being skipped, unscheduling all events^[[0m

^[[0;32mInfo: Class[Ntp::Install]: Unscheduling all events on Class[Ntp::Install]^[[0m

^[[0;36mDebug: Class[Ntp::Config]: Resource is being skipped, unscheduling all events^[[0m

^[[mNotice: /Stage[main]/Ntp::Config/File[/etc/ntp.conf]: Dependency Package[ntp] has failures: true^[[0m

^[[0;36mDebug: /Stage[main]/Ntp::Config/File[/etc/ntp.conf]: Resource is being skipped, unscheduling all events^[[0m

^[[0;36mDebug: Class[Ntp::Config]: Resource is being skipped, unscheduling all events^[[0m

^[[0;36mDebug: Class[Ntp::Service]: Resource is being skipped, unscheduling all events^[[0m

^[[mNotice: /Stage[main]/Ntp::Service/Service[ntp]: Dependency Package[ntp] has failures: true^[[0m

^[[0;36mDebug: /Stage[main]/Ntp::Service/Service[ntp]: Resource is being skipped, unscheduling all events^[[0m

^[[0;36mDebug: Class[Ntp::Service]: Resource is being skipped, unscheduling all events^[[0m

^[[mNotice: /Stage[main]/Ntp/Anchor[ntp::end]: Dependency Package[ntp] has failures: true^[[0m

^[[0;36mDebug: /Stage[main]/Ntp/Anchor[ntp::end]: Resource is being skipped, unscheduling all events^[[0m

^[[0;36mDebug: Class[Ntp]: Resource is being skipped, unscheduling all events^[[0m

When I log in the server, and run puppet ... (more)

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2016-12-07 08:13:10 -0600

Emerson Prado gravatar image

updated 2017-04-10 12:00:42 -0600

May it be a timeout issue? I had similar problems with a Vagrant environment, and noticed the APT tasks took way longer than the Puppet resources standard timeout (2min, I think). The solution was to run such tasks manually, measure time to complete, add a generous safety margin and specify that timeout.

edit flag offensive delete link more

Comments

Thanks Emerson. Your answer reminded me something and I got the problem sorted eventually, although the root cause was not 100% sure.

BellaXie gravatar imageBellaXie ( 2016-12-08 21:32:50 -0600 )edit
0

answered 2016-12-06 23:05:31 -0600

BellaXie gravatar image

updated 2016-12-09 08:22:45 -0600

DarylW gravatar image

Problem sorted. The problem might be caused by the AMI I used to launch instances having Puppet installed already. It worked well when I use a simple Ubuntu AMI then install Puppet agent from scratch.

=========================================================================================

I did a quick test, in the user data of the EC2 instance, I scripted apt-get install straight away to install zip and ntp, they get installed successfully when the instance boot up.

and then I modified the site manifest file with simple install as shown:

node 'nfs.demo-project2.com' {

package {'zip': ensure=>'present',} package {'ntp': ensure=>'present',}

}

and then scripted puppet run from the EC2 user data, the packages failed to installed, same log found:

^[[0;36mDebug: Prefetching apt resources for package^[[0m

^[[0;36mDebug: Executing '/usr/bin/dpkg-query -W --showformat '${Status} ${Package} ${Version}\n''^[[0m

^[[0;36mDebug: Executing: '/usr/bin/dpkg-query -W --showformat '${Status} ${Package} ${Version}\n' zip'^[[0m

^[[0;36mDebug: Executing: '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install zip'^[[0m

^[[0;36mDebug: Executing: '/usr/bin/dpkg-query -W --showformat '${Status} ${Package} ${Version}\n' ntp'^[[0m

^[[0;36mDebug: Executing: '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install ntp'^[[0m

^[[0;36mDebug: Node[nfs.demo-project2.com]: Resource is being skipped, unscheduling all events^[[0m

^[[0;36mDebug: Class[Main]: Resource is being skipped, unscheduling all events^[[0m
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-12-06 18:24:37 -0600

Seen: 240 times

Last updated: Apr 10