https://www.puppet.com/community logo
Join Slack
Powered by
# puppet
  • w

    whatsaranjit

    05/09/2022, 8:00 PM
    Put the
    $fqdn
    in the resource name.
  • m

    Massimiliano (Max)

    05/09/2022, 8:01 PM
    I understand what you mean, but... I try to explain the use case.
  • m

    Massimiliano (Max)

    05/09/2022, 8:03 PM
    1. consul runs services. 2. each service can have more than one host associated to it 3. I want to setup a monitoring check for the service and not for the host: the check would be the same for all the nodes within the same service.
  • m

    Massimiliano (Max)

    05/09/2022, 8:04 PM
    I understand that it's not possible... resource collection probably doesn't allow to check for dupilcates
  • v

    vchepkov

    05/09/2022, 8:04 PM
    the name of the resource doesn't have to be equal to the name of the check
  • w

    whatsaranjit

    05/09/2022, 8:04 PM
    The monitoring check can be whatever it needs to be. Puppet just needs to identify each of them uniquely.
  • v

    vchepkov

    05/09/2022, 8:06 PM
    https://github.com/sensu/sensu-puppet/blob/master/lib/puppet/type/sensu_check.rb#L59
  • v

    vchepkov

    05/09/2022, 8:06 PM
    https://github.com/sensu/sensu-puppet/blob/master/lib/puppet/type/sensu_check.rb#L59
  • v

    vchepkov

    05/09/2022, 8:06 PM
    so, use
    Copy code
    @@sensu_check{ "${facts['certname']}-check-consul-production-prod-postgres":
      name => 'check-consul-production-prod-postgres',
  • v

    vchepkov

    05/09/2022, 8:07 PM
    so, use
    Copy code
    @@sensu_check{ "${facts['certname']}-check-consul-production-prod-postgres":
      name => 'check-consul-production-prod-postgres',
  • m

    Massimiliano (Max)

    05/09/2022, 8:07 PM
    I was looking the same file 🙂
  • m

    Massimiliano (Max)

    05/09/2022, 8:07 PM
    yep... let's try
  • h

    hbui

    05/09/2022, 8:12 PM
    Is there a puppet query that will allow me to see the fact value for
    virtual
    for systems that have a specific class on it?
  • v

    vchepkov

    05/09/2022, 8:13 PM
    the answer is yes 🙂
  • h

    hbui

    05/09/2022, 8:15 PM
    It looks like I need some combo of the
    facts[]
    and
    resources[]
    endpoint, but I'm not sure how to join them
  • v

    vchepkov

    05/09/2022, 8:15 PM
    Copy code
    puppet query 'inventory[certname,facts.virtual]{resources { type = "Class" and title = "My_class"}}'
  • h

    hbui

    05/09/2022, 8:16 PM
    thank you!
    👍 1
  • h

    hbui

    05/09/2022, 8:17 PM
    @vchepkov++
  • d

    Dr Bunsen Honeydew

    05/09/2022, 8:17 PM
    vchepkov +1! (Karma: 5)
  • v

    vchepkov

    05/09/2022, 8:17 PM
    if only that worked 🙂
  • h

    hbui

    05/09/2022, 8:18 PM
    it did for me
  • v

    vchepkov

    05/09/2022, 8:18 PM
    I meant ➕ 🙂
  • v

    vchepkov

    05/09/2022, 8:18 PM
    I meant ➕
  • v

    vchepkov

    05/09/2022, 8:18 PM
    I meant ➕ 🙂
  • m

    Massimiliano (Max)

    05/09/2022, 8:20 PM
    it doesn't work.
    Copy code
    Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Puppet::Parser::Compiler failed with error ArgumentError: Cannot alias Sensu_check[puppetdb02.xxxx.org-check-consul-production-puppetdb] to ["check-consul-production-puppetdb", nil]; resource ["Sensu_check", "check-consul-production-puppetdb", nil] already declared on node prod-sensu01.xxxxx.xxxx
    as I understand puppet is checking the "name" in the end
  • h

    hbui

    05/09/2022, 8:21 PM
    in terms of duplication, it will check the name, but sometimes it will also check another parameter. e.g. the
    path
    parameter on a file resource can't be duplicated even if the resource title isn't duplicated.
    👍 1
  • h

    hbui

    05/09/2022, 8:22 PM
    in terms of duplication, it will check the name, but sometimes it will also check another parameter. e.g. the
    path
    parameter on a file resource can't be duplicated even if the resource title isn't duplicated.
  • w

    whatsaranjit

    05/09/2022, 8:24 PM
    You might try exporting the service names, then de-duping that array first before implementing resources: https://whatsaranjit.github.io/puppet/2017/07/22/Sharing_Data/
    👍 1
  • l

    Les Shiner

    05/09/2022, 8:25 PM
    Afternoon/Morning! Can anyone give me any advice on where to start researching deployment methods using Puppet/Puppet Bolt? To give an example of how/what I'm looking for. Let's say I have 1k agents. I would like to deploy to any amount at any given time. Whether that be 1 agent or the entire 1k.
  • l

    Les Shiner

    05/09/2022, 8:26 PM
    With multiple pieces of software
1...303132...428Latest