On 10/16/2014 10:02 AM, AAB !! wrote:
> Secondly, would the following execute "apt-get update" every time on
> agent's scheduled execution (runinterval) ? or would it only run for the
> first time and would not run unless some changes are made to this class
> file on puppet master ?
>
> exec {'apt-update':
> command => "/usr/bin/apt-get update",
> require => exec ['apt'],
> }
> Actually I can see *puppet-agent[2953]:
> (/Stage[main]/testing-server/Exec[apt-update]/returns) executed
> successfully *after every three minutes (runinterval=180) in the log
> file (syslog).
>
Yes, your exec block there is telling it to run apt-get update ever
time it does a catalog run. A far better option would be to enable to
unattended upgrades options in the apt module and it should perform this
for you on a regular basis.