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

    Jonathon Anderson

    06/17/2022, 3:16 PM
    I've been wanting to get us on an ENC, but haven't had time to do that, either
  • c

    CVQuesty

    06/17/2022, 3:17 PM
    https://puppet.com/docs/puppet/7/nodes_external.html#writing-node-classifiers
  • c

    CVQuesty

    06/17/2022, 3:17 PM
    WHen the time presents itself
  • c

    CVQuesty

    06/17/2022, 3:17 PM
    Just a note: If they know what they’re doing, a Puppet consultant could convert you in a day or two max.
  • c

    CVQuesty

    06/17/2022, 3:19 PM
    There’s a lot of people classifying with Hiera, too. You don’t need an ENC, it just automagically knows
  • c

    CVQuesty

    06/17/2022, 3:19 PM
    This is the entirety of my site.pp:
    Copy code
    node default {
    
      lookup('classes', {merge => 'unique', default_value => []}).include
    
    }
  • j

    Jonathon Anderson

    06/17/2022, 3:20 PM
    I'd like to get to that point
  • l

    Lumiere

    06/17/2022, 3:20 PM
    (I recommend using trusted facts if you want to ENC with hiera)
  • c

    CVQuesty

    06/17/2022, 3:20 PM
    This is the entirety of my Hiera class:
    Copy code
    classes: 'sscg_roles::server'
  • c

    CVQuesty

    06/17/2022, 3:21 PM
    The entire role:
    Copy code
    # Main SSCG Server Role
    class sscg_roles::server {
    
      include sscg_profiles::base
      include sscg_profiles::lampstack
      include sscg_profiles::sscgatl
      include sscg_profiles::mvcf
    
    }
  • c

    CVQuesty

    06/17/2022, 3:23 PM
    The entirety of the base profile:
    Copy code
    # Base profile for all nodes
    class sscg_profiles::base {
    
      include sscg_profiles::hardening
      include sscg_profiles::ntp
    
    }
  • c

    CVQuesty

    06/17/2022, 3:24 PM
    the others are self-explanatory. By using automatic parameter lookup, I can just wantonly include modules, and make sure the settings I want are in Hiera, and it “jsut works”™
  • l

    Lumiere

    06/17/2022, 3:24 PM
    I do something slightly different, in that I have
    Copy code
    classes_main: # main is a stage, which we do use
      - 'profile_linux'
      - 'profile_nginx'
      - 'profile_monitoring'
    but with a hiera lookup_options that merges the key
  • c

    CVQuesty

    06/17/2022, 3:24 PM
    You’ve just made Hiera your role designator, it looks like
  • l

    Lumiere

    06/17/2022, 3:24 PM
    but we version all our profiles same as modules
  • c

    CVQuesty

    06/17/2022, 3:24 PM
    I try to follow the full roles/profiles spec because if I don’t, it’s hard to convince my customers to
  • j

    Jonathon Anderson

    06/17/2022, 3:24 PM
    I think if we had more people or a dedicated puppet team we could pull this off
  • l

    Lumiere

    06/17/2022, 3:25 PM
    yea, I am both the dev and the customer so 😄
  • c

    CVQuesty

    06/17/2022, 3:25 PM
    Yeah, it’s that whole “hockey stick” graph where the effort at the beginning is crazy, but the more you do, the less work you have
  • j

    Jonathon Anderson

    06/17/2022, 3:26 PM
    our current approach is an improvement. We were originally using only node declarations, which just didn't scale well, like the windows update scenario I shared above
  • c

    CVQuesty

    06/17/2022, 3:26 PM
    what’s your host naming look like (out of curiosity)?
  • j

    Jonathon Anderson

    06/17/2022, 3:26 PM
    it's much easier to declare an array of hosts to exclude and then check for their hostname than sift through all of the node declarations
  • j

    Jonathon Anderson

    06/17/2022, 3:27 PM
    eh, pretty mixed. we have a standard, but about 25% of our machines are still legacy
  • c

    CVQuesty

    06/17/2022, 3:27 PM
    ah… yeah, that solves a big part of what you’re conditional-ing around
  • v

    vchepkov

    06/17/2022, 3:28 PM
    servers are cattle, not pets 🙂
  • c

    CVQuesty

    06/17/2022, 3:28 PM
    a lot of times people will do platform/purpose/location/number in their hostname so they can just regex against it to glob a class at a whole host of machines at once
  • j

    Jonathon Anderson

    06/17/2022, 3:29 PM
    yea, although I think I'd still prefer conditionals over node declarations, again the array of hosts is easier to verify than needing to sort through all node declarations
  • c

    CVQuesty

    06/17/2022, 3:32 PM
    wwebhrea02
    Windows - Platform Web - function HR - purpose East - location 02 - host number Then you can do things like:
    Copy code
    node /^w$/ {
      include foo::blah
    }
  • l

    Lumiere

    06/17/2022, 3:32 PM
    yea, enforcing a hostname standard is 80% of the battle, we use role-nodeid.qualifier.dc.tier.product.company.tld now, (qualifier is optional, and only used for some specific products like our CI platform)
  • l

    Lumiere

    06/17/2022, 3:32 PM
    also, windows hostnames suck terribly
1...707172...428Latest