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

    tuxmea

    02/10/2023, 12:40 PM
    So you want to read information from Foreman. You can do so by making use of the foreman api: https://apidocs.theforeman.org/foreman/3.5/apidoc/v2.html There is a python extension available: https://github.com/david-caro/python-foreman This makes you independent from Puppet Server.
  • n

    Neeloj

    02/10/2023, 2:13 PM
    We dont use PuppetDB until now, but Ill read this: https://www.puppet.com/docs/puppet/7/server/http_api_index.html in hope to do something like what foreman do. Only about 5 Parameters. thank you so much @tuxmea, does forman use this api to talk to puppet ß
  • n

    Neeloj

    02/10/2023, 2:14 PM
    We dont use PuppetDB until now, but Ill read this: https://www.puppet.com/docs/puppet/7/server/http_api_index.html in hope to do something like what foreman do. Only about 5 Parameters. thank you so much @tuxmea, does forman use this api to talk to puppet ?
  • s

    Slackbot

    02/10/2023, 3:25 PM
    This message was deleted.
    y
    m
    • 3
    • 4
  • y

    Yury Bushmelev

    02/10/2023, 3:52 PM
    Anyone here is managing Jenkins with Puppet? How do you manage the configuration and jobs? Is it done with puppet-jenkins experimental features or with JCasC plugin?
  • d

    Dr Bunsen Honeydew

    02/10/2023, 3:52 PM
    See the
    puppet-jenkins
    module at https://forge.puppet.com/puppet/jenkins?src=slack&channel=puppet
  • l

    Lumiere

    02/10/2023, 4:03 PM
    we're using puppet to manage jcasc
  • s

    Slackbot

    02/10/2023, 4:03 PM
    This message was deleted.
    y
    d
    • 3
    • 2
  • i

    Ian CB

    02/10/2023, 4:32 PM
    Anyone got any insight on output from puppet module list - specifically I’m getting; Warning: “Missing dependency ‘MOD1’: ‘MOD2’ (v1.0) requires ‘MOD1’ (>= 0.0.0) And later in the listing MOD1 (v1.0) I’ve checked the metadata for the two modules and MOD2 does indeed have a dependency on MOD1 (version >= 0.0.0) - but whats confusing me is that MOD1 is installed at version 1.0 !!
  • n

    natemccurdy

    02/10/2023, 5:21 PM
    Is the
    v
    throwing off the comparison? Is MOD1's version in metadata.json literally
    v1.0
    ?
  • v

    vchepkov

    02/10/2023, 5:24 PM
    imho face adds it in output
  • n

    natemccurdy

    02/10/2023, 5:39 PM
    Ah yeah, I think you're right. That always confused me 🙂 Just show me the real value please.
  • b

    bastelfreak

    02/10/2023, 5:41 PM
    is that maybe in another environment? seeing the whole output would help :)
  • m

    Massimiliano (Max)

    02/10/2023, 5:41 PM
    In the past I spent some time to create this module.... it was pretty nice, but I'd rather use Gluster or Ceph these days. https://forge.puppet.com/modules/maxadamo/tiny_nas/readme
  • s

    Slackbot

    02/10/2023, 5:44 PM
    This message was deleted.
    j
    k
    • 3
    • 3
  • m

    Massimiliano (Max)

    02/10/2023, 5:53 PM
    Yes, a backup, where you sync a few directories would work. I took a few notes on loadbalancing techniques for puppet (you can disregard what I wrote about ZFS: I had strange ideas 😁 ) https://github.com/maxadamo/improved-puppetserver
  • m

    Massimiliano (Max)

    02/10/2023, 5:55 PM
    And this is the script, which detects CPU usage (it's like a Nagios script): https://github.com/maxadamo/improved-puppetserver/blob/master/scripts/puppet-check.sh
  • m

    Massimiliano (Max)

    02/10/2023, 6:23 PM
    it's going better today .... thanks I think Consul runs on FreeBSD as well. It's a Go application compiled for different architectures, but it implies that you need to reconfigure your DNS. Maybe the loadbalancer is more viable
  • r

    rusty

    02/10/2023, 7:12 PM
    Is there a way to tell, during either an agent run or an apply run, which type of run you are doing?
  • n

    natemccurdy

    02/10/2023, 7:13 PM
    Tell from within Puppet itself? Like... so you could use that information during catalog compilation?
  • r

    rusty

    02/10/2023, 7:13 PM
    yes.I'm trying to get around the lack of pluginsync for a bootstrap run. I can do this:
  • r

    rusty

    02/10/2023, 7:14 PM
    Copy code
    file { '/opt/puppetlabs/puppet/cache/lib/':
        ensure  => 'directory',
        source  => 'puppet:///plugins', # lint:ignore:puppet_url_without_modules
        recurse => true,
        purge   => false,
        backup  => false,
      }
  • r

    rusty

    02/10/2023, 7:14 PM
    only do :this when it is an apply run
  • r

    rusty

    02/10/2023, 7:14 PM
    because I need a bare minimum set of facts to bootstrap
  • r

    rusty

    02/10/2023, 7:14 PM
    after this, normal pluginsync would be used with agent
  • n

    natemccurdy

    02/10/2023, 7:16 PM
    So... I'm not totally sure I agree with your plan of making this dynamic in the Puppet code itself, but to answer your original question directly, one indirect way of determining
    apply
    vs.
    agent
    is to check for the presence of the
    $server_facts['servername']
    variable ref: https://www.puppet.com/docs/puppet/7/lang_facts_builtin_variables.html#lang_facts_builtin_variables-server-facts
  • c

    CVQuesty

    02/10/2023, 7:17 PM
    Like, do a “preload” module that runs first, and has a lib/facter or a facts.d to get the facts synced over immediately before doing anything else
  • m

    Mike Langhorst

    02/10/2023, 7:17 PM
    what's the best/proper way to check for a variable that's got an undef value? I'd like to be able to use a value from hiera if supplied, but if not set a var to a calculated value using facts
  • n

    natemccurdy

    02/10/2023, 7:17 PM
    Copy code
    if getvar('server_facts.servername') {
      notice("I'm in agent mode")
    } else {
      notice("I'm in apply mode")
    }
  • n

    natemccurdy

    02/10/2023, 7:17 PM
    Copy code
    if getvar('server_facts.servername') {
      notice("I'm in agent mode")
    } else {
      notice("I'm in apply mode")
    }
1...303304305...428Latest