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

    rismoney

    08/11/2023, 7:26 PM
    is there an easy way to convert a puppet hash into a json var ? like: $my_hash = { "key1" => "value1", "key2" => "value2", "key3" => "value3" } $my_json = json($my_hash)
  • l

    Lumiere

    08/11/2023, 7:30 PM
    yes, in stdlib there's a to_json function
  • l

    Lumiere

    08/11/2023, 7:30 PM
    that does exactly that
  • l

    Lumiere

    08/11/2023, 7:30 PM
    puppetlabs/stdlib
  • d

    Dr Bunsen Honeydew

    08/11/2023, 7:30 PM
    See the
    puppetlabs-stdlib
    module at https://forge.puppet.com/puppetlabs/stdlib?src=slack&channel=puppet
  • r

    rismoney

    08/11/2023, 7:32 PM
    excellent! guess my searching foo evaded me here
  • l

    Lumiere

    08/11/2023, 7:33 PM
    all good, there's also a to_yaml
  • l

    Lumiere

    08/11/2023, 7:34 PM
    they're my favorite 2 functions in stdlib
  • s

    Slackbot

    08/12/2023, 2:44 PM
    This message was deleted.
    b
    r
    d
    • 4
    • 8
  • e

    emerson_prado

    08/12/2023, 7:30 PM
    When using custom resource API , is it possible to read a parameter value from inside
    get
    method? I need to limit the
    get
    method to retrieve a single resource - as opposed to all resources from the custom type. Other resources aren't needed, and querying all of them is quite costly. I can do it in the low level method, but wanted to make sure it isn't overkill.
  • e

    emerson_prado

    08/12/2023, 7:32 PM
    I RTFM and STFW to exaustion, but couldn't find the slightest hint on that...
  • s

    Slackbot

    08/12/2023, 10:22 PM
    This message was deleted.
    k
    m
    • 3
    • 2
  • s

    Slackbot

    08/14/2023, 7:43 AM
    This message was deleted.
    m
    n
    +2
    • 5
    • 64
  • r

    richard li

    08/14/2023, 7:58 AM
    [root@US02-5037MR-003-02 puppetlabs]# puppet-code deploy --all Deploying all environments. 2023/08/14 075502 ERROR - [POST /deploys][500] Errors while collecting a list of environments to deploy (exit code: 1). "ERROR\t -\u003e Unable to load sources; the supplied configuration does not define the 'sources' key\n"
  • s

    Slackbot

    08/14/2023, 7:58 AM
    This message was deleted.
    b
    r
    +2
    • 5
    • 20
  • s

    Slackbot

    08/14/2023, 8:33 AM
    This message was deleted.
    y
    a
    • 3
    • 2
  • s

    Slackbot

    08/14/2023, 12:15 PM
    This message was deleted.
    v
    y
    +2
    • 5
    • 41
  • v

    vchepkov

    08/14/2023, 12:54 PM
    I have a strange issue, not sure how to debug. Once in a blue moon, some of the servers 'disappear' from puppetdb, only to re-appear back next agent run.
    Copy code
    $servers_query = 'resources[certname]{ type = "Class" and title = "Some::Profile" }'
      $servers = puppetdb_query($servers_query).map |$value| { $value['certname'] }
    Server classification is static, so not sure, why would that be the case. Doesn't happen often, like 4-5 times a month, but enough to trigger my inner-sheldon
  • c

    CVQuesty

    08/14/2023, 1:05 PM
    Lol. "inner sheldon"
    😁 1
  • b

    bastelfreak

    08/14/2023, 1:09 PM
    did you check if puppetdb deleted the node?
  • v

    vchepkov

    08/14/2023, 1:10 PM
    By the time I see the change, it's 'self-corrected', lasts only one agent run
  • v

    vchepkov

    08/14/2023, 1:11 PM
    like for whatever reason node decides it's not classified anymore
  • v

    vchepkov

    08/14/2023, 1:13 PM
    That 7 matches the accident
  • v

    vchepkov

    08/14/2023, 1:14 PM
    Only 'schedule' and 'filebucket' resources included
  • v

    vchepkov

    08/14/2023, 1:14 PM
    nothing else
  • b

    bastelfreak

    08/14/2023, 1:18 PM
    did it change environment?
  • b

    bastelfreak

    08/14/2023, 1:18 PM
    do you do classification based on facts?
  • b

    bastelfreak

    08/14/2023, 1:18 PM
    was the environment code not present on the compiler?
  • v

    vchepkov

    08/14/2023, 1:19 PM
    that would affect all other servers and only one was at the time. Nope, classification on these is static
1...407408409...428Latest