On Mon, 2017-05-29 at 18:09 +0200, Thomas Gelf wrote:

> Did you try to define an import source fetching apache::vhost? I'd
> then
> create a sync rule creating single services from that source. When
> doing
> so please follow the host!service convention when defining the "key"
> column. I have no Puppet environment to play with at disposition
> right
> now, so no practical example - sorry.

Hi Thomas,

coming back to this after some time away.  As far as I can see there
isn't a way to import the apache::vhost resource.

This is how to apache vhost resource looks (for our apache module) like
in the PuppetDB:


 {
  "tags" : [ "apache", "apache::vhost", "graphite-web",
"graphitedd.ugent.be", "class", "uggraphite", "vhost", "node" ],
  "file" :
"/etc/puppet/environments/production/modules/uggraphite/manifests/init.
pp",
  "type" : "Apache::Vhost",
  "title" : "graphite-web",
  "line" : 233,
  "resource" : "ec76d4e3936312123066a61e82cc1a08f2e659a9",
  "environment" : "production",
  "certname" : "graphite8.ugent.be",
  "parameters" : {
    "priority" : "2",
    "docroot" : "/var/www",
    "access_log_format" : "combined",
    "include" : "",
    "serveraliases" : "",
    "port" : "80",
    "indexes_enabled" : true,
    "template" : "uggraphite/graphite-vhost.erb",
    "vhostip" : "*",
    "customlogging" : false
  },
  "exported" : false
} 


1) The resource attribute isn't unique.  I actually have 10 resources
in the puppetdb with value 'ec76d4e3936312123066a61e82cc1a08f2e659a9'.
(Icinga doesn't import that value even, I changed the php code to try
to use it, and then I saw that value isn't unique).

2) Applying join on 'parameters' gives me the error:
ErrorException in
/usr/share/icingaweb2/modules/director/library/Director/PropertyModifie
r/PropertyModifierJoin.php:32 with message: implode(): Invalid
arguments passed    #0 [internal function]:
Icinga\Application\ApplicationBootstrap-
>Icinga\Application\{closure}(2, 'implode(): Inva...'

Note that this still wouldn't make a a unique key.

Any idea's on how to import resources from Puppet?

What could make an unique value is joining:
$certname-$type-$title

But how do you make the modifier accesses multiple columns?

Thanks,

Rudy






-- 
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Rudy Gevaert                             e-mail: rudy.geva...@ugent.be
Directie ICT, Afdeling Infrastructuur
Groep Systemen                                      tel: +32 9 264 4750
Universiteit Gent                                   fax: +32 9 264 4994
Krijgslaan 281, gebouw S9, 9000 Gent, Belgie               www.UGent.be
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to