Grouping resources into arrays is very helpful, but it only works with instances of a single resource type. What if you want to group resources of different types? Let's take an example: creating scheduled jobs that run a script at a particular time. For each job, we need to have Puppet deploy the script file itself to the server:
file { '/usr/local/bin/backup_database': source => 'puppet:///modules/scripts/backup_database', mode => '0755', }
We also need to create a cron
resource to run the script:
cron { 'Run backup_database': command => '/usr/local/bin/backup_database', hour => '00', minute => '00', }
So far, so good. But when you have ten jobs to run, all this typing gets a little repetitive:
file { '/usr/local/bin/job1': source => 'puppet:///modules/scripts/job1', mode => '0755', } cron { 'Run job1': command => '/usr/local/bin/job1', hour => '00', minute => '00', } file { '/usr/local/bin/job2': source => 'puppet...