0

I have setup cobbler that runs puppet automatically after OS installation. It works fine, except that it takes a while for puppet to install all of the packages. This is still a testing phase, so it was just around 15 packages in total. My site.pp looks like this:

node server1 {
              include myrepo
              include bacula
              include vsftpd
}

myrepo is just copying a repository file to the client server. bacula lists 11 packages to be installed, and vsftpd only 1 package.

Right after the OS (Suse) was installed, the repository file was copied over, vsftpd was installed, but only 2 bacula packages were installed in the client server. I had to wait for like half an hour or so before all of the bacula packages got installed. Puppet log is empty.

If I were to run puppet manually, the installation of the packages will run smoothly and fast. What could be the reason of the delay?

gidot
  • 33
  • 7

1 Answers1

1

Unless you set explicit dependencies, the ordering of resources may be a problem.
The way you wrote it does not mean that the repo will be deployed before applying the other classes.

For example this:

node server1 {

          class { 'myrepo': }

          class { 'bacula':
            require => Class['myrepo'],
          }
          class { 'vsftpd':
            require => Class['myrepo'],
          }
}

Would order it correctly.
You could also add a require myrepo to the vsftpd and bacula class.
There are many solutions to it.

If those are external modules then I always try to avoid changing them in any way to make updates easier.

See: https://puppet.com/docs/puppet/latest/lang_relationships.html

рüффп
  • 620
  • 1
  • 11
  • 25
faker
  • 17,496
  • 2
  • 60
  • 70
  • I have `require myrepo` in each class. I tested a few times, and each time I logged in to SuSE right after it was installed, some of the packages were left out. However, if I didn't do anything say for about 5 minutes or so before logging in and checking the packages, all is good. I just don't see what could affect the installation of the packages with me logging in and running some commands (rpm -qa, zypper se, etc). – gidot Dec 27 '14 at 10:42
  • That sounds very strange. Can you check the Puppet log from the first run somehow? Or maybe the first run just takes too long and you are logging in before it's done? – faker Dec 27 '14 at 11:38
  • Nothing in the log. Well even if the first run takes too long to finish, I don't think by logging in to the system it would break the process, no? – gidot Dec 31 '14 at 03:19
  • There should be something in the log, at least at some point the installation of the package must be in the log. It's really hard to tell without having the full manifests though. – faker Dec 31 '14 at 16:44
  • Well the log says _Reopening log files_. That was it. – gidot Jan 02 '15 at 04:26
  • Update: It works fine now. Not sure what went wrong last time.. hmm. – gidot Jan 02 '15 at 06:33