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

    Slackbot

    05/09/2022, 8:26 PM
    This message was deleted.
    w
    l
    • 3
    • 2
  • v

    vchepkov

    05/09/2022, 8:29 PM
    @Massimiliano (Max), change
    resource_name
  • m

    Massimiliano (Max)

    05/09/2022, 8:41 PM
    @vchepkov in this case it works, but it creates multiple checks, with different names, but they are checking the same service
  • m

    Massimiliano (Max)

    05/09/2022, 8:41 PM
    Copy code
    Notice: /Stage[main]/Xxxx_sensu::Server::Server/Sensu_check[prod-postgres02.xxx.org-check-consul-production-prod-postgres]/ensure: created
    Notice: /Stage[main]/Xxxx_sensu::Server::Server/Sensu_check[prod-postgres01.xxx.org-check-consul-production-prod-postgres]/ensure: created
  • v

    vchepkov

    05/09/2022, 8:42 PM
    hmm why would the check the same service? presumably it's on a different server?
  • v

    vchepkov

    05/09/2022, 8:43 PM
    hmm why would the check the same service? presumably it's on a different server?
  • m

    Massimiliano (Max)

    05/09/2022, 8:48 PM
    they are registered against consul as "prod-postgres", and one check is enough for both VMs. I will probably do the easy way.... kermit typing ...
  • v

    vchepkov

    05/09/2022, 8:51 PM
    I see, then you need to filter them and create only one
  • v

    vchepkov

    05/09/2022, 8:52 PM
    or export only from one
  • m

    Massimiliano (Max)

    05/09/2022, 8:52 PM
    exactly... the easy way, I add an optional parameter called "fqdn_match" and I get this:
    Copy code
    if ($fqdn_match) {
          if $fqdn_match in $facts['fqdn'] {
            xxxx_consul::agent::monitoring { $monitored_services:; }
          }
        } else {
          xxxx_consul::agent::monitoring { $monitored_services:; }
        }
  • m

    Massimiliano (Max)

    05/09/2022, 8:53 PM
    it's ugly.
  • v

    vchepkov

    05/09/2022, 8:53 PM
    well, make consul server export them πŸ™‚
  • v

    vchepkov

    05/09/2022, 8:54 PM
    or better yet, don't use export resources at all and construct whatever you need using pupperdb_query
  • s

    Slackbot

    05/09/2022, 8:55 PM
    This message was deleted.
    v
    w
    m
    • 4
    • 4
  • b

    bastelfreak

    05/09/2022, 9:06 PM
    or use the consul service registration \o/
  • b

    bastelfreak

    05/09/2022, 9:06 PM
    thats like exported resources... but fast!
  • w

    whatsaranjit

    05/09/2022, 9:07 PM
    No yea, that's really the most up-to-date option. Do an API call to Consul and get the data at the time it's needed.
  • m

    Massimiliano (Max)

    05/09/2022, 9:08 PM
    consul service is already registering, but I want to add a sensu check for each service. have an option to add the service to Sensu as well. Right now the check is using
    --all
    which means that I get rubbish in my monitoring from the test environment
  • m

    Massimiliano (Max)

    05/09/2022, 9:09 PM
    consul service is already registering, but I want to add a sensu check for each service. have an option to add the service to Sensu as well. Right now the check is using
    --all
    which means that I get rubbish in my monitoring for the test environment
  • m

    Massimiliano (Max)

    05/09/2022, 9:10 PM
    consul service is already registering, but I want to add a sensu check for each service. have an option to add the service to Sensu as well. Right now the check is using
    --all
    which means that I get rubbish in my monitoring from the test environment
  • w

    whatsaranjit

    05/09/2022, 9:11 PM
    Tangentially, Consul might discover a service, but Puppet will run ~30m later. And if that service dies, Consul will mark it as unhealthy and eventually deregister it. Puppet again only updates ~30m later.
  • w

    whatsaranjit

    05/09/2022, 9:15 PM
    Might be more of a Bolt on-demand type of thing.
  • m

    Massimiliano (Max)

    05/09/2022, 9:18 PM
    yeas... in order to exist the consul service, I need to declare the service in puppet. And when I declare it, I decide whether it has to be monitored, by adding an extra line... and now the line became two:
    Copy code
    class { 'xxxx_consul::agent::consul':
        monitored_services => $monitored_services,
        fqdn_match         => '01';
      }
    and monitored service is filled as following:
    Copy code
    $monitored_service = $::environment ? {
      'production' => 'my-super-service',
      default => undef
    }
  • m

    Massimiliano (Max)

    05/09/2022, 9:18 PM
    yeas... in order to exist the consul service, I need to declare the service in puppet. And when I declare it, I decide whether it has to be monitored, by adding an extra line... and now the line became two:
    Copy code
    class { 'xxxx_consul::agent::consul':
        monitored_services => $monitored_services,
        fqdn_match         => '01';
      }
    and monitored service is filled as following:
    Copy code
    $monitored_service = $::environment ? {
      'production' => 'my-super-service',
      default => undef
    }
  • s

    Slackbot

    05/10/2022, 2:58 AM
    This message was deleted.
    h
    k
    • 3
    • 7
  • c

    Craig Gumbley

    05/10/2022, 9:26 AM
    It’s been an age since our team last published an update. Looking forward to this becoming a regular thing again! Check out this weeks post from @David 'The Anvil' https://puppetlabs.github.io/content-and-tooling-team/blog/updates/2022-05-09-status-update/
    πŸ‘ 1
    πŸ‘‹ 2
  • s

    Slackbot

    05/10/2022, 12:21 PM
    This message was deleted.
    l
    j
    • 3
    • 2
  • s

    Slackbot

    05/10/2022, 12:40 PM
    This message was deleted.
    a
    l
    • 3
    • 9
  • a

    Allahshukur Ahmadzada

    05/10/2022, 12:40 PM
    Hello, there is a iteration which does a change on file, I need to restart service on last iteration, can I achieve it? actually it is exec resource
  • a

    Allahshukur Ahmadzada

    05/10/2022, 1:01 PM
    `'/bin/bash -c "if [
    find file -mmin -2
    ]; then exit 0; else exit 1; fi"',`
1...313233...428Latest