voxpupuli / puppet-bareos

Puppet Module to manage bareos
https://forge.puppetlabs.com/project0/bareos
Apache License 2.0
13 stars 36 forks source link

[Question] How to declare @resource in filesets #134

Closed Orest-Worhacz closed 1 year ago

Orest-Worhacz commented 1 year ago

Affected Puppet, Ruby, OS and module versions/distributions

How to reproduce (e.g Puppet code you use)

::bareos::director::fileset { 'weekly_fileset_for_some_server':
  include     => {
    'Options' => {
      'Signature' => 'MD5',
    },
    '@/net/server.tld/export/resource1',
    '@/net/server.tld/export/resource2',
  },
}

What are you seeing

Puppet indicates syntax error

What behavior did you expect instead

Puppet should produce following config:

FileSet {
  Name = "weekly_fileset_for_some_server"
  Include {
    Options {
      signature = MD5
    }
        @/net/server.tld/export/resource1
        @/net/server.tld/export/resource2
  }
}

Output log

Syntax error:
Error: Could not parse for environment production: Syntax error at '@/net/server.tld/export/resource1' (file: /etc/puppetlabs/code/environments/its/modules/its_bareos/manifests/filesets.pp, line: 416, column: 7)

Any additional information you'd like to impart

I am referring to https://docs.bareos.org/Configuration/Director.html#fileset-include-resource What am I missing?

Orest-Worhacz commented 1 year ago

Actually I look at the code now: https://github.com/voxpupuli/puppet-bareos/blob/0.4.0/templates/resource.erb and it seems that I need to specify resource and settings. Is there no way around? To specify just a resource without the settings?

Orest-Worhacz commented 1 year ago

I managed to work it around by using File resource and putting ready custom config files. But the issue persists. From my point of view https://github.com/voxpupuli/puppet-bareos/blob/0.4.0/templates/resource.erb should be modified.

Orest-Worhacz commented 1 year ago

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Could not find resource 'Bareos::Director::Fileset[weekly_fileset_for_some_server]' in parameter 'require' (file: /etc/puppetlabs/code/environments/production/modules_external/bareos/manifests/director/job.pp, line: 824) on node bareos-puppet.tld

Orest-Worhacz commented 1 year ago

I also managed to make it work by putting custom file with job definition using File resource.