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

    CVQuesty

    06/17/2022, 2:48 PM
    what’s in your /etc/puppetlabs/code/environments directory?
  • c

    CVQuesty

    06/17/2022, 2:49 PM
    Love your dog, btw
  • j

    Jonathon Anderson

    06/17/2022, 2:50 PM
    oh thanks 🙂 unfortunately, he passed away. I got a new dog, but can't bring myself to change the picture
  • c

    CVQuesty

    06/17/2022, 2:50 PM
    awwww
  • j

    Jonathon Anderson

    06/17/2022, 2:50 PM
    yea, worst part about dogs
  • c

    CVQuesty

    06/17/2022, 2:50 PM
    dog person right here. Got me a picky schnauzer
  • j

    Jonathon Anderson

    06/17/2022, 2:51 PM
    I have a half pit half something rescue. Looks pretty similar to the dog in my picture actually
  • j

    Jonathon Anderson

    06/17/2022, 2:51 PM
    same color
  • c

    CVQuesty

    06/17/2022, 2:52 PM
    Ok, so clearly your issue intruiges me because this is not a core fact to Puppet: https://puppet.com/docs/puppet/7/core_facts.html
  • j

    Jonathon Anderson

    06/17/2022, 2:52 PM
    the only thing in that directory is 3 environment folders, production, dev, test
  • c

    CVQuesty

    06/17/2022, 2:53 PM
    That fact you’re trying to look up doesn’t exist in Facter natively, so there’s a custom fact value being expressed somewhere in your environment
  • j

    Jonathon Anderson

    06/17/2022, 2:53 PM
    I suppose that could be in a module that was added before me. I always assumed it was a builtin because it has a TON of information about puppet
  • c

    CVQuesty

    06/17/2022, 2:54 PM
    Generally speaking, Puppet’s config is found via
    puppet config print
  • n

    natemccurdy

    06/17/2022, 2:54 PM
    main is not the same thing as agent.
    this 1
  • c

    CVQuesty

    06/17/2022, 2:54 PM
    So, I wonder if you are configuring your system with a puppet module, and its in that module’s facts.d or lib/facter
  • c

    CVQuesty

    06/17/2022, 2:55 PM
    Nate always goes for the jugular. 😄
  • j

    Jonathon Anderson

    06/17/2022, 2:55 PM
    looks like it's in a module called simplib
  • j

    Jonathon Anderson

    06/17/2022, 2:56 PM
    or possibly stdlib
  • n

    natemccurdy

    06/17/2022, 2:56 PM
    sudo puppet config print environment --section main
    vs.
    sudo puppet config print environment --section agent
  • c

    CVQuesty

    06/17/2022, 2:57 PM
    yes. stdlib
  • c

    CVQuesty

    06/17/2022, 2:58 PM
    try this:
    facter puppet-settings.main.environment environment=production
  • c

    CVQuesty

    06/17/2022, 2:59 PM
    looks like that fact is intended to be used from within Puppet code:
    Copy code
    # These facter facts return the value of the Puppet vardir and environment path
    # settings for the node running puppet or puppet agent.  The intent is to
    # enable Puppet modules to automatically have insight into a place where they
    # can place variable data, or for modules running on the puppet master to know
    # where environments are stored.
  • j

    Jonathon Anderson

    06/17/2022, 3:00 PM
    yea, we've been using it to check environment, which works for all but one of our servers, the puppet master
  • c

    CVQuesty

    06/17/2022, 3:00 PM
    that’s in teh header of the puppet_settings fact in stdlib
  • c

    CVQuesty

    06/17/2022, 3:00 PM
    the Puppet master is…. shall we say…. “special”
  • c

    CVQuesty

    06/17/2022, 3:01 PM
    I would refrain on there. He may not even be classified with that class
  • j

    Jonathon Anderson

    06/17/2022, 3:01 PM
    probably... not sure how though. I'm thinking it might just be better to use
    $facts['agent_specified_environemt']
  • c

    CVQuesty

    06/17/2022, 3:03 PM
    again, your Puppet server is special. At some level, he “knows” about all the environments, and has visibility in each. He also can operate in any of them when compiling a catalog.
  • j

    Jonathon Anderson

    06/17/2022, 3:03 PM
    that doesn't look like a core fact either though
  • c

    CVQuesty

    06/17/2022, 3:03 PM
    how do you classify nodes? Hiera?
1...686970...428Latest